A review score is a customer’s numerical rating of a purchase experience. In the review dataset, `review_score` runs from 1 to 5 and accompanies a review identifier, order identifier, Portuguese-language comment fields, and survey timestamps. It offers a quick signal of customer satisfaction, but a single overall number can hide differences between products and sellers. section 5.2.2 section 3.3.3
A practical first question is: How are scores distributed across product categories and sellers? Ask an AI assistant for a workflow, giving it the actual DataFrame names and columns rather than trusting it to remember an earlier description. Then inspect and run the suggested code. section 3.3.3
# Merge the DataFramesmerged_data = ( df_orders.merge(df_order_items, on='order_id') .merge(df_products, on='product_id') .merge(df_order_reviews, on='order_id') .merge(df_product_category_translation, on='product_category_name') )# Group by product_category_name_english, seller_id, and review_scorereview_score_distribution = merged_data.groupby(['product_category_name_english', 'seller_id', 'review_score']).size().reset_index(name='count')
This pandas workflow joins orders, items, products, reviews, and category translations, then counts records for each category–seller–score combination. Check that the joins and resulting counts match the intended records before interpreting them. section 3.3.3
A grouped bar chart can display score counts by product category. With many categories and score levels, it may become difficult to read. A simpler view labels scores of 4 or 5 “Positive” and lower scores “Negative”; broader product groups can reduce clutter further. Those choices improve readability but discard detail, so retain the original scores for follow-up checks. If plotting from pre-counted rows, verify that the chart displays the intended totals after any regrouping. section 3.3.3
From description to explanation
Suppose one category appears to receive weaker ratings. Its score distribution identifies where to look; it does not establish why customers rated it that way. An ordinal logistic regression can examine associations between review score and delivery time, price, freight value, product attributes, and payment attributes. Interpret its coefficients cautiously: a reported example had approximately 43% accuracy, and its fit statistics raised concerns about how well it captured the relationships. Treat an AI-generated business explanation as a hypothesis to check against the model results and individual reviews, not as proof that changing an attribute will raise scores. section 4.7 section 5.2.2
