<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Azizah on Medium]]></title>
        <description><![CDATA[Stories by Azizah on Medium]]></description>
        <link>https://medium.com/@azizahdahlan?source=rss-e92117ccd4af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rrHIYZD14G9qgDFryRVxug.jpeg</url>
            <title>Stories by Azizah on Medium</title>
            <link>https://medium.com/@azizahdahlan?source=rss-e92117ccd4af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:46:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@azizahdahlan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Learning SQL the Easy Way: Why I Now See Databases in Grocery Stores]]></title>
            <link>https://medium.com/@azizahdahlan/learning-sql-the-easy-way-why-i-now-see-databases-in-grocery-stores-08153acb4799?source=rss-e92117ccd4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/08153acb4799</guid>
            <category><![CDATA[sql-for-beginners]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[learn-sql]]></category>
            <category><![CDATA[grocery-shopping]]></category>
            <dc:creator><![CDATA[Azizah]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 10:00:46 GMT</pubDate>
            <atom:updated>2026-11-02T10:00:46.220Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1: The Basics</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hRfDFBuFqIrANJdh" /><figcaption>Photo by <a href="https://unsplash.com/@heyquilia?utm_source=medium&amp;utm_medium=referral">Quilia</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><em>“A statistician is a chef, and data is simply like tofu. You must understand your menu better. So please be careful when you hold a knife (the tool you use for analysis) because you are responsible for what others consume.”</em></blockquote><p>That quote has stayed with me ever since I graduated from university. My lecturer said it during a statistical consulting class, and in that moment, I knew I wanted to be a statistician with integrity. But recently, as I’ve been diving back in to refresh my SQL skills, those words became a completely different kind of reference point. I realised that to be a responsible data chef, I first needed to know how to efficiently navigate the market.</p><h3>Welcome to The Market</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*32-PBKvXGd80aatk" /><figcaption>Photo by <a href="https://unsplash.com/@jack19992011?utm_source=medium&amp;utm_medium=referral">Jack Lee</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One day, while I was pushing a cart down the grocery store aisle after a long SQL study session, my brain did something funny. Out of nowhere, I started thinking in metaphors.</p><p>I pictured the entire market — with its few thousand products, hundreds of customers, and staff roster. I imagined a manager standing somewhere with a clipboard, possessing a perfect, photographic memory of where everything was. I realised that a database was just that manager’s memory, and SQL was simply my way of talking to them.</p><p>Instead of wandering the aisles looking for oat milk, I imagined walking up to that manager and asking: <em>“Where is the yoghurt and milk located? Which aisle?”</em></p><p>That was my lightbulb moment. SQL is code to describe exactly what I wanted so the database could figure out how to fetch it.</p><p><strong>Mapping the store</strong></p><p>To make sense of it all, I started mapping database concepts to the physical market in my head:</p><ol><li><strong>The database</strong> became the entire market.</li><li><strong>A table</strong> was one of the lists the market kept: a list of products, a list of customers, a list of employees.</li><li><strong>A row</strong> was a single entry on that list (like one specific carton of milk).</li><li><strong>A column</strong> was a specific fact recorded about every item, like its name or its price.</li></ol><p>I realised the products table was essentially just a massive spreadsheet with a header row. Since I already knew how to use Excel, I understood the shape of it. The only thing that changed was that instead of endlessly scrolling and filtering by hand, I could just query it.</p><h4>SELECT and FROM: Asking for what I needed</h4><p>I learned that whenever I wanted to find something, my thought process always had to start with two questions: <em>What do I want, and where does it live?</em></p><pre>SELECT name, price<br>FROM products;</pre><p>This was me telling the database, “SELECT the columns, and pull them FROM this specific table.&quot; It felt empowering.</p><p>I also figured out that if I just wanted to dump everything in the table to get a look at an unfamiliar list, I could use the asterisk (*):</p><pre>SELECT * <br>FROM products;</pre><p>Though I quickly learned not to rely on * too much for queries I planned to reuse, otherwise I’d end up dragging a bunch of useless columns back to my cart that I was never going to read.</p><h4>WHERE: Filtering out the noise</h4><p>Of course, I rarely wanted the whole store. I just wanted the items that mattered to me. That’s where WHERE came in.</p><pre>SELECT name, price<br>FROM products<br>WHERE price &lt; 15000;</pre><p>This was my “everything under Rp 15000” request. I got comfortable with the usual math operators (=, &lt;, &gt;, &lt;=, &gt;=), and when I wanted to say &quot;not equal,&quot; I learned to use &lt;&gt; (or !=).</p><p>I also tripped up a few times with text. I learned the hard way that double quotes are generally meant for column names, so I forced myself to stick strictly to single quotes for text to avoid frustrating bugs:</p><pre>SELECT name, price<br>FROM products<br>WHERE name = &#39;Gyoza Ayam&#39;;</pre><p>When my shopping lists got more complicated, I started chaining tests together with AND (both are true) and OR (one of them is true, or both are true):</p><pre>SELECT name, price<br>FROM products<br>WHERE price &lt; 15000 <br>  AND price &gt; 1000;</pre><p>I had to remind myself to use parentheses when mixing the two, because the database wouldn’t just read it left-to-right the way my human brain did. Since AND binds tighter, writing out A OR (B AND C) explicitly saved me from a lot of guesswork.</p><p>I also fell in love with a couple of shortcuts. BETWEEN made ranges look much cleaner, and IN let me check against a specific list of cravings:</p><pre>SELECT name, price<br>FROM products<br>WHERE name IN (&#39;Strawberry Milk&#39;, &#39;Yoghurt&#39;, &#39;Apple&#39;);</pre><p>And on the days I couldn’t remember exactly what a product was called? I found that using LIKE with % as a wildcard was perfect for fuzzy matching:</p><pre>SELECT name<br>FROM products<br>WHERE name LIKE &#39;%milk%&#39;;</pre><p>That one query would catch “Whole Milk”, “Oat Milk”, and “Milk Chocolate” all at once.</p><h4>ORDER BY and LIMIT: Sorting it out</h4><p>I noticed pretty quickly that databases hand you back rows in no promised order. If I wanted my list sorted, I had to be bossy about it:</p><pre>SELECT name, price<br>FROM products<br>ORDER BY price;</pre><p>Cheapest first was the default, but adding DESC flipped it. When I combined that with LIMIT to cap the results, I could finally answer questions like, <em>&quot;What are the five most expensive items in this store?&quot;</em></p><pre>SELECT name, price<br>FROM products<br>ORDER BY price DESC<br>LIMIT 5;</pre><h4>DISTINCT: Removing the repeats</h4><p>Then there was the duplicate problem. When looking at the customers table, I wanted to know which cities our shoppers were coming from. A plain SELECT gave me one city per customer, meaning the same city showed up dozens of times.</p><p>Discovering DISTINCT felt like putting on noise-cancelling headphones:</p><pre>SELECT DISTINCT city<br>FROM customers;</pre><p>Suddenly, each city appeared just once.</p><pre>SELECT name, price<br>FROM products<br>WHERE price &lt; 50000<br>ORDER BY price DESC<br>LIMIT 3;</pre><p>To help it stick, I started reading it as a sentence: <em>From the products, keep those under Rp 50,000, sort by price from highest to lowest, and give me the top three.</em></p><p>I learned quickly that if I tried to write ORDER BY before WHERE, SQL would throw a syntax error right back at me. The structure was non-negotiable, and I just had to memorise it.</p><p>By the end of the week, I was walking down the aisles of my local market, mentally querying the shelves. <em>List the name and price of every product over Rp 35,000. Show me all the items with “juice” in the name, cheapest first.</em></p><p>My grocery trips haven’t been the same since. And I haven’t even gotten to the part where the manager starts doing the math for me with aggregate functions.</p><p><em>(Part 2 coming soon)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08153acb4799" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manipulasi Tabel dalam Database]]></title>
            <link>https://medium.com/@azizahdahlan/manipulasi-tabel-dalam-database-90f110a106a2?source=rss-e92117ccd4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/90f110a106a2</guid>
            <category><![CDATA[dml]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[database-management]]></category>
            <category><![CDATA[data-manipulation-sql]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Azizah]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 06:28:31 GMT</pubDate>
            <atom:updated>2025-04-07T06:28:31.943Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Data Manipulation Language</em> (DML)</p><p><em>Data Manipulation Language</em> (DML) adalah sekumpulan perintah yang digunakan untuk melakukan pengelolaan <em>database </em>seperti membuat, menambah, menghapus, dan menampilkan. Perintah utamanya adalah seperti UPDATE, DELETE, INSERT, SELECT. Perintah UPDATE digunakan ketika ingin melakukan pembaruan data, dan perintah DELETE digunakan jika ingin menghapus data. Selain itu ada juga perintah INSERT yang dapat digunakan untuk memasukkan data ke dalam <em>database</em> dan terakhir ada perintah SELECT yang digunakan untuk menampilkan data yang telah dimasukkan. (Riyadi, 2019)</p><p>Dalam pengertiannya, manipulasi tabel merupakan proses memodifikasi isi tabel baik menambahkan atau mengurangi isinya atau mengubah isi tabel yang sudah ada. (Ardhian, 2018). Lalu untuk kegunaannya, perubahan tabel yang telah dibuat pasti akan selalu dilakukan mengingat perkembangan <em>database</em> yang dibangun. Dalam implementasinya banyak sekali hal yang bisa dilakukan untuk manipulasi bentuk tabel yang telah ada dengan versi lebih baru, termasuk diantaranya menambahkan <em>field</em>, mengganti nama <em>field</em> maupun tabel. (Amalia, 2020).</p><p>Pada artikel ini menggunakan XAMPP untuk melakukan manipulasi tabel dalam <em>database</em> menggunakan MySQL. XAMPP adalah <em>open source</em> dari kumpulan beberapa <em>software; X </em>untuk sistem operasi apapun, A untuk Apache, M untuk MySQL, P untuk PHP, dan P di akhir adalah Perl.</p><p>XAMPP dapat diunduh melalui web <a href="https://www.apachefriends.org/">ini</a>, dan bisa digunakan untuk Windows, Linux, maupun OS X (Mac OS).</p><p>Setelah berhasil mengunduh, lalu buka XAMPP tersebut kemudian pada tab ‘Manage Servers’, klik Start All</p><p>Dengan menggunakan Mac OS, maka langkah selanjutnya adalah membuka terminal dan memulai MySQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/109/1*Ak2bPU4qRe0rGjP_b3WzOQ.png" /><figcaption>Tampilan Aplikasi Terminal di Desktop</figcaption></figure><p>Ada berbagai cara untuk memulai MySQL di Terminal, diantaranya adalah dengan menggunakan perintah-perintah sebagai berikut.</p><pre>mysql -u root -p</pre><p>artinya adalah login kedalam MySQL sebagai super admin atau ‘root’.</p><p>Cara lainnya untuk masuk pada MySQL adalah dengan host dimana menempatkan MySQL itu berada, sebagai contoh:</p><pre>mysql -u root -h 192.168.10.1 -p</pre><p>sehingga dapat dikatakan bahwa MySQL diletakkan pada alamat 192.168.10.1 ini.</p><p>Berikut adalah tampilkan ketika Terminal berhasil login pada MySQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*HwEXJEqzB5J0GWgoGUec4g.png" /><figcaption>Tampilan Terminal dengan MySQL yang Sudah Ready</figcaption></figure><p>Dalam pendahuluan disebutkan bahwa perangkat lunak ini adalah MariaDB, sebagai pengganti MySQL yang telah diakuisisi oleh Oracle, dari pengembang yang sama sehingga hampir semua yang ada di MySQL ada di MariaDB.</p><p>Untuk melihat database yang ada pada MySQL, dapat menggunakan perintah</p><pre>SHOW databases;</pre><p>maka Terminal akan menampilkan isi dari Database yang ada pada MySQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*OY9ES0TprcuKP0ekawoTMg.png" /><figcaption>Metadata Database</figcaption></figure><p>terlihat bahwa terdapat information_schema, mysql, serta performance_schema yang merupakan Metadata Database yang berisi tentang informasi mysql server tersebut. Dalam mysql, data akan disusun dalam bentuk database, dan dalam database akan terdapat banyak tabel.</p><p>Untuk membuat database baru dengan nama belajar, maka syntax yang digunakan adalah sebagai berikut.</p><pre>CREATE DATABASE belajar;</pre><p>berikut tampilan ketika berhasil di run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*Y5OccEW9jtnI2NZQMsKbxg.png" /><figcaption>Membuat Database Baru Bernama ‘belajar’</figcaption></figure><p>Lalu ketika diperlukan menambah tabel dalam database belajar tersebut, pertama-tama gunakan dulu database belajar tersebut dengan syntax:</p><pre>USE belajar;</pre><p>kemudian buat tabel yang diperlukan, contohnya seperti tabel jadwal belajar lengkap dengan struktur tabelnya yang terdapat Hari, Waktu, Kelas, juga Guru yang mengajar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*gLZLzwwHuoAhTqwPCUpFEg.png" /><figcaption>Perintah menggunakan database dan membuat tabel</figcaption></figure><p>Ketika akan melihat struktur tabelnya, maka digunakan perintah</p><pre>DESC jadwal_belajar;</pre><p>sehingga akan didapatkan output sebagai berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*KQZfHzXq2lYKiGPO4entyQ.png" /><figcaption>Struktur tabel yang telah dibuat</figcaption></figure><p>Kemudian jika ingin menambahkan primary key pada tabel tersebut, digunakan perintah berikut:</p><pre>ALTER TABLE Jadwal_belajar<br>  ADD Primary Key (Guru);</pre><p>Selain itu, ketika ingin menambahkan kolom unique pada tabel; yaitu kolom yang bisa diciptakan lebih dari satu dalam sebuah tabel– hal ini berbeda dengan primary key yang hanya boleh satu dalam setiap tabel, menggunakan perintah sebagai berikut:</p><pre>ALTER TABLE Jadwal_belajar<br>  ADD UNIQUE (Hari);</pre><p>Lalu jika ingin menambahkan kolom baru pada tabel tersebut, dapat menggunakan syntax berikut:</p><pre>ALTER TABLE Jadwal_belajar<br>  ADD Sesi INTEGER (1);</pre><p>Kemudian jika menyadari adanya kesalahan penamaan tabel, maka dapat dirubah menggunakan perintah berikut:</p><pre>RENAME TABLE Jadwal_belajar to jadwal_pelajaran;</pre><p>Namun, jika masih mau mengubah salah satu kolom, misalnya kolom bernama ‘Sesi’ dengan nama ‘Pertemuan’ dengan tipe data CHAR, maka digunakanlah perintah berikut ini:</p><pre>ALTER TABLE Jadwal_belajar<br>  CHANGE Sesi Pertemuan CHAR (5);</pre><p>Maka, strukur tabel tersebut setelah dimanipulasi akan menjadi seperti berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*a7onQ6l7cKUe1jZIs7Agvw.png" /><figcaption>Tabel jadwal pelajaran setelah dimanipulasi</figcaption></figure><p>Terlihat dari struktur tabel tersebut, bahwa primary key ada pada kolom Guru, sedangkan kolom unique adalah Hari. Selain itu, tidak ada lagi kolom bernama Sesi karena sudah diganti menjadi Pertemuan.</p><p>Untuk menambahkan tabel baru dalam database yang sama, maka bisa langsung memerintahkan MySQL dengan perintah CREATE DATABASE. Berikut adalah tabel baru dalam database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*TWFkpE6838WpJ_nVD2zuFw.png" /><figcaption>Perintah membuat tabel baru</figcaption></figure><p>Terlihat bahwa pada tabel baru tersebut, terdapat perintah ENUM dan SET. Untuk melihat hasil struktur tabelnya, maka jalankan perintah berikut:</p><pre>DESC Profil_sekolah;</pre><p>Maka akan tampil:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*IXPlmuX6QZVtSTx1W9X2Cg.png" /></figure><p>Perintah ENUM yang ada pada kolom Visi_Misi dan perintah SET pada Struktur_Organisasi memiliki arti bahwa kolom tersebut terbentuk suatu validasi data yang mengijinkan dua buah data pada kolom bertipe ENUM dan sepuluh data pada kolom bertipe SET. Maka ketika memasukkan input selain data yang tercantum tersebut, sistem akan mengabaikannya atau muncul pesan terjadi kesalahan.</p><p>Selanjutnya, ketika hendak melihat tabel yang ada pada database, maka dapat menjalankan perintah:</p><pre>SHOW tables;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*E_aGJ9lUQvGkTHXD0wCscA.png" /><figcaption>Tabel dalam Database</figcaption></figure><p>Terlihat bahwa tabel yang ada pada database adalah sebanyak dua, yaitu tabel profil sekolah dan tabel jadwal pelajaran.</p><p>Namun ketika tabel sudah tidak dibutuhkan lagi, dapat dihapus dengan perintah berikut:</p><pre>DROP TABLE Profil_sekolah;</pre><p>Setelah itu coba cek ulang dengan perintah</p><pre>DESC Profil_sekolah;</pre><p>Maka akan muncul output sebagai berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*5Wvqz0vFFIipDMclqovE2A.png" /><figcaption>Menghapus dan Menampilkan Tabel Profil Sekolah</figcaption></figure><p>Terlihat pada gambar diatas bahwa tabel profil sekolah berhasil dihapus dengan bukti bahwa ketika dimunculkan kembali, MySQL mengeluarkan output ERROR dengan deskripsi bahwa tabel tersebut sudah tidak ada.</p><p>Terakhir adalah ketika akan keluar dari MySQL, maka dapat menggunakan perintah berikut</p><pre>quit</pre><p>Sehingga MySQL akan menampilkan kata “Bye” dan Terminal akan kembali kepada bash.</p><p>Sekian.</p><p>Terima Kasih!</p><p>REFERENSI:</p><p><strong>Riyadi, H. (2019, Juni 29)</strong>. Pengertian DDL dan DML Pengertian DDL dan DML Beserta Contoh Perintahnya dalam Database. Retrieved from Nesaba media: <a href="https://www.nesabamedia.com/pengertian-ddl-dan-dml/">https://www.nesabamedia.com/pengertian-ddl-dan-dml/</a></p><p><strong>Amalia, R. N. (2020, November 4)</strong>. Manipulasi Tabel MySQL. Retrieved from Medium:</p><p><a href="https://rizkynrmlia.medium.com/manipulasi-tabel-mysql-">https://rizkynrmlia.medium.com/manipulasi-tabel-mysql-</a>e9faebccc98c</p><p><strong>Ardhian, A. (2018)</strong>. Modul 3 Manipulasi tabel (Basis Data).docx. Retrieved from Academia: <a href="https://www.academia.edu/37864311/Modul_3_Manipulasi_tabel_Basis_">https://www.academia.edu/37864311/Modul_3_Manipulasi_tabel_Basis_</a>Data_docx</p><p><strong>Balai SDA Sumatera. (2011)</strong>. Validasi Data — Direktorat Jendral Sumber Daya Air. Retrieved from Dirjen Sumber Daya Air: <a href="http://sda.pu.go.id/balai/bwssumatera2/file/1639">http://sda.pu.go.id/balai/bwssumatera2/file/1639</a></p><p><strong>Hakim, RB Fajriya. (2019, Agustus 4).</strong> Pengantar SQL bagian 1 Retrieved from Medium: <a href="https://medium.com/@986110101/pengantar-sql-bagian-1-d91c7c363857">https://medium.com/@986110101/pengantar-sql-bagian-1-d91c7c363857</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90f110a106a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Food Recommendation System]]></title>
            <link>https://medium.com/@azizahdahlan/building-a-food-recommendation-system-581c5959e170?source=rss-e92117ccd4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/581c5959e170</guid>
            <category><![CDATA[collaborative-filtering]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <dc:creator><![CDATA[Azizah]]></dc:creator>
            <pubDate>Sun, 23 Jul 2023 08:33:13 GMT</pubDate>
            <atom:updated>2026-11-16T06:32:59.859Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Py_Df71Rmbn9VYmPszRyeA.png" /><figcaption>Image by <a href="https://id.pngtree.com/ingimage_45789638?type=1">ingimage</a> from <a href="https://id.pngtree.com/freepng/people-ordering-food-in-cafe-and-online_8707773.html">pngtree</a></figcaption></figure><p>People are usually puzzled when they go to get food online or create their own meal, occasionally asking friends and relatives and making food selections to order or make. So, the goal of creating this food recommendation system is to deliver menu ideas based on the ratings.</p><p><strong>DATASET</strong></p><p>Using R or Python, data for the meal recommender system may be collected by scraping internet pages that include recipes or menu listings. However, the data utilised in this research originates from K<a href="https://www.kaggle.com/datasets/canggih/indonesian-food-recipes">aggle</a> data, which is scraped from the cookpad.com website and consists of various files that have been segregated depending on the menu’s major ingredient group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzBy67RQlfYmB0HLSvdF1Q.png" /><figcaption>Contoh data pada dataset tempe</figcaption></figure><p>The collection comprises category meals such as chicken, fish, lamb, beef, tofu, eggs, tempeh, and shrimp. However, in this project only use all categories except the shrimp category. There are various columns in the dataset for each category, including the title (menu name), ingredients, manufacturing procedures, the number of individuals who appreciate the dish, and the recipe URL. In addition, there is data on the number of users who give ratings to each menu.</p><p><strong>DATA Pre-Processing</strong></p><p>Before developing the engine, the data must be clean. When exploring the data, I noticed that for some combinations of user and food, there are multiple ratings, while in theory there should only be one (unless users can rate a food several times). Furthermore, for the collaborative filtering, it is better to have more ratings per user. So I decided to remove users who have rated fewer than 3 foods.</p><ul><li>So let’s first remove the duplicate ratings</li></ul><pre>ratings[, N := .N, .(user_id, food_id)]<br>## corresponding dplyr code<br># ratings %&gt;% group_by(user_id, food_id) %&gt;% mutate(n=n())<br>cat(&#39;Number of duplicate ratings: &#39;, nrow(ratings[N &gt; 1]))<br>ratings &lt;- ratings[N == 1]</pre><ul><li>And then let’s remove users who rated fewer than 3 foods</li></ul><pre>ratings[, N := .N, .(user_id)]<br>## corresponding dplyr code<br># ratings %&gt;% group_by(user_id) %&gt;% mutate(n = n())<br>cat(&#39;Number of users who rated fewer than 3 foods: &#39;, uniqueN(ratings[N &lt;= 2, user_id]))<br>ratings &lt;- ratings[N &gt; 2]</pre><ul><li>Select a subset of users</li></ul><pre>set.seed(1)<br>user_fraction &lt;- 0.2<br>users &lt;- unique(ratings$user_id)<br>sample_users &lt;- sample(users, round(user_fraction * length(users)))<br><br>cat(&#39;Number of ratings (before): &#39;, nrow(ratings))<br>ratings &lt;- ratings[user_id %in% sample_users]<br>cat(&#39;Number of ratings (after): &#39;, nrow(ratings))</pre><p><strong>EXPLORATORY DATA</strong></p><ul><li>What is the distribution of ratings?</li></ul><pre>ratings %&gt;% <br> ggplot(aes(x = rating, fill = factor(rating))) +<br> geom_bar(color = &quot;grey20&quot;) + scale_fill_brewer(palette = &quot;YlGnBu&quot;) + guides(fill = FALSE)</pre><ul><li>Number of ratings per user</li></ul><pre>ratings %&gt;% <br> group_by(user_id) %&gt;% <br> summarize(number_of_ratings_per_user = n()) %&gt;% <br> ggplot(aes(number_of_ratings_per_user)) + <br> geom_bar(fill = &quot;cadetblue3&quot;, color = &quot;grey20&quot;) + coord_cartesian(c(3, 50))</pre><ul><li>Distribution of mean user ratings<br>People tend to rate foods differently. Some give 5 stars to mediocre food, while others only give 5 stars if it’s perfect for them. On the right side, there is a bump from users with a mean rating of 5, indicating that they really liked all foods (or they only rated foods they really like…). We can also see that there are nearly no notorious down-voters rating all foods with such tendencies, which are going to be important for collaborative filtering later and are typically dealt with by subtracting the user’s mean rating from their ratings.</li></ul><pre>ratings %&gt;% <br> group_by(user_id) %&gt;% <br> summarize(mean_user_rating = mean(rating)) %&gt;% <br> ggplot(aes(mean_user_rating)) +<br> geom_histogram(fill = &quot;cadetblue3&quot;, color = &quot;grey20&quot;)</pre><ul><li>Number of ratings per food</li></ul><pre>ratings %&gt;% <br> group_by(food_id) %&gt;% <br> summarize(number_of_ratings_per_food = n()) %&gt;% <br> ggplot(aes(number_of_ratings_per_food)) + <br> geom_bar(fill = &quot;orange&quot;, color = &quot;grey20&quot;, width = 1) + coord_cartesian(c(0,40))</pre><ul><li>Distribution of mean food ratings<br>Mean food ratings don’t reveal any peculiarities.</li></ul><pre>ratings %&gt;% <br>  group_by(user_id) %&gt;% <br>  summarize(mean_user_rating = mean(rating)) %&gt;% <br>  ggplot(aes(mean_user_rating)) +<br>  geom_histogram(fill = &quot;cadetblue3&quot;, color = &quot;grey20&quot;)</pre><ul><li>Top 10 Rated Foods</li></ul><pre><br>foods %&gt;% <br>  mutate(image = paste0(&#39;&lt;img src=&quot;&#39;, small_image_url, &#39;&quot;&gt;&lt;/img&gt;&#39;)) %&gt;% <br>  arrange(-average_rating) %&gt;% <br>  top_n(10,wt = average_rating) %&gt;% <br>  select(image, title, ratings_count, average_rating) %&gt;% <br>  datatable(class = &quot;nowrap hover row-border&quot;, escape = FALSE, options = list(dom = &#39;t&#39;,scrollX = TRUE, autoWidth = TRUE)</pre><ul><li>Top 10 popular foods</li></ul><pre>foods %&gt;% <br>  mutate(image = paste0(&#39;&lt;img src=&quot;&#39;, small_image_url, &#39;&quot;&gt;&lt;/img&gt;&#39;)) %&gt;% <br>  arrange(-ratings_count) %&gt;% <br>  top_n(10,wt = ratings_count) %&gt;% <br>  select(image, title, ratings_count, average_rating) %&gt;% <br>  datatable(class = &quot;nowrap hover row-border&quot;, escape = FALSE, options = list(dom = &#39;t&#39;,scrollX = TRUE, autoWidth = TRUE))</pre><ul><li>What influences a food’s rating?</li></ul><pre>tmp &lt;- foods %&gt;% <br>  select(one_of(c(&quot;foods_count&quot;,&quot;original_publication_year&quot;,&quot;ratings_count&quot;, &quot;work_ratings_count&quot;, &quot;work_text_reviews_count&quot;, &quot;average_rating&quot;))) %&gt;% <br>  as.matrix()<br><br>corrplot(cor(tmp, use = &#39;pairwise.complete.obs&#39;), type = &quot;lower&quot;)</pre><ul><li>Is there a relationship between the number of ratings and the average rating?</li></ul><pre>get_cor &lt;- function(df){<br>    m &lt;- cor(df$x,df$y, use=&quot;pairwise.complete.obs&quot;);<br>    eq &lt;- substitute(italic(r) == cor, list(cor = format(m, digits = 2)))<br>    as.character(as.expression(eq));                 <br>}<br><br>foods %&gt;% <br>  filter(ratings_count &lt; 1e+5) %&gt;% <br>  ggplot(aes(ratings_count, average_rating)) + stat_bin_hex(bins = 50) + scale_fill_distiller(palette = &quot;Spectral&quot;) + <br>  stat_smooth(method = &quot;lm&quot;, color = &quot;orchid&quot;, size = 2) +<br>  annotate(&quot;text&quot;, x = 85000, y = 2.7, label = get_cor(data.frame(x = foods$ratings_count, y = foods$average_rating)), parse = TRUE, color = &quot;orchid&quot;, size = 7)</pre><ul><li>Do frequent raters rate differently?</li></ul><pre>tmp &lt;- ratings %&gt;% <br>  group_by(user_id) %&gt;% <br>  summarize(mean_rating = mean(rating), number_of_rated_foods = n())<br><br>tmp %&gt;% filter(number_of_rated_foods &lt;= 100) %&gt;% <br>  ggplot(aes(number_of_rated_foods, mean_rating)) + stat_bin_hex(bins = 50) + scale_fill_distiller(palette = &quot;Spectral&quot;) + stat_smooth(method = &quot;lm&quot;, color = &quot;orchid&quot;, size = 2, se = FALSE) +<br>  annotate(&quot;text&quot;, x = 80, y = 1.9, label = get_cor(data.frame(x = tmp$number_of_rated_foods, y = tmp$mean_rating)), color = &quot;orchid&quot;, size = 7, parse = TRUE)</pre><p><strong>COLLABORATIVE FILTERING</strong></p><p>Collaborative filtering is a standard method for product recommendations. To get the general idea consider this example:</p><p>Imagine you want to try a new food, but you don’t know which one might be worth trying. You have a certain friend, with whom you have talked about some foods and you typically have had quite a similar opinion on those foods. It would then be a good idea to ask this friend whether he read and liked some foods that you don’t know yet. These would be good candidates for your next food.</p><p>What I described above is exactly the main idea of the so called user-based collaborative filtering. It works as follows:</p><ol><li>You first identify other users similar to the current user in terms of their ratings on the same set of foods. <br> *For example, if you liked all the “various types of eggs” foods, you identify users which also liked those foods.*</li><li>If you found those similar users you take their average rating of foods the current user has not yet try<br> *So, how did those “various types of eggs” lovers rate other foods? Maybe they rated “tofu” very high.*</li></ol><p>3. … and recommend those foods with the highest average rating to him. <br> *Accordingly, “Tofu” has a high average rating and might be recommended to you.*</p><p>These three steps can easily be translated into an alogrithm.</p><p>However, before we can do that we have to restructure our data.<br>For collaborative filtering data are usually structured that each row corresponds to a user and each column corresponds to a food.<br>This could for example look like this, for 3 users and 5 foods. Note that not every user rated every food.<br>For example, user 1 only rated food 3, while user 2 rated food 1 and food 2.</p><pre>matrix(data = c(NA, NA, 4, NA, NA, 2, 1, NA, NA, NA, NA, NA, 3, NA, 3), nrow = 3, ncol = 5, byrow = TRUE, dimnames = list(user_id = 1:3, food_id = 1:5))</pre><p>To restructure our rating data from this dataset in the same way, we can do the following:</p><pre>dimension_names &lt;- list(user_id = sort(unique(ratings$user_id)), food_id = sort(unique(ratings$food_id)))<br>ratingmat &lt;- spread(select(ratings, food_id, user_id, rating), food_id, rating) %&gt;% select(-user_id)<br><br>ratingmat &lt;- as.matrix(ratingmat)<br>dimnames(ratingmat) &lt;- dimension_names<br>ratingmat[1:5, 1:5]<br>dim(ratingmat)</pre><ul><li><strong>Step 1: Find similar users</strong></li></ul><p>For this step we select users that have in common that they rated the same foods. To make it easier let’s select one example user “Angel” (user_id: 17329). First we select users that rated at least one food that Angel also rated. In total there are 440 users who have at least one food in common.</p><pre>current_user &lt;- &quot;17329&quot;<br>rated_items &lt;- which(!is.na((as.data.frame(ratingmat[current_user, ]))))<br>selected_users &lt;- names(which(apply(!is.na(ratingmat[ ,rated_items]), 1, sum) &gt;= 2))<br>head(selected_users, 40)</pre><p>For these users, we can calculate the similarity of their ratings with “Angel”<br>s ratings. There is a number of options to calculate similarity. Typically cosine similarity or pearson’s correlation coefficient are used. Here, I chose pearson’s correlation.<br>We would now go through all the selected users and calculate the similarity between their and Angel’s ratings. Below<br>I do this for 2 users (user_ids: 1339 and 21877) for illustration. We can see that similarity is higher for user 1339 than user 21877</p><pre>user1 &lt;- data.frame(item=colnames(ratingmat),rating=ratingmat[current_user,]) %&gt;% filter(!is.na(rating))<br>user2 &lt;- data.frame(item=colnames(ratingmat),rating=ratingmat[&quot;1339&quot;,]) %&gt;% filter(!is.na(rating))<br>tmp&lt;-merge(user1, user2, by=&quot;item&quot;)<br>tmp<br>cor(tmp$rating.x, tmp$rating.y, use=&quot;pairwise.complete.obs&quot;)<br><br>user2 &lt;- data.frame(item = colnames(ratingmat), rating = ratingmat[&quot;21877&quot;, ]) %&gt;% filter(!is.na(rating))<br>tmp &lt;- merge(user1, user2, by=&quot;item&quot;)<br>tmp<br>cor(tmp$rating.x, tmp$rating.y, use=&quot;pairwise.complete.obs&quot;)</pre><p>To reduce the influence of interindividual differences in mean ratings (as discussed in the EDA section), you can normalize the a user’s ratings by subtracting the users mean from all individual ratings. For example if a user rates 5 foods with 1, 2, 3, 4, 5 his ratings would become -2, -1, 0, 1, 2.</p><pre>rmat &lt;- ratingmat[selected_users, ]<br>user_mean_ratings &lt;- rowMeans(rmat,na.rm=T)<br>rmat &lt;- rmat - user_mean_ratings</pre><p>We can calculate the similarity of all others users with Angel and sort them according to the highest similarity.</p><pre>similarities &lt;- cor(t(rmat[rownames(rmat)!=current_user, ]), rmat[current_user, ], use = &#39;pairwise.complete.obs&#39;)<br>sim &lt;- as.vector(similarities)<br>names(sim) &lt;- rownames(similarities)<br>res &lt;- sort(sim, decreasing = TRUE)<br>head(res, 40)</pre><p>Visualizing similarities between users<br>Similarities between users can be visualized using the qpraph package. The width of the graph’s edges correspond to similarity (blue for positive correlations, red for negative correlations).</p><pre>sim_mat &lt;- cor(t(rmat), use = &#39;pairwise.complete.obs&#39;)<br>random_users &lt;- selected_users[1:20]<br>qgraph(sim_mat[c(current_user, random_users), c(current_user, random_users)], layout = &quot;spring&quot;, vsize = 5, theme = &quot;TeamFortress&quot;, labels = c(current_user, random_users))</pre><ul><li><strong>Step 2: Get predictions for other foods</strong></li></ul><p>In order to get recommendations for our user we would take the most similar users (e.g. 4) and average their ratings for foods Angel has not yet rated. To make these averages more reliable you could also only include items that have been rated by multiple other similar users.</p><pre>similar_users &lt;- names(res[1:4])<br><br>similar_users_ratings &lt;- data.frame(item = rep(colnames(rmat), length(similar_users)), rating = c(t(as.data.frame(rmat[similar_users,])))) %&gt;% filter(!is.na(rating))<br><br>current_user_ratings &lt;- data.frame(item = colnames(rmat), rating = rmat[current_user,]) %&gt;% filter(!is.na(rating))<br><br>predictions &lt;- similar_users_ratings %&gt;% <br>  filter(!(item %in% current_user_ratings$item)) %&gt;% <br>  group_by(item) %&gt;% summarize(mean_rating = mean(rating))<br><br>predictions %&gt;% <br>    datatable(class = &quot;nowrap hover row-border&quot;, options = list(dom = &#39;t&#39;,scrollX = TRUE, autoWidth = TRUE))</pre><ul><li><strong>Step 3: Recommend the best 5 predictions</strong></li></ul><p>Given the results, we would sort the predictions with respect to their mean rating and recommend the highest rated foods to Angel. In our case that would be foods 1031, 2004, 3934, 5524, 7239. Please note that ratings are still normalized.</p><pre>predictions %&gt;% <br>  arrange(-mean_rating) %&gt;% <br>  top_n(5, wt = mean_rating) %&gt;% <br>  mutate(food_id = as.numeric(as.character(item))) %&gt;% <br>  left_join(select(foods, authors, title, food_id), by = &quot;food_id&quot;) %&gt;% <br>  select(-item) %&gt;% <br>  datatable(class = &quot;nowrap hover row-border&quot;, options = list(dom = &#39;t&#39;,scrollX = TRUE, autoWidth = TRUE))</pre><p>And that’s already it. This is the basic principle of user-based collaborative filtering. Now we can get more practical and evaluate and compare some recommendation algorithms.</p><p><strong>Build an Algorithm</strong></p><ul><li>Using recommenderlab</li></ul><p>Recommenderlab is a R-package that provides the infrastructure to evaluate and compare several collaborative-filtering algortihms. <br>Many algorithms are already implemented in the package, and we can use the available ones to save some coding effort, or add custom algorithms and use the infrastructure (e.g. crossvalidation).</p><p>There is an important aspect concerning the representation of our rating matrix. <br>As we could already see above, most of the values in the rating matrix are missing, because every user just rated a few of the 10000 foods. This allows us to represent this matrix is sparse format in order to save memory.</p><pre>ratingmat0 &lt;- ratingmat<br>ratingmat0[is.na(ratingmat0)] &lt;- 0<br>sparse_ratings &lt;- as(ratingmat0, &quot;sparseMatrix&quot;)<br>rm(ratingmat0)<br>gc()</pre><p>Recommenderlab uses as special variant of a sparse matrices, so we convert to this class first.</p><pre>real_ratings &lt;- new(&quot;realRatingMatrix&quot;, data = sparse_ratings)<br>real_ratings</pre><p>Running an algorithm in Recommenderlab is really easy. All you have to do is call `Recommender()` and pass the data, select a method (“UBCF” — user-based collaborative filtering) and pass some params (e.g., the *method* for calculating similarity, e.g. *pearson*, and the number of most similar users used for the predictions, *nn*, e.g. 4).</p><pre>model &lt;- Recommender(real_ratings, method = &quot;UBCF&quot;, param = list(method = &quot;pearson&quot;, nn = 4))</pre><p>Creating predictions is then also straight-forward. You just call `predict()` and pass the model, the ratings for the user you want to predict ratings for, and a parameter to tell the function that you want to get predicted ratings back.</p><pre>#Making predictions <br>prediction &lt;- predict(model, real_ratings[current_user, ], type = &quot;ratings&quot;)</pre><ul><li>Evaluating the predictions</li></ul><p>The good thing about `Recommenderlab` is that it offers the possibility to easily evaluate and compare algorithms. In order to do so, one first has to create an evaluation scheme. Here, as an illustration I chose to do 10-fold crossvalidation. The *given* parameter determines how many ratings are given to create the predictions and in turn on how many predictions per user remain for the evaluation of the prediction. In this case -1 means that the predictions are calculated from all but 1 ratings, and performance is evaluated for 1 for each user.</p><pre>scheme &lt;- evaluationScheme(real_ratings[1:500,], method = &quot;cross-validation&quot;, k = 10, given = -1, goodRating = 5)</pre><p>In a second step, we can list all the algorithms we want to compare. As we have a tuneable parameter `nn`, which is the number of most similar users which are used to calculate the predictions. I vary this parameter from 5 to 50 and plot the RMSE. Furthermore, as a baseline one can also add an algorithm (“RANDOM”) that randomly predicts a rating for each user.</p><pre>algorithms &lt;- list(&quot;random&quot; = list(name = &quot;RANDOM&quot;, param = NULL),<br>                   &quot;UBCF_05&quot; = list(name = &quot;UBCF&quot;, param = list(nn = 5)),<br>                   &quot;UBCF_10&quot; = list(name = &quot;UBCF&quot;, param = list(nn = 10)),<br>                   &quot;UBCF_30&quot; = list(name = &quot;UBCF&quot;, param = list(nn = 30)),                   <br>                   &quot;UBCF_50&quot; = list(name = &quot;UBCF&quot;, param = list(nn = 50))<br>                   )<br># evaluate the alogrithms with the given scheme            <br>results &lt;- evaluate(scheme, algorithms, type = &quot;ratings&quot;)<br><br># restructure results output<br>tmp &lt;- lapply(results, function(x) slot(x, &quot;results&quot;))<br>res &lt;- tmp %&gt;% <br>  lapply(function(x) unlist(lapply(x, function(x) unlist(x@cm[ ,&quot;RMSE&quot;])))) %&gt;% <br>  as.data.frame() %&gt;% <br>  gather(key = &quot;Algorithm&quot;, value = &quot;RMSE&quot;)<br><br>res %&gt;% <br>  ggplot(aes(Algorithm, RMSE, fill = Algorithm)) +<br>  geom_bar(stat = &quot;summary&quot;) + geom_errorbar(stat = &quot;summary&quot;, width = 0.3, size = 0.8) +<br>  coord_cartesian(ylim = c(0.6, 1.3)) + guides(fill = FALSE)</pre><ul><li>Different algorithms</li></ul><p>Here I compare UBCF with two additional algorithms, “popular” predicts ratings accoring to their mean_rating, SVD is matrix factorization approach.</p><pre>scheme &lt;- evaluationScheme(real_ratings[1:500,], method = &quot;cross-validation&quot;, k = 10, given = -1, goodRating = 5)<br><br>algorithms &lt;- list(&quot;random&quot; = list(name = &quot;RANDOM&quot;, param = NULL),<br>                   &quot;popular&quot; = list(name = &quot;POPULAR&quot;),<br>                   &quot;UBCF&quot; = list(name = &quot;UBCF&quot;),<br>                   &quot;SVD&quot; = list(name = &quot;SVD&quot;)<br>                   )<br>                   <br>results &lt;- evaluate(scheme, algorithms, type = &quot;ratings&quot;, progress = FALSE)<br><br># restructure results output<br>tmp &lt;- lapply(results, function(x) slot(x, &quot;results&quot;))<br>res &lt;- tmp %&gt;% <br>  lapply(function(x) unlist(lapply(x, function(x) unlist(x@cm[ ,&quot;RMSE&quot;])))) %&gt;% <br>  as.data.frame() %&gt;% <br>  gather(key = &quot;Algorithm&quot;, value = &quot;RMSE&quot;)<br><br>res %&gt;% <br>  mutate(Algorithm=factor(Algorithm, levels = c(&quot;random&quot;, &quot;popular&quot;, &quot;UBCF&quot;, &quot;SVD&quot;))) %&gt;%<br>  ggplot(aes(Algorithm, RMSE, fill = Algorithm)) + geom_bar(stat = &quot;summary&quot;) + <br>  geom_errorbar(stat = &quot;summary&quot;, width = 0.3, size = 0.8) + coord_cartesian(ylim = c(0.6, 1.3)) + <br>  guides(fill = FALSE)</pre><p><strong>R Shiny DEPLOYMENT</strong></p><p>One drawback of `recommenderlab` is that predictions for larger datasets take quite a lot of time. This is of course not what we want for an app. Therefore we have to find ways to speed up calculations. One easy way is to reduce the size of the rating matrix by only selecting a subset of users. However, this will usually come at the cost of worse performance.</p><p>Another option is to optimize the code for collaborative filtering. Luckily, I found this **[blog-post](<a href="https://www.smartcat.io/blog/2017/improved-r-implementation-of-collaborative-filtering/)**">https://www.smartcat.io/blog/2017/improved-r-implementation-of-collaborative-filtering/)**</a> describing such an optimization and also providing the corresponding functions in **[Github](<a href="https://github.com/smartcat-labs/collaboratory)**">https://github.com/smartcat-labs/collaboratory)**</a>. Thank you very much for sharing this *Stefan Nikolic*.<br>The github contains two important files `cf_algorithm.R`, which contains the collaborative filtering algorithm and prediction function, and the second file `simililarity_measures.R` which contains functions for calculating similarity matrices.</p><p>In order to create the shiny app, I took the UBCF implementation as linked to above and adapted it. <br>For this implementation for UBCF, data has to be provided as food x user matrix (in contrast to the user x food matrix I used above). I also subsampled only 20% of the rating data in order to further increase speed.</p><p>The actual building and deployment of the app are really easy as well. Actually you just need to create two files `ui.R` and `server.R`. <br>`ui.R` contains the static UI interface, which is basically a dashboard with two big boxes (one for the user ratings and one for the recommendations).</p><ul><li>Server</li></ul><pre>## server.R<br><br># load functions<br>source(&#39;functions/cf_algorithm.R&#39;) # collaborative filtering<br>source(&#39;functions/similarity_measures.R&#39;) # similarity measures<br><br># define functions<br>get_user_ratings &lt;- function(value_list) {<br>  dat &lt;- data.table(food_id = sapply(strsplit(names(value_list), &quot;_&quot;), function(x) ifelse(length(x) &gt; 1, x[[2]], NA)),<br>                    rating = unlist(as.character(value_list)))<br>  dat &lt;- dat[!is.null(rating) &amp; !is.na(food_id)]<br>  dat[rating == &quot; &quot;, rating := 0]<br>  dat[, &#39;:=&#39; (food_id = as.numeric(food_id), rating = as.numeric(rating))]<br>  dat &lt;- dat[rating &gt; 0]<br>  <br>  # get the indices of the ratings<br>  # add the user ratings to the existing rating matrix<br>  user_ratings &lt;- sparseMatrix(i = dat$food_id, <br>                               j = rep(1,nrow(dat)), <br>                               x = dat$rating, <br>                               dims = c(nrow(ratingmat), 1))<br>}<br><br># read in data<br>foods &lt;- fread(&#39;data/food.csv&#39;)<br>ratings &lt;- fread(&#39;data/ratings_cleaned.csv&#39;)<br><br># reshape to foods x user matrix <br>ratingmat &lt;- sparseMatrix(ratings$food_id, ratings$user_id, x=ratings$rating) # food x user matrix<br>ratingmat &lt;- ratingmat[, unique(summary(ratingmat)$j)] # remove users with no ratings<br>dimnames(ratingmat) &lt;- list(food_id = as.character(1:10000), user_id = as.character(sort(unique(ratings$user_id))))<br><br>shinyServer(function(input, output, session) {<br>  <br>  # show the foods to be rated<br>  output$ratings &lt;- renderUI({<br>    num_rows &lt;- 20<br>    num_foods &lt;- 6 # foods per row<br>    <br>    lapply(1:num_rows, function(i) {<br>      list(fluidRow(lapply(1:num_foods, function(j) {<br>        list(box(width = 2,<br>                 div(style = &quot;text-align:center&quot;, img(src = foods$image_url[(i - 1) * num_foods + j], style = &quot;max-height:150&quot;)),<br>                 div(style = &quot;text-align:center; color: #999999; font-size: 80%&quot;, foods$authors[(i - 1) * num_foods + j]),<br>                 div(style = &quot;text-align:center&quot;, strong(foods$title[(i - 1) * num_foods + j])),<br>                 div(style = &quot;text-align:center; font-size: 150%; color: #f0ad4e;&quot;, ratingInput(paste0(&quot;select_&quot;, foods$food_id[(i - 1) * num_foods + j]), label = &quot;&quot;, dataStop = 5)))) #00c0ef<br>      })))<br>    })<br>  })<br>  <br>  # Calculate recommendations when the sbumbutton is clicked<br>  df &lt;- eventReactive(input$btn, {<br>    withBusyIndicatorServer(&quot;btn&quot;, { # showing the busy indicator<br>        # hide the rating container<br>        useShinyjs()<br>        jsCode &lt;- &quot;document.querySelector(&#39;[data-widget=collapse]&#39;).click();&quot;<br>        runjs(jsCode)<br>        <br>        # get the user&#39;s rating data<br>        value_list &lt;- reactiveValuesToList(input)<br>        user_ratings &lt;- get_user_ratings(value_list)<br>        <br>        # add user&#39;s ratings as first column to rating matrix<br>        rmat &lt;- cbind(user_ratings, ratingmat)<br>        <br>        # get the indices of which cells in the matrix should be predicted<br>        # predict all foods the current user has not yet rated<br>        items_to_predict &lt;- which(rmat[, 1] == 0)<br>        prediction_indices &lt;- as.matrix(expand.grid(items_to_predict, 1))<br>        <br>        # run the ubcf-alogrithm<br>        res &lt;- predict_cf(rmat, prediction_indices, &quot;ubcf&quot;, TRUE, cal_cos, 1000, FALSE, 2000, 1000)<br>        <br>        # sort, organize, and return the results<br>        user_results &lt;- sort(res[, 1], decreasing = TRUE)[1:20]<br>        user_predicted_ids &lt;- as.numeric(names(user_results))<br>        recom_results &lt;- data.table(Rank = 1:20, <br>                                    food_id = user_predicted_ids, <br>                                    Author = foods$authors[user_predicted_ids], <br>                                    Title = foods$title[user_predicted_ids], <br>                                    Predicted_rating =  user_results)<br>        <br>    }) # still busy<br>    <br>  }) # clicked on button<br><br>  # display the recommendations<br>  output$results &lt;- renderUI({<br>    num_rows &lt;- 4<br>    num_foods &lt;- 5<br>    recom_result &lt;- df()<br>    <br>    lapply(1:num_rows, function(i) {<br>      list(fluidRow(lapply(1:num_foods, function(j) {<br>        box(width = 2, status = &quot;success&quot;, solidHeader = TRUE, title = paste0(&quot;Rank &quot;, (i - 1) * num_foods + j),<br>         <br>          div(style = &quot;text-align:center; color: #999999; font-size: 80%&quot;, <br>              foods$authors[recom_result$food_id[(i - 1) * num_foods + j]]<br>             ),<br>          div(style=&quot;text-align:center; font-size: 100%&quot;, <br>              strong(foods$title[recom_result$food_id[(i - 1) * num_foods + j]])<br>             )<br>          <br>        )        <br>      }))) # columns<br>    }) # rows<br>    <br>  }) # renderUI function<br>  <br>}) # server function</pre><ul><li>UI</li></ul><pre>## ui.R<br>library(shiny)<br>library(shinydashboard)<br>library(recommenderlab)<br>library(data.table)<br>library(ShinyRatingInput)<br>library(shinyjs)<br><br>source(&#39;functions/helpers.R&#39;)<br><br>shinyUI(<br>    dashboardPage(<br>          skin = &quot;blue&quot;,<br>          dashboardHeader(title = &quot;Food Recommender&quot;),<br>          <br>          dashboardSidebar(disable = TRUE),<br><br>          dashboardBody(includeCSS(&quot;css/foods.css&quot;),<br>              fluidRow(<br>                  box(width = 12, title = &quot;Step 1: Rate as many foods as possible&quot;, status = &quot;info&quot;, solidHeader = TRUE, collapsible = TRUE,<br>                      div(class = &quot;rateitems&quot;,<br>                          uiOutput(&#39;ratings&#39;)<br>                      )<br>                  )<br>                ),<br>              fluidRow(<br>                  useShinyjs(),<br>                  box(<br>                    width = 12, status = &quot;info&quot;, solidHeader = TRUE,<br>                    title = &quot;Step 2: Discover foods you might like&quot;,<br>                    br(),<br>                    withBusyIndicatorUI(<br>                      actionButton(&quot;btn&quot;, &quot;Click here to get your recommendations&quot;, class = &quot;btn-warning&quot;)<br>                    ),<br>                    br(),<br>                    tableOutput(&quot;results&quot;)<br>                  )<br>               )<br>          )<br>    )<br>) </pre><p>That’s it. When I started this project, I had not done much collaborative filtering, but after seeing this dataset, I was really fascinated to create a fully working food recommendation app. There is still some room for improvement, but I hope that you could take away something from this kernel.</p><p>You can reach my Food Recommender page here:</p><p><a href="https://azizah-102.shinyapps.io/FoodRecommender/">https://azizah-102.shinyapps.io/FoodRecommender/</a></p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=581c5959e170" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Analysis untuk Ulasan Hotel (Resort) Menggunakan R]]></title>
            <link>https://medium.com/@azizahdahlan/text-analysis-untuk-ulasan-hotel-resort-menggunakan-r-f8541827d60d?source=rss-e92117ccd4af------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8541827d60d</guid>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[text-analytics]]></category>
            <category><![CDATA[analisis-teks]]></category>
            <dc:creator><![CDATA[Azizah]]></dc:creator>
            <pubDate>Mon, 08 May 2023 17:04:34 GMT</pubDate>
            <atom:updated>2025-04-07T04:10:09.648Z</atom:updated>
            <content:encoded><![CDATA[<p>Data tidak hanya berupa angka, namun bisa juga berupa teks, gambar, video, audio dan lain sebagainya. Kali ini, data yang akan digunakan untuk dianalisis yakni data yang berupa teks.</p><p>Analisis teks adalah teknik menggunakan teknologi komputer untuk membaca dan menganalisis materi tulisan manusia untuk mendapatkan pengetahuan (umumnya kepentingan komersial). Tujuannya adalah untuk mengumpulkan umpan balik (berupa ulasan) dari pengguna <em>platform</em>. Oleh karena itu, perusahaan dapat secara efisien memperoleh masukan saran dari pengguna atau konsumen.</p><h3><strong>Data</strong></h3><p>Pada tulisan kali ini, data yang akan digunakan adalah data ulasan pengunjung Shanaya Resort Malang melalui <em>platform </em>Traveloka dengan link berikut: <a href="https://www.traveloka.com/id-id/hotel/indonesia/shanaya-resort-malang-3000020010498?id=10327472932286124359&amp;adloc=id-id&amp;kw=10327472932286124359_&amp;gmt=&amp;gn=x&amp;gd=c&amp;gdm=&amp;gcid=&amp;gdp=&amp;gdt=&amp;gap=&amp;pc=1&amp;cp=10327472932286124359_ID_HO_DYAUPR_ALL_PerformanceMax_10327472932286124359_&amp;aid=&amp;wid=&amp;fid=&amp;gid=9056704&amp;utm_id=AesNRC9v&amp;ad_id=&amp;target_id=&amp;click_id=Cj0KCQjwu-KiBhCsARIsAPztUF0vUJpHVFKteGenin3bCYgOIRvGmPO0VrpEgcOpmvZ_oY5m2n0E7g0aAu_wEALw_wcB&amp;campaign_id=15364959481&amp;adgroup_id=&amp;gclid=Cj0KCQjwu-KiBhCsARIsAPztUF0vUJpHVFKteGenin3bCYgOIRvGmPO0VrpEgcOpmvZ_oY5m2n0E7g0aAu_wEALw_wcB">Traveloka_Shanaya_Resort_Malang</a></p><p>Dalam mendapatkan ulasan pada <em>website </em>Traveloka, saya menggunakan bantuan dari <a href="https://webscraper.io/">Web Scraper</a> dengan menambahkannya ke <em>Chrome Extension</em>. Kemudian, untuk tutorial secara lengkapnya bisa di tonton di <a href="https://youtu.be/bSVBnaon4vw">Youtube ini</a>.</p><p>Data yang sudah siap di analisis, selanjutnya di inputkan ke dalam R menggunakan sintaks berikut.</p><pre>#Load Data into R<br>library(readxl)<br><br>data_review &lt;- read_excel(&quot;review.xlsx&quot;)<br>View(data_review)</pre><p>data review yang digunakan strukturnya seperti terlihat di bawah ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*jOl826nEDujTUr-LDAG8YA.png" /></figure><p><strong>Pre-Processing Data</strong></p><p>Pada tahap ini, data yang akan di analisis harus di <em>cleaning</em> terlebih dahulu. Selain itu, perlu juga mengaktifkan <em>library</em> berikut di dalam R untuk sampai kepada tahap teks analisis.</p><pre>#library yang diperlukan<br><br>library(tm)<br>library(NLP)<br>library(stringr)<br>library(caret)<br>library(dplyr)<br>library(katadasaR)<br>library(tau)<br>library(parallel)<br>library(SnowballC)<br>library(wordcloud)<br>library(RColorBrewer)<br>library(stringr)</pre><p>ketika sintaks tersebut di <em>run</em>, maka hasilnya adalah seperti berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*Ft9cgRoaHUphS99kNCNryg.png" /></figure><p>Untuk memulai tahap <em>cleaning </em>data, pertama-tama adalah dengan melihat bentuk datanya terlebih dahulu dengan sintaks berikut ini.</p><pre>#melihat bentuk dokumen<br>corpusdok &lt;- Corpus(VectorSource(data_review$ulasan))<br>inspect(corpusdok[1:5])</pre><p>sehingga, akan tampil seperti ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*-pRhEODhZprLQEwJWciwvA.png" /></figure><p>Lalu, dari teks ulasan tersebut akan diubah semua huruf kapital menjadi huruf kecil</p><pre>#mengubah semua huruf kapital menjadi huruf kecil<br>dok_casefolding &lt;- tm_map(corpusdok, content_transformer(tolower)) <br>inspect(dok_casefolding[1:5])</pre><p>Berikut adalah hasil yang ditampilkan,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*uC-hIT6fbiC7IWELGqizdg.png" /></figure><p>Terlihat bahwa tidak ada lagi huruf kapital diantara kalimatnya, sehingga dapat dilanjutkan dengan menghapus tanda baca dari teks ulasan menggunakan perintah di bawah ini</p><pre>#Cleaning Punctuation#<br>dok_punctuation&lt;-tm_map(dok_casefolding,content_transformer(removePunctuation))<br>inspect(dok_punctuation[1:5])</pre><p>Maka ketika di <em>run, </em>akan menghasilkan seperti berikut ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*9pgxJuFB_FjttuWS7zbbuw.png" /></figure><p>Karena tanda baca berhasil di hilangkan, selanjutnya adalah menghapus angka yang terdapat dalam ulasan dengan perintah berikut.</p><pre>#Cleaning Number#<br>dok_nonumber&lt;-tm_map(dok_punctuation, content_transformer(removeNumbers))<br>inspect(dok_nonumber[1:5])</pre><p>Akan dihasilkan oleh R seperti ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*WvH_WMROCPhdD7B9jTdApg.png" /></figure><p>Setelah itu, akan dihapus imbuhan yang terdapat dalam kata-kata di setiap ulasan memakai fungsi seperti di bawah ini</p><pre>#Stemming &gt; mengahapus imbuhan<br>stem_text&lt;-function(text,mc.cores=1)<br>{<br>  stem_string&lt;-function(str)<br>  {<br>    str&lt;-tokenize(x=str)<br>    str&lt;-sapply(str, katadasaR)<br>    str&lt;-paste(str, collapse = &quot;&quot;)<br>    return(str)<br>  }<br>  x&lt;-mclapply(X=text,FUN=stem_string,mc.cores=mc.cores)<br>  return(unlist(x))<br>}<br>dok_stemming&lt;-tm_map(dok_nonumber,stem_text)<br>inspect(dok_stemming[1:5])</pre><p>terlihat bahwa dalam fungsi tersebut menggunakan <em>library</em> katadasaR, untuk meringkas ulasan yang panjang, sehingga didapatkan hanya kata dasarnya saja. Maka, <em>output</em> yang ditampilkan adalah sebagai berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*XeNsXX8RVE-Q70ozAe1meQ.png" /></figure><p>pada ulasan ke-5, terdapat kata ‘muas’ dimana kata asalnya adalah memuaskan, sehingga dapat dikatakan bahwa imbuhan berhasil dihapus. Selanjutnya yakni menghapus kata tidak penting yang sesuai dengan kamus stop_word bahasa Indonesia, dimana hal tersebut bisa diperoleh dari <a href="https://www.kaggle.com/datasets/oswinrh/indonesian-stoplist">sin</a>i. Data tersebut selanjutnya dimasukkan dalam perintah berikut ini.</p><pre>cStopwordID&lt;-readLines(“stopwordbahasa.csv”)<br>dok_stopword &lt;- tm_map(dok_stemming, removeWords, cStopwordID)<br>inspect(dok_stopword[1:5])</pre><p>Diperoleh hasilnya adalah seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*pIA7rJctme4j1-8Gq9gsPQ.png" /></figure><p>Karena dari hasilnya terlihat spasi yang semakin besar, maka perlu dilakukan penghapusan pada spasi yang berlebih menggunakan sintaks berikut ini.</p><pre>#menghapus spasi yg berlebihan<br>dok_whitespace&lt;-tm_map(dok_stopword,stripWhitespace)<br>inspect(dok_whitespace[1:5])</pre><p>Dari perintah diatas, diperoleh seperti berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*2wmvlwFGx---0Pw-gEPZLQ.png" /></figure><p>Setelah semua langkah pembersihan data selesai, maka hasilnya dijadikan suatu objek data dengan nama databersih seperti ini</p><pre>databersih&lt;-data.frame(text=unlist(sapply(dok_whitespace,`[`)))<br>View(databersih)</pre><p>Hasilnya adalah sebagai berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*124UpdQnLUU-sUGEurzSgQ.png" /></figure><p>Terlihat bahwa data ulasan yang sudah dibersihkan lebih singkat.</p><h3>Text Analysis</h3><p>Masuk pada bagian teks analisis, pertama-tama adalah mengimpor <em>library</em> di dalam R yang akan digunakan.</p><pre>## TEXT ANALYSIS ##<br>library(tidytext)<br>library(tidyverse) </pre><p>Selanjutnya adalah dengan membuat matriks dari istilah yang digunakan di dalam ulasan memakai perintah seperti di bawah ini.</p><pre>#Build a term-document matrix<br>dtm &lt;- TermDocumentMatrix(databersih)<br>m &lt;- as.matrix(dtm)<br>v &lt;- sort(rowSums(m),decreasing=TRUE)<br>d &lt;- data.frame(word = names(v),freq=v)<br>head(d, 15)</pre><p>Data istilah matriks tersebut disusun secara <em>decreasing</em>, sehingga dapat diketahui frekuensi kata yang banyak hingga jarang digunakan pada15 kata teratas. Berikut hasil yang diperoleh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/174/1*1SWOlL1c9O3C6RcCD3FH2w.png" /></figure><p>Kata teratas adalah kamar dengan frekuensi 181, yang menyebut kata ‘bagus’ dalam ulasan ada sebanyak 82, dan seterusnya.</p><p>Kemudian, dari kata-kata tersebut dibuat suatu <em>wordcloud</em> agar dapat dilihat secara nyaman dan bagus oleh khalayak dengan perintah yang digunakan adalah seperti ini</p><pre>#Generate the Word cloud<br>set.seed(1234)<br>wordcloud(words = d$word, freq = d$freq, min.freq = 1,<br>          max.words=50, random.order=FALSE, rot.per=0.35, <br>          colors=brewer.pal(8, &quot;Dark2&quot;))</pre><p>Berikut adalah <em>output </em>yang ditampilkan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*aAygHSfAF-2_pU8arNYZuw.png" /></figure><p>Dapat dilihat kata yang sering muncul dalam ulasan yang diberikan oleh pengunjung diantaranya ada ‘kamar’, ‘bagus’, ‘banget’, ‘bersih’, dan lainnya.</p><p>Tahap selanjutnya adalah dengan mencari kaitan dari istilah-istilah tersebut menggunakan perintah ini,</p><pre>#Explore frequent terms and their associations<br>findFreqTerms(dtm, lowfreq = 4)</pre><p>hasilnya kaitan daripada istilah populer dalam ulasan adalah seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*vsOBtTjM-jIjlp8CcoBeaw.png" /></figure><p>Urutan teratas ada kata ‘alam’ yang paling berkaitan dengan istilah dalam <em>wordclouds</em> sebelumnya, kemungkinan besar bahwa pengunjung menikmati kamar yang bernuansa alam seperti pada gambar yang ada di laman Traveloka. Lalu, dari asosiasi tersebut, dibuat suatu barplot yang menunjukkan kata yang paling sering muncul.</p><pre>#barplot<br>k&lt;-barplot(d[1:20,]$freq, las = 2, names.arg = d[1:20,]$word,cex.axis=1.2,cex.names=1.2,<br> main =”Most frequent words”,<br> ylab = “Word frequencies”,col =topo.colors(20))<br><br>termFrequency &lt;- rowSums(as.matrix(dtm))<br>termFrequency &lt;- subset(termFrequency, termFrequency&gt;=5)<br><br>text(k,sort(termFrequency, decreasing = T)-<br> 1,labels=sort(termFrequency, decreasing = T),pch = 6, cex =<br> 1)</pre><p>Didapatkan Barplot sebagai berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*5xFrU1UQad70rdyB7WfWJw.png" /></figure><p>Label tersebut menunjukkan frekuensi istilah yang dipakai di dalam ulasan.</p><p>Setelah itu menyatukan kembali data rating, tanggal dan ulasan yang sudah di-<em>cleaning </em>dengan cara manual melalui Excel dan disimpan ulang, lalu di inputkan kembali ke dalam R dengan perintah berikut.</p><pre>data_lengkap &lt;- read_xlsx(&quot;data_lengkap.xlsx&quot;)</pre><p>Dilanjutkan dengan melihat TF-IDF dari masing-masing variabel menggunakan perintah ini</p><pre>review_tf_idf &lt;- <br> data_lengkap %&gt;%<br> count(rating, review, sort = TRUE) %&gt;%<br> bind_tf_idf(review, rating, n)<br>review_tf_idf %&gt;%<br> arrange(desc(tf_idf))</pre><p>Sehingga didapatkan <em>output</em> sebagai berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*W5uMNGC2qiL5bKh86VT5tA.png" /></figure><p>TF-IDF (Term Frequency — Inverse Document Frequency) adalah algoritma praktis yang menggunakan frekuensi kata untuk menentukan seberapa relevan kata tersebut dengan dokumen tertentu (Simha, 2021).</p><p>Kemudian dari TF-IDF ini dihitung dan diurutkan dengan sintaks berikut.</p><pre>review_tf_idf %&gt;%<br>  count(review, sort = TRUE) </pre><p>Maka dihasilkan seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*-5dVEFVn-HbyDvcNgVkfMg.png" /></figure><p>Justru dengan mengurutkan ulasan menggunakan TF-IDF ini, kebetulan malah menonjolkan ulasan negatif pada empat urutan teratas. Maka dapat dilanjutkan dengan <em>sentiment analysis.</em></p><h4><strong>Sentiment Analysis</strong></h4><p>Pada sentimen analisis ini tujuannya adlaah untuk mengetahui frekuensi ulasan yang mengarah ke positif, negatif dan netral. Digunakan <em>library</em> berikut ini</p><pre># SENTIMENT ANALYSIS #<br><br>library(SentimentAnalysis)</pre><p>Selanjutnya adalah dengan melihat kecenderungan ulasan menggunakan perintah berikut ini.</p><pre>sentiment_analys = analyzeSentiment(databersih)<br>sent_cate &lt;- convertToDirection(sentiment_analys$SentimentQDAP)<br>sent_cate</pre><p>Sehingga didapatkan <em>output</em> sebagai berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*1AsfST0ejYJ-oziH-CXhdw.png" /></figure><p>Karena hasilnya tidak mungkin untuk dhitung satu persatu, maka dilakukan dengan perintah berikut ini.</p><pre>hitung &lt;- table(sent_cate)</pre><p>Maka diperoleh frekuensi dari ketiga kecenderungan dalam ulasan seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*SnqFsnOf1_FrzO-43Xt1Lw.png" /></figure><p>Untuk melihatnya sebagai plot, maka dibuatlah suatu barplot dengan sintaks seperti ini.</p><pre>barplot(sort(hitung, decreasing = TRUE), <br> main = “Sentiment Analysis Resort Malang”, <br> xlab = “Sentiment”,<br> ylab = “Count”,<br> ylim = c(0, 150), col = “blue”)</pre><p>Hasil yang ditampilkan adalah seperti berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-iOwwE1W7CCBkWT3CQuAFw.png" /></figure><p>Terlihat bahwa yang paling banyak ulasan netral, karena ada yang menyebut kelebihan serta kekurangannya di dalam satu ulasan.</p><p><strong>Conclusion</strong></p><p>Dari total 263 data ulasan terhadap Resort Shanaya Malang, 143 diantaranya adalah ulasan netral yang menyebutkan kelebihan dan kekurangan dari resort ini. Namun, keterkaitan yang paling tinggi adalah kesenangan pengunjung oleh kamar yang berkaitan dengan alam (entah <em>view </em>yang ditawarkan ataupun nuansanya) yang bersih dan nyaman untuk keluarga. Sedangkan hanya 19 saja ulasan negatif terkait Resort Shanaya ini, yang dapat dilihat dalam hasil TF-IDF, sebagian besar karena fasilitas seperti makanan, AC, air panas, dan sebagainya.</p><p>Referensi:</p><ul><li><a href="https://medium.com/@986110101/text-mining-using-r-28ada2abb883">Text Mining Using R</a></li><li><a href="https://medium.com/@17611063/analisis-sentimen-twitter-menggunakan-rstudio-162c8195603d">Analisis Sentimen Twitter Menggunakan Rstudio</a></li><li><a href="https://rpubs.com/palashisback/476156">RPubs</a></li><li><a href="https://www.r-bloggers.com/2021/02/text-analysis-with-r/">Text Analysis with R</a></li><li><a href="https://github.com/nurandi/katadasaR">GitHub - nurandi/katadasaR: An R Package of Word Stemming for Bahasa Indonesia Using Nazief &amp; Adriani&#39;s Algorithm</a></li><li><a href="https://lailatussyarifah32.wordpress.com/2019/02/19/menguak-cara-explorasi-text-text-mining-dengan-package-tm-di-rstudi-statistics02/">Cara Cleaning Data Text Menggunakan Package tm di Rstudio</a></li><li><a href="https://bookdown.org/jdholster1/idsr/text-analysis.html">Chapter 8 Text Analysis | Introduction to R for Data Science: A LISA 2020 Guidebook</a></li><li><a href="https://github.com/ramaprakoso/analisis-sentimen/blob/master/kamus/kbba.txt">analisis-sentimen/kbba.txt at master · ramaprakoso/analisis-sentimen</a></li><li><a href="https://www.kaggle.com/datasets/oswinrh/indonesian-stoplist">Indonesian Stoplist</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8541827d60d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>