<?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 Anirudh Narayana on Medium]]></title>
        <description><![CDATA[Stories by Anirudh Narayana on Medium]]></description>
        <link>https://medium.com/@akaniyar?source=rss-98ee58768f3e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fh5bvWefDgGr0QA9-4D4Fw.png</url>
            <title>Stories by Anirudh Narayana on Medium</title>
            <link>https://medium.com/@akaniyar?source=rss-98ee58768f3e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:46:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akaniyar/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[The Recommendation: what to shop !!!!!!]]></title>
            <link>https://medium.com/@akaniyar/the-recommendation-what-to-shop-42bd2bacc551?source=rss-98ee58768f3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/42bd2bacc551</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[sqlalchemy]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Anirudh Narayana]]></dc:creator>
            <pubDate>Sun, 02 Mar 2025 22:15:56 GMT</pubDate>
            <atom:updated>2025-03-02T22:20:29.398Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Recommendation: what to shop !!!!!!</h3><p>Amazon Reviews 2023 Dataset and Analyzing Reviews with PostgreSQL, SQLAlchemy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*sAKknDRG8puBPHL0.png" /></figure><blockquote>The time is right, In the age of information in every device and every aspect of life. Personalized recommendations have been an indispensable tool for navigating online content and e-commerce.</blockquote><blockquote>Whether you go to Amazon to see what you wanna buy next, watch a movie on Netflix, or even find things to eat on Ubereats, the recommendations tool is hard to ignore.</blockquote><blockquote>I recently came across a dataset to play around with recommendations, as many of us would always love to harness the power of LLM in recent years.</blockquote><blockquote>Let&#39;s dive in and out of the dataset and then understand a good way to build a database using Postgres SQL with this dataset.</blockquote><h4>Recommendation systems:</h4><p>Before deepening the dataset and using it, let’s first understand what recommendation systems are and why they are more relevant than ever.</p><p>Recommendations systems are the algorithms that predict and suggest items/products that user may be interested in buying based on their past behavior, preferences, and interactions. These systems are pivotal in user engagement, scaling up sales, and building customer loyalty. Tailoring individual preferences and keeping them engaged will enhance the business.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/0*5IhnTPGpx30Y_xLj" /><figcaption>source : <a href="https://www.msn.com/en-us/lifestyle/lifestyle-buzz/43-hilarious-amazon-memes-that-poke-fun-at-the-company/ar-BB1o0EcI">43 Hilarious Amazon Memes That Poke Fun at the Company</a></figcaption></figure><p>Major companies like Netflix, Amazon, and Uber have invested heavily in sophisticated recommendation engines, leveraging AI and machine learning to provide highly accurate suggestions. With the evolution of LLMs, recommendation systems are becoming even more personalized and insightful.</p><h4>AMAZON REVIEWS 2023 Dataset</h4><p>The Amazon Reviews 2023 dataset, released by McAuley Lab from UC San Diego, is a massive and structured dataset containing over 570 million reviews and 48 million items across 33 categories. This dataset is publicly available on <a href="https://huggingface.co/datasets/McAuley-Lab/Amazon-Reviews-2023.">Hugging Face</a><a href="https://emojipedia.org/hugging-face">🤗</a>.</p><p><strong>Key features:</strong></p><ul><li><strong>Total Reviews</strong>: 571.54 million</li><li><strong>Total Users</strong>: 54.1 million</li><li><strong>Total Items</strong>: 48.19 million</li></ul><blockquote><strong>Categories: </strong><br>All_Beauty, Amazon_Fashion, Appliances, Arts_Crafts_and_Sewing, Automotive, Baby_Products, Beauty_and_Personal_Care, Books, CDs_and_Vinyl, Cell_Phones_and_Accessories, Clothing_Shoes_and_Jewelry, Digital_Music, Electronics, Gift_Cards, Grocery_and_Gourmet_Food, Handmade_Products, Health_and_Household, Health_and_Personal_Care, Home_and_Kitchen, Industrial_and_Scientific, Kindle_Store, Magazine_Subscriptions, Movies_and_TV, Musical_Instruments, Office_Products, Patio_Lawn_and_Garden, Pet_Supplies, Software, Sports_and_Outdoors, Subscription_Boxes, Tools_and_Home_Improvement, Toys_and_Games, Video_Games, Unknown.</blockquote><p>A small subset of benchmarking datasets and scripts are available for further analysis: <a href="https://github.com/hyp1231/AmazonReviews2023/blob/main/benchmark_scripts/README.md">Amazon Reviews 2023 Benchmark Scripts</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*TVNVrZig-vlRvwlr.png" /></figure><p>Now, Let’s perform some statistical analysis by loading raw data from this dataset and storing it in a PostgreSQL database.</p><h4>Step 1: Choose and Download a category</h4><p>We can use Amazon Fashion Dataset review and metadata files in our system. Once downloaded, we will use raw JSONL files for processing and storage in PostgreSQL.</p><h4>Step 2: Install Required libraries</h4><p>To store and manage our dataset, we will use <strong>PostgreSQL, which</strong> will interact with <strong>SQLAlchemy, </strong>a Python ORM(Obejct-relation Mapper), simplifying database operations.</p><pre>pip install pandas sqlalchemy psycopg2 json uuid</pre><h4>Step 3: Set Up PostgreSQL Database</h4><p>Ensure you have PostgreSQL installed and running, then create a local-host database to store the reviews and metadata.</p><p>CREATE DATABASE amazon_reviews;</p><h4>Step 4: Create Tables</h4><p>We have taken the Amazon Fashion category; let&#39;s create a table for the reviews and metadata.</p><pre>CREATE TABLE IF NOT EXISTS amazon_fashion_review (<br> review_id VARCHAR(50) NOT NULL PRIMARY KEY,<br>    rating FLOAT CHECK (rating &gt;= 1.0 AND rating &lt;= 5.0),<br>    asin VARCHAR(50),<br>    parent_asin VARCHAR(50),<br>    user_id VARCHAR(50),<br>    timestamp BIGINT, <br>    verified_purchase BOOLEAN,<br>    helpful_vote INT DEFAULT 0,<br> title TEXT,<br>    text TEXT,<br>    images JSONB <br>);<br><br>CREATE TABLE IF NOT EXISTS amazon_fashion_meta (<br>    item_id VARCHAR(50) NOT NULL PRIMARY KEY,<br>    main_category TEXT ,<br>    title TEXT ,<br>    average_rating FLOAT CHECK (average_rating &gt;= 0.0 AND average_rating &lt;= 5.0),<br>    rating_number INT DEFAULT 0,<br>    features JSONB, <br>    description JSONB, <br>    price FLOAT CHECK (price &gt;= 0.0),<br>    images JSONB, <br>    videos JSONB, <br>    store TEXT,<br>    categories JSONB, <br>    details JSONB, <br>    parent_asin VARCHAR(20),<br>    bought_together JSONB <br>);</pre><p>For all the categories, You can either manually execute the SQL commands in PostgreSQL or use the provided DO block, which will create tables for each category automatically. The DO block is efficient for creating tables for multiple categories at once.</p><pre>do $$<br>DECLARE<br>    category TEXT;<br>    categories TEXT[] := ARRAY[<br>        &#39;Amazon_Fashion&#39;, &#39;Appliances&#39;, &#39;Arts_Crafts_and_Sewing&#39;, &#39;Automotive&#39;, &#39;Baby_Products&#39;,<br>        &#39;Beauty_and_Personal_Care&#39;, &#39;Books&#39;, &#39;CDs_and_Vinyl&#39;, &#39;Cell_Phones_and_Accessories&#39;,<br>        &#39;Clothing_Shoes_and_Jewelry&#39;, &#39;Digital_Music&#39;, &#39;Electronics&#39;, &#39;Gift_Cards&#39;, &#39;Grocery_and_Gourmet_Food&#39;,<br>        &#39;Handmade_Products&#39;, &#39;Health_and_Household&#39;, &#39;Health_and_Personal_Care&#39;, &#39;Home_and_Kitchen&#39;,<br>        &#39;Industrial_and_Scientific&#39;, &#39;Kindle_Store&#39;, &#39;Magazine_Subscriptions&#39;, &#39;Movies_and_TV&#39;,<br>        &#39;Musical_Instruments&#39;, &#39;Office_Products&#39;, &#39;Patio_Lawn_and_Garden&#39;, &#39;Pet_Supplies&#39;, &#39;Software&#39;,<br>        &#39;Sports_and_Outdoors&#39;, &#39;Subscription_Boxes&#39;, &#39;Tools_and_Home_Improvement&#39;, &#39;Toys_and_Games&#39;,<br>        &#39;Video_Games&#39;<br>    ];<br>BEGIN<br>    FOREACH category IN ARRAY categories LOOP<br>  category := lower(replace(category, &#39; &#39;, &#39;_&#39;));<br>        EXECUTE format(<br>            &#39;CREATE TABLE IF NOT EXISTS %I_review (<br>                review_id VARCHAR(50) NOT NULL PRIMARY KEY,<br>       rating FLOAT CHECK (rating &gt;= 1.0 AND rating &lt;= 5.0),<br>       asin VARCHAR(50),<br>       parent_asin VARCHAR(50) ,<br>       user_id VARCHAR(50) ,<br>       timestamp BIGINT , <br>       verified_purchase BOOLEAN,<br>       helpful_vote INT DEFAULT 0,<br>    title TEXT,<br>       text TEXT,<br>       images JSONB <br>            );&#39;, category);<br>        <br>        EXECUTE format(<br>            &#39;CREATE TABLE IF NOT EXISTS %I_meta (<br>                item_id VARCHAR(50) NOT NULL PRIMARY KEY,<br>    main_category TEXT ,<br>    title TEXT ,<br>    average_rating FLOAT CHECK (average_rating &gt;= 0.0 AND average_rating &lt;= 5.0),<br>    rating_number INT DEFAULT 0,<br>    features JSONB, <br>    description JSONB, <br>    price FLOAT CHECK (price &gt;= 0.0),<br>    images JSONB, <br>    videos JSONB, <br>    store TEXT,<br>    categories JSONB, <br>    details JSONB, <br>    parent_asin VARCHAR(20) ,<br>    bought_together JSONB <br>            );&#39;, category);<br>    END LOOP;<br>END $$;</pre><h4>Step 5: Database Connection and ORM Setup</h4><p>We define a connection to our PostgreSQL database and establish ORM models for <strong>Amazon Fashion Reviews</strong> and <strong>Metadata</strong>.</p><pre>from sqlalchemy import create_engine, Column, Integer, String, Float, Boolean, Text, JSON, BigInteger<br>from sqlalchemy.ext.declarative import declarative_base<br>from sqlalchemy.orm import sessionmaker<br>import json<br>import uuid<br><br><br>Base = declarative_base()<br><br>def create_review_class(table_name):<br>    class DynamicClass(Base):<br>        __tablename__ = table_name<br>        review_id = Column(String(50), nullable=False, primary_key=True)<br>        rating = Column(Float, nullable=False)<br>        title = Column(Text)<br>        text = Column(Text)<br>        images = Column(JSON)<br>        asin = Column(String(50), nullable=False)<br>        parent_asin = Column(String(50), nullable=False)<br>        user_id = Column(String(50), nullable=False)<br>        timestamp = Column(BigInteger, nullable=False)<br>        verified_purchase = Column(Boolean, nullable=False)<br>        helpful_vote = Column(Integer, default=0)<br>    return DynamicClass<br><br>def create_meta_class(table_name):<br>    class DynamicClass(Base):<br>        __tablename__ = table_name<br>        item_id = Column(String(50), nullable=False, primary_key=True)<br>        main_category = Column(String, nullable=False)<br>        title = Column(String, nullable=False)<br>        average_rating = Column(Float)<br>        rating_number = Column(Integer, default=0)<br>        features = Column(JSON)<br>        description = Column(JSON)<br>        price = Column(Float)<br>        images = Column(JSON)<br>        videos = Column(JSON)<br>        store = Column(String)<br>        categories = Column(JSON)<br>        details = Column(JSON)<br>        parent_asin = Column(String(20), nullable=False)<br>        bought_together = Column(JSON)<br>    return DynamicClass<br><br><br>MetaClass = create_meta_class(&#39;amazon_fashion_meta&#39;)<br>ReviewClass = create_review_class(&#39;amazon_fashion_review&#39;)<br><br>DATABASE_URL = &quot;postgresql+psycopg2://username:password@localhost/amazon_reviews&quot;<br>engine = create_engine(DATABASE_URL)<br>Base.metadata.create_all(engine)<br>Session = sessionmaker(bind=engine)<br>session = Session()</pre><h4>Step 6: Inserting Data from JSONL Files</h4><pre><br>def insert_review_from_jsonl(file_path, max_records=500,model_class=None):<br>    inserted_count = 0  <br>    with open(file_path, &#39;r&#39;) as file:<br>        for line in file:<br>            if inserted_count &gt;= max_records:<br>                break             <br>            data = json.loads(line)  <br>            <br>            review = model_class(<br>                review_id=str(uuid.uuid4()),<br>                rating=data[&#39;rating&#39;],<br>                title=data[&#39;title&#39;],<br>                text=data[&#39;text&#39;],<br>                images=data[&#39;images&#39;],  <br>                asin=data[&#39;asin&#39;],<br>                parent_asin=data[&#39;parent_asin&#39;],<br>                user_id=data[&#39;user_id&#39;],<br>                timestamp=data[&#39;timestamp&#39;],<br>                verified_purchase=data[&#39;verified_purchase&#39;],<br>                helpful_vote=data[&#39;helpful_vote&#39;]<br>            )<br>            <br>            try:<br>                session.add(review)<br>                inserted_count += 1<br><br>                if inserted_count % 100 == 0:<br>                    session.commit()  <br>                    print(f&quot;Inserted {inserted_count} records...&quot;)<br><br>            except Exception as e:<br>                session.rollback()  <br>                print(f&quot;Error occurred: {e}. Rollback the transaction.&quot;)<br><br>        <br>        if inserted_count % 100 != 0:<br>            session.commit()<br><br>        print(f&quot;Inserted {inserted_count} records into the AllBeautyReview table.&quot;)<br><br>def insert_meta_from_jsonl(file_path, max_records=500,model_class=None):<br>    inserted_count = 0  <br><br>    with open(file_path, &#39;r&#39;) as file:<br>        for line in file:<br>            if inserted_count &gt;= max_records:<br>                break  <br>            <br>            data = json.loads(line)  <br>        <br>            review = model_class(<br>                item_id=str(uuid.uuid4()),<br>                main_category=data.get(&#39;main_category&#39;, None),<br>                title=data.get(&#39;title&#39;, None),<br>                average_rating=data.get(&#39;average_rating&#39;, None),<br>                rating_number=data.get(&#39;rating_number&#39;, 0),<br>                features=data.get(&#39;features&#39;, []),<br>                description=data.get(&#39;description&#39;, []),<br>                price=data.get(&#39;price&#39;, None),<br>                images=data.get(&#39;images&#39;, []),<br>                videos=data.get(&#39;videos&#39;, []),<br>                store=data.get(&#39;store&#39;, None),<br>                categories=data.get(&#39;categories&#39;, []),<br>                details=data.get(&#39;details&#39;, {}),<br>                parent_asin=data[&#39;parent_asin&#39;],<br>                bought_together=data.get(&#39;bought_together&#39;, [])<br>            )<br><br>            try:<br>                session.add(review)<br>                inserted_count += 1<br><br>                if inserted_count % 100 == 0:<br>                    session.commit()  <br>                    print(f&quot;Inserted {inserted_count} records...&quot;)<br><br>            except Exception as e:<br>                session.rollback()  <br>                print(f&quot;Error occurred: {e}. Rollback the transaction.&quot;)<br><br>        <br>        if inserted_count % 100 != 0:<br>            session.commit()<br><br>        print(f&quot;Inserted {inserted_count} records into the AllBeautyReview table.&quot;)<br><br>insert_review_from_jsonl(&#39;Amazon_Fashion.jsonl&#39;, max_records=500,model_class=ReviewClass)<br>insert_meta_from_jsonl(&#39;meta_Amazon_Fashion.jsonl&#39;,max_records=500,model_class=MetaClass)</pre><blockquote>Bulk Insert for Large Dataset to insert all categories</blockquote><p>You could follow the same code for metadata as well.</p><pre><br>def insertbulk_review_from_jsonl(file_path, batch_size=50000, model_class=None, engine=None):<br>    &quot;&quot;&quot;<br>    Bulk inserts reviews from a JSONL file into the database efficiently.<br>    <br>    Args:<br>    - file_path: Path to the JSONL file.<br>    - batch_size: Number of records per batch insert.<br>    - model_class: SQLAlchemy ORM model class.<br>    - engine: SQLAlchemy database engine.<br>    &quot;&quot;&quot;<br>    Session = sessionmaker(bind=engine)<br>    session = Session()<br>    batch = []<br>    ins_count = 0  <br><br>    with open(file_path, &#39;r&#39;) as file:<br>        inserted_count =0<br>        for line in file:<br>            data = json.loads(line)<br><br>            if ins_count &gt;= 500000:<br>                break<br><br>            batch.append({<br>                &quot;review_id&quot;: str(uuid.uuid4()),<br>                &quot;rating&quot;: data[&quot;rating&quot;],<br>                &quot;title&quot;: data[&quot;title&quot;],<br>                &quot;text&quot;: data[&quot;text&quot;],<br>                &quot;images&quot;: data[&quot;images&quot;],<br>                &quot;asin&quot;: data[&quot;asin&quot;],<br>                &quot;parent_asin&quot;: data[&quot;parent_asin&quot;],<br>                &quot;user_id&quot;: data[&quot;user_id&quot;],<br>                &quot;timestamp&quot;: data[&quot;timestamp&quot;],<br>                &quot;verified_purchase&quot;: data[&quot;verified_purchase&quot;],<br>                &quot;helpful_vote&quot;: data[&quot;helpful_vote&quot;],<br>            })<br><br>            if len(batch) &gt;= batch_size:<br>                ins_count += batch_size<br>                session.bulk_insert_mappings(model_class, batch)<br>                session.commit()  <br>                inserted_count += len(batch)<br>                print(f&quot;Inserted {inserted_count} records...&quot;)<br>                batch.clear()<br><br>    if batch:<br>        session.bulk_insert_mappings(model_class, batch)<br>        session.commit()<br>        inserted_count += len(batch)<br><br>    print(f&quot;Total records inserted: {inserted_count}&quot;)<br>    session.close()<br><br>insertbulk_review_from_jsonl(&#39;Amazon_Fashion.jsonl&#39;, batch_size=100000,model_class=ReviewClass,engine=engine)</pre><p>Now, with the data in PostgreSQL, it is time to analyze it. We can perform various SQL queries to gain insights from reviews and products.</p><h4>Step 7: Data Analysis &amp; SQL Queries</h4><p>let us ask some questions ourselves to analyze the data.</p><blockquote>What is the total number of records in the amazon_fashion_review table?</blockquote><pre>SELECT COUNT(*) As Total_Records <br>FROM public.amazon_fashion_review;</pre><blockquote>Total Distinct Users in amazon_fashion_review table</blockquote><pre>SELECT COUNT(DISTINCT(user_id)) AS Total_Users<br>FROM public.amazon_fashion_review;</pre><blockquote>How many reviews exist for each rating in the amazon_fashion_review table?</blockquote><pre>SELECT rating, COUNT(*) <br>FROM public.amazon_fashion_review <br>GROUP BY rating <br>ORDER BY rating;</pre><blockquote>What are the top 5 users who have written the most reviews?</blockquote><pre>SELECT user_id,COUNT(rating) AS review_count<br>FROM public.amazon_fashion_review <br>GROUP BY user_id <br>ORDER BY review_count Desc<br>FETCH FIRST 5 ROWS ONLY;</pre><blockquote>What is the average rating given by each user?</blockquote><pre>SELECT user_id, AVG(rating) AS avg_rating<br>FROM public.amazon_fashion_review <br>GROUP BY user_id; </pre><blockquote>Who are the most critical reviewers (lowest average rating)?</blockquote><pre>SELECT user_id, AVG(rating) AS avg_rating<br>FROM public.amazon_fashion_review <br>GROUP BY user_id<br>ORDER BY avg_rating Asc<br>FETCH FIRST 100 ROWS ONLY;</pre><blockquote>How many users have posted more than 50 reviews?</blockquote><pre>SELECT user_id,COUNT(*) AS review_count<br>FROM public.amazon_fashion_review <br>GROUP BY user_id <br>ORDER BY review_count Desc<br>FETCH FIRST 5 ROWS ONLY;</pre><blockquote>What is the average rating for each product in the meta table?</blockquote><pre>SELECT m.title, AVG(r.rating) AS avg_rating<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>GROUP BY m.title<br>ORDER BY avg_rating DESC;</pre><blockquote>Which of 100 Products have the highest and lowest average ratings?</blockquote><pre>SELECT m.title, AVG(r.rating) AS avg_rating<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>GROUP BY m.title<br>ORDER BY avg_rating DESC<br>LIMIT 100;<br><br>SELECT m.title, AVG(r.rating) AS avg_rating<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>GROUP BY m.title<br>ORDER BY avg_rating ASC<br>LIMIT 100;</pre><blockquote>How many unique products in the meta table have at least one review in the review table?</blockquote><pre>SELECT COUNT(DISTINCT m.parent_asin) AS unique_products_with_reviews<br>FROM public.amazon_fashion_meta m<br>JOIN public.amazon_fashion_review r ON r.parent_asin = m.parent_asin;</pre><blockquote>What percentage of products in the meta table have never received a review?</blockquote><pre>SELECT <br>    (COUNT(DISTINCT m.parent_asin) - COUNT(DISTINCT r.parent_asin)) * 100.0 / COUNT(DISTINCT m.parent_asin) AS percentage_no_reviews<br>FROM public.amazon_fashion_meta m<br>LEFT JOIN public.amazon_fashion_review r ON m.parent_asin = r.parent_asin;</pre><blockquote>Do higher-priced products tend to have higher ratings?</blockquote><pre>SELECT m.price, AVG(r.rating) AS avg_rating<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>GROUP BY m.price<br>ORDER BY m.price;</pre><blockquote>What is the average price of products that receive 1-star reviews compared to 5-star reviews?</blockquote><pre>SELECT AVG(m.price) AS avg_price_1_star<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>WHERE r.rating = 1;<br><br>SELECT AVG(m.price) AS avg_price_5_star<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>WHERE r.rating = 5;</pre><blockquote>Which price range has the most reviews?</blockquote><pre>SELECT <br>    CASE <br>        WHEN m.price &lt; 20 THEN &#39;Under $20&#39;<br>        WHEN m.price BETWEEN 20 AND 50 THEN &#39;$20-$50&#39;<br>        WHEN m.price BETWEEN 50 AND 100 THEN &#39;$50-$100&#39;<br>        ELSE &#39;Above $100&#39;<br>    END AS price_range, <br>    COUNT(*) AS review_count<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>GROUP BY price_range<br>ORDER BY review_count DESC;</pre><blockquote>Which expensive products ($100+) have a low average rating (&lt; 3.0)?</blockquote><pre>SELECT m.parent_asin, m.price, m.title, AVG(r.rating) AS avg_rating<br>FROM public.amazon_fashion_review r<br>JOIN public.amazon_fashion_meta m ON r.parent_asin = m.parent_asin<br>WHERE m.price &gt;= 100<br>GROUP BY m.parent_asin, m.title, m.price<br>HAVING AVG(r.rating) &lt; 3;</pre><p>Next Steps:</p><p>Now, as we’ve seen some basic analysis, You can continue exploring and learning SQL, SQLAlchemy, and PostgreSQL with different categories in the dataset.</p><p>I hope to see you all next week, either with a new setup or continuing our exploration with this database. We may dig deeper into SQLAlchemy and build the ETL pipeline as a small, basic one.</p><blockquote>🍫Byte time Over Until then, <strong>Signing off with cheers,</strong> here Anirudh.</blockquote><p>Follow me on <a href="http://www.linkedin.com/in/anirudhiyengar-kn">LinkedIn</a>.😁</p><blockquote>[1]: Bridging Language and Items for Retrieval and Recommendation, 2024<br><a href="https://arxiv.org/abs/2403.03952">https://arxiv.org/abs/2403.03952</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42bd2bacc551" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tech Bits & Bytes: Doing Nothing]]></title>
            <link>https://medium.com/@akaniyar/tech-bits-bytes-doing-nothing-7abc4d4687d9?source=rss-98ee58768f3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7abc4d4687d9</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Anirudh Narayana]]></dc:creator>
            <pubDate>Thu, 13 Feb 2025 21:54:03 GMT</pubDate>
            <atom:updated>2025-02-13T21:54:03.273Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*pWoxRsRqG9ovvkjXG_aEAQ.png" /><figcaption><a href="https://en.rattibha.com/thread/1717116513558122828/">image source</a></figcaption></figure><h4>A Weekly Dive into AI Tech &amp; Learning!</h4><p><em>I’m excited to start a new writing journey on </em><strong><em>Medium</em></strong><em>! 🎉 Each week, I’ll be sharing </em><strong><em>concise, byte-sized posts</em></strong><em> covering:</em></p><p>✅ <strong>Emerging AI &amp; ML technologies</strong> 🧠<br>✅ <strong>Fundamental concepts in AI, ML &amp; Data Science</strong> 🔍<br>✅ <strong>Practical insights from my learning journey</strong> 📚<br>✅ <strong>Exciting tech trends &amp; innovations</strong> 🚀</p><h3>💡 Why am I doing this?</h3><blockquote>The tech world moves fast, and keeping up with it can be overwhelming. By sharing <strong>quick, digestible insights</strong>, I hope to not only reinforce my own understanding but also spark meaningful discussions with fellow mates.</blockquote><blockquote>Whether you’re new to AI/ML, a seasoned professional, or just curious about cutting-edge tech, I’d love for you to <strong>join me on this journey</strong>. Let’s learn, explore, and grow together!</blockquote><p>🌟 <strong>Stay tuned for my first post this week!</strong> Let’s make learning accessible, engaging, and fun.</p><p>💬 <strong>What topics are you most interested in? Drop your suggestions in the comments!</strong></p><p>#AI #MachineLearning #DeepLearning #AICommunity #TechTrends #DataScience #MLOps #ByteSizedLearning #AIInnovation #TechBlogging</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7abc4d4687d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>