Ürün İade ve İade Nedeni Analizi: Sorun Siparişte mi, Teslimatta mı?Product Returns and Return Reasons: The Order or the Delivery?
Brezilya pazaryeri Olist'in 99.092 siparişinde iadeyi iki ayrı tanımla ölçtüm. Sipariş anında bilinebilen her şey iade riskini zayıf açıklıyor (AUC 0,637); teslimat gerçekleştikten sonra aynı model güçleniyor (0,749). Söz verilen tarihten yedi gün geç gelen siparişlerin %79,7'si sorunlu.I measured returns two separate ways across 99,092 orders from the Brazilian marketplace Olist. Everything knowable at order time explains return risk weakly (AUC 0.637); after delivery the same model gets strong (0.749). Of orders arriving seven or more days late, 79.7% end in a problem.
- Python
- pandas
- scikit-learn
- Pazaryeri
- İade analizi
Pazaryerinde iade konuşulurken iki ayrı soru birbirine karışır: ürün mü kötüydü, teslimat mı kötüydü? İkisinin çözümü aynı yerde değil — biri ürün sayfasını ve satıcı denetimini, diğeri lojistiği ilgilendirir. Bu projede Brezilya pazaryeri Olist'in 99.092 gerçek siparişini alıp iadeyi iki ayrı tanımla ölçtüm, nedenleri doğrulanmış bir sınıflandırıcıyla ayırdım ve aynı test döneminde iki risk modeli kurdum: biri siparişin verildiği anda bilinebilenlerle, biri teslimat gerçekleştikten sonra.
Veri ve kapsam
Veri seti Brazilian E-Commerce Public Dataset by Olist (CC BY-NC-SA 4.0): Brezilya'nın en büyük pazaryerlerinden birinin gerçek sipariş, kalem, ödeme, yorum, müşteri ve satıcı kayıtları. Analiz penceresi 5 Ocak 2017 – 31 Ağustos 2018; bu pencerede 99.092 sipariş, 112.279 kalem, 95.774 müşteri, 3.062 satıcı, 74 kategori ve 15,79 milyon BRL ciro var.
Veriyi iki bağımsız aynadan indirip orders, order_items ve
reviews dosyalarının SHA-256 özetlerini karşılaştırdım; birebir aynı çıktılar. Müşteri ve
satıcı kimlikleri kaynakta zaten hash'li, mağaza adları kurgusal isimlerle değiştirilmiş durumda.
Rapora hiçbir ham yorum metni alınmadı — yorumlar yalnızca toplulaştırılmış neden
dağılımı olarak görünüyor.
İade nasıl tanımlandı
Bu veri setinin bu proje için en ciddi eksiği şu: Olist'te “iade edildi” diye bir alan yok. Resmî bir iade kaydı olmadan iade oranı raporlamak, uydurmak olurdu. Bunun yerine iki ölçü türettim ve raporun tamamında hiç karıştırmadan, hep ayrı ayrı gösterdim.
İade göstergesi
İptal edilen, tedarik edilemeyen ve yorum metninde açık iade / değişim / para iadesi talebi geçen siparişler. %2,59 sipariş · %1,93 adet · %2,41 ciro.
Sorunlu sipariş
Dar tanım artı 1–2 puanlı şikâyetler. %15,60 sipariş · %16,94 adet · %17,75 ciro. Bu bir iade oranı değil, memnuniyetsizlik oranıdır.
Dar tanımın bileşenleri ayrı ayrı da ölçülebilir: yalnızca iptal %0,59, yalnızca tedarik edilemeyen %0,61, yalnızca metinde açık talep %1,52. Yani dar tanımın yarısından çoğu sipariş durumundan değil, müşterinin kendi yazdığı metinden geliyor.
Kayıt ayrımları
Oran hesabına girmeden önce dokuz kayıt tipini ayrı ayrı saydım; çünkü bunların bir kısmı paydadan çıkarılmazsa oran kendiliğinden kayar.
| Kayıt tipi | Sipariş | Pay |
|---|---|---|
| Teslim edilen | 96.211 | %97,09 |
| Akıbeti açık (teslim de iptal de değil) | 1.699 | %1,71 |
| Kalemsiz (sipariş var, satır yok) | 739 | %0,75 |
| Tedarik edilemeyen | 602 | %0,61 |
| İptal | 580 | %0,59 |
| Sevkten sonra iptal | 70 | %0,07 |
| Çok kalemli | 9.767 | %9,86 |
| Çok satıcılı | 1.274 | %1,29 |
| Mükerrer (aynı müşteri + ürün, 7 gün içinde) | 142 | %0,14 |
Mükerrer siparişleri silmek yerine işaretledim: sorun oranları (%16,2) tekil siparişlerden (%15,6) anlamlı biçimde farklı değil, yani “tekrar sipariş = başarısız ilk sipariş” varsayımı bu veride desteklenmiyor. Silmek bu bulguyu yok ederdi.
Oranın payı ve paydası
Bir iade oranı tek başına anlamsızdır; neyin neye bölündüğü söylenmeden okunamaz. Aynı payı üç ayrı paydada raporladım: sipariş sayısı, kalem adedi ve ciro.
Aynı pay, üç farklı payda: sipariş sayısı, kalem adedi ve ciro. Geniş tanımda ciro payı sipariş payını aşıyor.
Dikkat çeken şey, geniş tanımda ciro payının sipariş payından yüksek olması (%17,75 > %15,60): sorunlu siparişler ortalama bir siparişten pahalı. Dar tanımda ise tersi (%2,41 ciro > %2,59 sipariş değil, yakın) — açık iade talebi fiyatla güçlü bir ilişki göstermiyor. Ödeme tipine bakıldığında da dar tanım ilginç bir yere oturuyor: voucher ile ödenen siparişlerde iade göstergesi %4,61, kredi kartında %2,52. Bu bir nedensellik değil; voucher'ın hangi kampanyalarda kullanıldığı veride yok.
Teslimat ve gecikme
Raporun en güçlü ilişkisi burada. Siparişin söz verilen tarihe göre ne zaman geldiğine bakıldığında sorun oranı yedi kat açılıyor.
Zamanında gelen bantlarda oran %9,5–12,5'te duruyor; 7 günden fazla gecikmede %79,7'ye çıkıyor.
Zamanında ya da erken gelen bantlarda sorun oranı %9,5–12,5 arasında dar bir koridorda duruyor. Söz verilen tarihten 1–3 gün geç gelende %33,0, 4–7 gün geçte %68,4, 7 günden fazla geçte %79,7. Teslim süresine göre de aynı yön: 0–3 günde teslim edilen siparişlerde %7,5, 30 günü aşanlarda %66,4.
Burada bir dürüstlük uyarısı gerekiyor ve raporda bunu açıkça yazdım: geniş tanım 1–2 puanlı şikâyetleri içeriyor, gecikme de şikâyetin en sık sebebi. Yani bu ilişkinin bir kısmı tanımın kendisinden geliyor, keşfedilmiş bir olgu değil. Bu yüzden aynı kırılımı dar tanımla da verdim: 7+ gün geç bandında iade göstergesi %2,62, erken bantlarda %1,17. Yön aynı, büyüklük çok daha küçük. Gecikme memnuniyetsizliği iki kat, açık iade talebini ise yalnızca iki kattan az artırıyor — geniş tanımdaki sekiz katlık fark tanım etkisidir.
Kategori, satıcı, bölge
En az 500 siparişi olan kategoriler. Mobilya ve ofis mobilyası tepede, kitap en altta.
Kategori aralığı iki buçuk kat: office_furniture %23,4 ile en kötü, books_general_interest %8,5 ile en iyi uçta. Mobilya kategorilerinin tepede olması şaşırtıcı değil — ağır, hacimli, hasara açık ve teslim süresi uzun (office_furniture medyanı 18 gün, kampüs ortalaması 10 gün).
En az 50 siparişi olan 424 satıcı. Dağılımın sağ kuyruğu kısa ama ağır: en kötü 10 satıcı sorunların %10,9'unu taşıyor.
Satıcı tarafında dağılım çok daha çarpıcı. En az 50 siparişi olan 424 satıcı değerlendirildiğinde medyan sorun oranı %13,7, üst çeyrek %17,98 — ama en kötü 10 satıcı tüm sorunlu siparişlerin %10,89'unu taşıyor ve bunu siparişlerin yalnızca %5,74'üyle yapıyor. Yani sorun küçük bir satıcı kümesinde yoğunlaşıyor; en kötüsünün oranı %62,6.
2017 Ocak'tan 2018 Ağustos'a sorun oranı %17,0'dan %12,0'a, medyan teslim süresi 10 günden 7 güne indi.
Zaman içinde tablo düzeliyor: 2017 Ocak'ta %17,0 olan sorun oranı 2018 Ağustos'ta %12,0'a inmiş, medyan teslim süresi 10 günden 7 güne düşmüş. İkisinin aynı yönde hareket etmesi teslimat tezini destekliyor ama kanıtlamıyor — aynı dönemde satıcı karması da değişti.
Bölge kırılımı (müşteri ili MA %23,0, RJ %21,6, en iyi iller %12 civarı) burada ekolojik bir ilişkidir: il düzeyindeki oran bireysel siparişe taşınamaz. Kötü illerin medyan teslim süreleri de uzun (MA 19 gün, RJ 12 gün), yani ilin kendisi değil mesafe konuşuyor olabilir.
İade nedenleri
Nedenleri Portekizce yorum metinlerinden çıkardım: 11 kategoriye, özelden genele sıralanmış regex desenleriyle. Yöntemin değeri desenlerde değil, desenlerin dondurulup ayrı bir örneklemde ölçülmesinde. Desenler 42 numaralı tohumla çekilen 100 metin üzerinde geliştirildi, sonra kilitlendi; ardından geliştirme setinin tamamen dışından (tohum 2025) 100 kayıt elle etiketlendi.
Desenler dondurulduktan sonra, geliştirme setinin dışından 100 kayıt elle etiketlendi: kesinlik %95,8, duyarlılık %70,8.
Sonuç: kesinlik %95,8, duyarlılık %70,8. 100 kaydın 71'ine somut bir neden atandı, 26'sı kaçırıldı, 3'ü yanlış sınıflandı. Hata profili asimetrik — sınıflandırıcı az atıyor ama attığında doğru atıyor. Bu yüzden neden dağılımındaki her pay bir alt sınırdır.
İlk üç satırın toplamı sorunlu siparişlerin %67,3'ü; bunun %43,5'i “neden bilinmiyor” demek.
Dağılımın en önemli özelliği ilk üç satırı: “Teslim edilmedi” %23,8, “metinde neden ayırt edilemedi” %22,1 ve “neden belirtilmemiş” %21,4. Yani sorunlu siparişlerin %43,5'inde neden bilinmiyor: ya müşteri metin yazmamış (yorumların yalnızca %43,4'ünde metin var) ya da yazdığı metin bir nedene ayrılamıyor. Ürüne dair klasik iade nedenleri — eksik veya yanlış ürün %9,7, beklentiyi karşılamadı %3,8, kalite/arızalı %3,8, hasarlı geldi %2,3 — hepsi toplandığında bile “teslim edilmedi”nin altında kalıyor.
Nedenler kategoriye göre belirgin biçimde ayrışmıyor; “teslim edilmedi” neredeyse her kategoride baskın.
Kategori × neden ısı haritası aynı şeyi ikinci kez gösteriyor: nedenler kategoriye göre ciddi biçimde farklılaşmıyor, “teslim edilmedi” neredeyse her kategoride baskın. Ürün kaynaklı bir iade örüntüsü olsaydı bu haritada kategori bazlı sıcak hücreler görünürdü.
İki risk modeli
Buraya kadarki her şey tanımlayıcı. Soruyu karar verilebilir hale getirmek için tek bir şeyi test ettim: bir sipariş sorunlu olacak mı, ve bunu ne zaman bilebiliriz? Ayrımı takvime göre yaptım (eğitim < 1 Mayıs 2018 ≤ test): eğitimde 73.248 sipariş (%16,87 sorunlu), testte 25.844 (%12,00). Satıcı, kategori ve il geçmiş oranları yalnızca eğitim penceresinden, düzeltilmiş ortalamayla hesaplanıp teste olduğu gibi taşındı.
Sipariş anı — uygulanabilir
Yorum, puan, teslim tarihi ve gecikme hiç kullanılmadı. Yalnızca siparişin verildiği anda bilinebilenler. AUC 0,637.
Teslimat sonrası — yalnızca teşhis
Gerçekleşen teslim süresi ve gecikme dahil. Sipariş anında kullanılamaz, çünkü girdileri henüz yok. AUC 0,749.
Aynı algoritma, aynı test dönemi; tek fark B modelinin gerçekleşen teslimatı görmesi.
| Model | AUC | PR-AUC | Brier | Üst %10 oran | Lift | Yakalanan |
|---|---|---|---|---|---|---|
| Genel ortalama (temel) | — | 0,120 | 0,1080 | — | — | — |
| Satıcının geçmiş oranı (temel) | 0,577 | 0,168 | 0,1066 | — | — | — |
| A · lojistik regresyon | 0,633 | 0,266 | 0,1031 | %29,9 | 2,49× | %24,9 |
| A · gradyan artırma | 0,637 | 0,266 | 0,1007 | %28,8 | 2,40× | %24,0 |
| B · lojistik regresyon | 0,688 | 0,361 | 0,0932 | %42,8 | 3,56× | %35,6 |
| B · gradyan artırma | 0,749 | 0,461 | 0,0835 | %51,0 | 4,24× | %42,5 |
Üst %10: modelin en riskli dilimindeki gerçek sorun oranı. Lift: bu oranın test dönemi ortalamasına (%12,00) bölümü. Yakalanan: test dönemindeki tüm sorunlu siparişlerin yüzde kaçının bu dilime düştüğü.
Tahmin edilen olasılık ile gerçekleşen oran karşılaştırması; A modeli zayıf ama kalibrasyonu bozuk değil.
Aradaki fark raporun ana tezidir. Sipariş anında bilinebilen her şey — fiyat, kargo tutarı, kalem sayısı, satıcı sayısı, vaat edilen süre, satıcının ve kategorinin geçmiş oranı — sorunu ancak 0,637'ye kadar açıklıyor. Gerçekleşen teslimat eklendiğinde aynı algoritma 0,749'a çıkıyor ve en riskli %10'daki oran %28,8'den %51,0'a sıçrıyor. Özellik önemlerinde de en güçlü tek değişken satıcının geçmiş sorun oranı (0,066); ikinci sıradaki kalem sayısı onun üçte biri kadar. Yani: bilgi siparişte değil, teslimatta ve satıcıda.
Öneriler ve doğrulama planı
Bulgular gözlemsel; hiçbiri nedensellik iddiası taşımıyor. Bu yüzden önerileri “şunu yaparsan şu kadar düşer” diye değil, ölçülebilir birer deney olarak yazdım.
- Satıcı denetimini oranla değil, yoğunlaşmayla kur. En kötü 10 satıcı sorunların %10,89'unu siparişlerin %5,74'üyle üretiyor. Müdahale listesi küçük; etkisi ölçülebilir büyüklükte.
- Teslimat sözünü gerçekçi kur. 7+ gün geç gelen 2.860 sipariş var ve bunların %79,7'si sorunlu. Vaat edilen tarihi uzatmak oranı mekanik olarak düşürür; bu bir iyileşme değil, tanım değişikliğidir — o yüzden ölçütü gerçekleşen teslim süresi olarak sabitlemek gerekir.
- A modelini sipariş anında işaretleme için kullan. 2,40× kaldıraçla en riskli %10'u ayırıyor ve tüm sorunların %24'ünü yakalıyor. Zayıf bir model, ama uygulanabilir tek model.
- B modelini sipariş anı kararı için kullanma. Daha iyi görünmesi girdilerinin geleceği bilmesinden; sahada o girdiler henüz yok.
Doğrulama planı: her müdahale için kesintili zaman serisi ya da satıcı bazlı aşamalı açılım, ölçüt hem dar hem geniş oran (ikisi farklı yöne gidebilir), karşılaştırma dönemi mevsimsellik için aynı takvim ayları.
Sınırlar
- İade göstergesi vekil bir ölçüdür, resmî iade kaydı değil. Gerçek iade oranı bu iki sayının arasında bir yerdedir ve bu veriden bilinemez.
- Yorumların yalnızca %43,4'ünde metin var. Nedenler bu alt kümeden okunuyor; metin yazanlarla yazmayanların sistematik farkı ölçülemez.
- Gözlemsel veri. Teslimat–sorun ilişkisi güçlü ama nedensel değil; geç teslimat da, şikâyet de ortak bir üçüncü sebebin (uzak bölge, zor kategori, zayıf satıcı) sonucu olabilir.
- Kategori ve il ilişkileri ekolojiktir, bireysel siparişe taşınamaz.
- Veri 2017–2018 Brezilya pazarına aittir; başka pazara genellenemez. Lisans ticari olmayan kullanım şartı taşıyor (CC BY-NC-SA 4.0).
Dosyalar
Aynı analizin tek dosyalık rapor sürümü: Ürün iade raporu (HTML) — ~107 KB, grafikler dosyanın içine gömülü, internet bağlantısı olmadan da açılır. Bu sayfadaki bulguların aynısını, veri sözlüğü ve kök neden hipotezleri bölümleriyle birlikte içerir.
Sonuç
Bu projenin tek cümlelik çıktısı iki sayının farkı: 0,637 ve 0,749. Siparişin verildiği anda bilinebilen her şey iade riskini zayıf açıklıyor; teslimat gerçekleştikten sonra aynı model belirgin biçimde güçleniyor. Nedenler tarafında da aynı yön: müşterilerin yazdığı metinlerde en sık geçen neden ürüne dair bir kusur değil, “teslim edilmedi”.
Pratikte bunun anlamı şu: bu pazaryerinde iade azaltma işi ürün açıklamasında ya da fotoğrafta değil, lojistikte ve satıcı denetiminde. Ve bunu söyleyebilmek için iki ayrı iade tanımı, bir dondurulmuş sınıflandırıcı ve zamana göre ayrılmış iki model gerekti — çünkü tek bir “iade oranı” rakamı bu ayrımı hiçbir zaman gösteremezdi.
Analiz Python 3.13, pandas, NumPy ve scikit-learn ile yapıldı; bütün betiklerde rastgelelik sabitlendi, aynı veri aynı sayıları üretir. Veri seti: Olist & Sionek, A. (2018). Brazilian E-Commerce Public Dataset by Olist, Kaggle, CC BY-NC-SA 4.0.
When returns come up on a marketplace, two different questions get tangled together: was the product bad, or was the delivery bad? They are not fixed in the same place — one is about product pages and seller oversight, the other about logistics. In this project I took 99,092 real orders from the Brazilian marketplace Olist, measured returns under two separate definitions, separated the reasons with a validated classifier, and fitted two risk models on the same test period: one using only what is knowable when the order is placed, one using what is known after delivery.
Data and scope
The dataset is the Brazilian E-Commerce Public Dataset by Olist (CC BY-NC-SA 4.0): real order, item, payment, review, customer and seller records from one of Brazil's largest marketplaces. The analysis window is 5 January 2017 – 31 August 2018, covering 99,092 orders, 112,279 items, 95,774 customers, 3,062 sellers, 74 categories and 15.79 million BRL in revenue.
I downloaded the data from two independent mirrors and compared SHA-256 digests of
orders, order_items and reviews; they matched exactly. Customer
and seller identifiers are already hashed at source and store names are replaced with fictional ones.
No raw review text appears in the report — reviews show up only as an aggregated
distribution of reasons.
Defining a return
The most serious gap in this dataset for this project is simple: Olist has no “returned” field. Reporting a return rate without a formal return record would be fabrication. Instead I derived two measures and kept them strictly apart throughout.
Return indicator
Cancelled orders, unavailable orders, and orders whose review text contains an explicit return / exchange / refund request. 2.59% of orders · 1.93% of items · 2.41% of revenue.
Problem order
The narrow definition plus 1–2 star complaints. 15.60% of orders · 16.94% of items · 17.75% of revenue. This is a dissatisfaction rate, not a return rate.
The narrow definition breaks down further: cancellation alone 0.59%, unavailable alone 0.61%, explicit text request alone 1.52%. So more than half of it comes not from order status but from what the customer wrote.
Record carve-outs
Before computing any rate I counted nine record types separately, because leaving some of them in the denominator shifts the rate on its own: delivered 97.09%, fate-open 1.71%, item-less 0.75%, unavailable 0.61%, cancelled 0.59%, cancelled-after-shipping 0.07%, multi-item 9.86%, multi-seller 1.29%, and duplicate orders (same customer and product within 7 days) 0.14%.
I flagged duplicate orders rather than deleting them: their problem rate (16.2%) is not meaningfully different from single orders (15.6%), so the assumption that a repeat order signals a failed first order is not supported here. Deleting them would have erased that finding.
Numerator and denominator
A return rate means nothing until you say what was divided by what. I reported the same numerator over three denominators: order count, item count and revenue.
One numerator, three denominators: order count, item count and revenue. Under the broad definition the revenue share exceeds the order share.
The striking part is that under the broad definition the revenue share exceeds the order share (17.75% vs 15.60%): problem orders are more expensive than average ones. Payment type adds another angle — the narrow return indicator is 4.61% for voucher payments against 2.52% for credit cards. That is not causal; the dataset does not record which campaigns used vouchers.
Delivery and delay
This is the strongest relationship in the report. Measured against the promised date, the problem rate opens up sevenfold: 9.5–12.5% across the on-time and early bands, 33.0% at 1–3 days late, 68.4% at 4–7 days, and 79.7% beyond 7 days. By elapsed delivery time the direction is the same: 7.5% for orders delivered in 0–3 days, 66.4% for those taking over 30.
On-time bands stay between 9.5% and 12.5%; beyond 7 days late the rate reaches 79.7%.
An honesty warning belongs here, and it is stated in the report too: the broad definition contains 1–2 star complaints, and delay is the most common cause of a complaint. Part of this relationship therefore comes from the definition itself rather than from a discovered fact. So I ran the same breakdown on the narrow definition: 2.62% in the 7+ days late band against 1.17% in the early bands. Same direction, far smaller magnitude. The eightfold gap under the broad definition is a definition effect.
Category, seller, region
The category range spans two and a half times: office_furniture at 23.4% is worst, books_general_interest at 8.5% best. Furniture leading is unsurprising — heavy, bulky, damage-prone, and slow to deliver (median 18 days against 10 overall).
Categories with at least 500 orders. Furniture and office furniture at the top, books at the bottom.
The seller distribution is more striking. Among the 424 sellers with at least 50 orders the median problem rate is 13.7% and the upper quartile 17.98% — but the worst 10 sellers carry 10.89% of all problem orders on just 5.74% of orders. The worst one sits at 62.6%.
The 424 sellers with at least 50 orders. A short but heavy right tail: the worst 10 carry 10.9% of all problems.
Over time the picture improves: the problem rate fell from 17.0% in January 2017 to 12.0% in August 2018, while median delivery time dropped from 10 days to 7. The two moving together supports the delivery thesis without proving it — the seller mix changed over the same period.
From January 2017 to August 2018 the problem rate fell from 17.0% to 12.0% and median delivery from 10 days to 7.
The regional breakdown (customer state MA 23.0%, RJ 21.6%, best states around 12%) is an ecological relationship: a state-level rate cannot be carried to an individual order. The worst states also have long median delivery times (MA 19 days, RJ 12), so distance may be doing the talking rather than the state.
Return reasons
I extracted reasons from Portuguese review text into 11 categories using regex patterns ordered from specific to general. The value of the method is not in the patterns but in freezing them and then measuring on a separate sample. Patterns were developed on 100 texts drawn with seed 42, then locked; 100 records from entirely outside that development set (seed 2025) were hand-labelled.
After the patterns were frozen, 100 records from outside the development set were hand-labelled: 95.8% precision, 70.8% recall.
The result: 95.8% precision, 70.8% recall. A concrete reason was assigned to 71 of the 100 records, 26 were missed and 3 misclassified. The error profile is asymmetric — the classifier assigns sparingly but accurately. Every share in the reason distribution is therefore a lower bound.
The first three rows add up to 67.3% of problem orders — and 43.5% of that means “reason unknown”.
The distribution's most important feature is its first three rows: “not delivered” at 23.8%, “reason not distinguishable in text” at 22.1% and “no reason given” at 21.4%. So for 43.5% of problem orders the reason is unknown: either the customer wrote nothing (only 43.4% of reviews carry text) or what they wrote cannot be resolved into a reason. The classic product-side reasons — missing or wrong item 9.7%, did not meet expectations 3.8%, quality or defect 3.8%, arrived damaged 2.3% — stay below “not delivered” even added together.
Reasons do not separate clearly by category; “not delivered” dominates almost everywhere.
The category × reason heat map says the same thing a second way: reasons do not differentiate much by category, and “not delivered” dominates almost everywhere. A product-driven return pattern would have shown category-specific hot cells.
Two risk models
Everything so far is descriptive. To make the question decidable I tested one thing: will an order end in a problem, and when can we know? The split is by calendar (train < 1 May 2018 ≤ test): 73,248 training orders (16.87% problem) and 25,844 test orders (12.00%). Historical seller, category and state rates were computed from the training window only, with smoothing, and carried into the test set unchanged.
At order time — deployable
Review text, rating, delivery date and delay were never used. Only what is knowable when the order is placed. AUC 0.637.
After delivery — diagnostic only
Includes realised delivery time and delay. Unusable at order time, because its inputs do not exist yet. AUC 0.749.
Same algorithm, same test period; the only difference is that model B sees the realised delivery.
| Model | AUC | PR-AUC | Brier | Top 10% rate | Lift | Captured |
|---|---|---|---|---|---|---|
| Overall mean (baseline) | — | 0.120 | 0.1080 | — | — | — |
| Seller's historical rate (baseline) | 0.577 | 0.168 | 0.1066 | — | — | — |
| A · logistic regression | 0.633 | 0.266 | 0.1031 | 29.9% | 2.49× | 24.9% |
| A · gradient boosting | 0.637 | 0.266 | 0.1007 | 28.8% | 2.40× | 24.0% |
| B · logistic regression | 0.688 | 0.361 | 0.0932 | 42.8% | 3.56× | 35.6% |
| B · gradient boosting | 0.749 | 0.461 | 0.0835 | 51.0% | 4.24× | 42.5% |
Top 10%: the actual problem rate in the model's riskiest decile. Lift: that rate divided by the test-period average (12.00%). Captured: the share of all problem orders in the test period that fall into that decile.
Predicted probability against realised rate; model A is weak but not miscalibrated.
The gap between them is the report's thesis. Everything knowable at order time — price, freight, item count, seller count, promised time, historical seller and category rates — explains the outcome only up to 0.637. Adding realised delivery takes the same algorithm to 0.749 and lifts the riskiest decile from 28.8% to 51.0%. In the feature importances the single strongest variable is the seller's historical problem rate (0.066), with item count a third of that. So: the information is not in the order, it is in the delivery and the seller.
Actions and validation
The findings are observational and none of them claims causality, so the recommendations are written as measurable experiments rather than promised reductions.
- Build seller oversight around concentration, not rate. The worst 10 sellers produce 10.89% of problems on 5.74% of orders. A short intervention list with a measurable effect.
- Make the delivery promise realistic. There are 2,860 orders arriving 7+ days late and 79.7% of them end in a problem. Simply extending the promised date lowers the rate mechanically — that is a definition change, not an improvement, so the metric must be fixed to realised delivery time.
- Use model A for flagging at order time. It separates the riskiest 10% at 2.40× lift and catches 24% of all problems. A weak model, but the only deployable one.
- Do not use model B for order-time decisions. It looks better because its inputs know the future; in the field those inputs do not exist yet.
Validation plan: an interrupted time series or a staged seller-level rollout per intervention, with both the narrow and the broad rate as metrics (they can move in opposite directions), compared against the same calendar months for seasonality.
Limitations
- The return indicator is a proxy, not a formal return record. The true return rate lies somewhere between the two numbers and cannot be known from this data.
- Only 43.4% of reviews contain text. Reasons are read from that subset; any systematic difference between writers and non-writers cannot be measured.
- Observational data. The delivery–problem link is strong but not causal; both late delivery and complaints may follow from a shared third cause (remote region, difficult category, weak seller).
- Category and state relationships are ecological and cannot be carried to individual orders.
- The data covers the 2017–2018 Brazilian market and does not generalise to another market. The licence requires non-commercial use (CC BY-NC-SA 4.0).
Files
A single-file version of the same analysis: product returns report (HTML) — about 107 KB, charts embedded in the file, opens without an internet connection. It carries the same findings as this page, plus the data dictionary and root-cause hypothesis sections.
Conclusion
The one-sentence output of this project is the gap between two numbers: 0.637 and 0.749. Everything knowable when the order is placed explains return risk weakly; once delivery has happened the same model gets markedly stronger. The reasons point the same way: the most frequent reason in what customers write is not a product defect but “not delivered”.
In practice that means reducing returns on this marketplace is not a product-description or photography problem but a logistics and seller-oversight one. Saying that required two separate definitions of a return, a frozen classifier and two time-split models — because a single “return rate” figure could never have shown the distinction.
Analysis in Python 3.13 with pandas, NumPy and scikit-learn; randomness is fixed in every script, so the same data reproduces the same numbers. Dataset: Olist & Sionek, A. (2018). Brazilian E-Commerce Public Dataset by Olist, Kaggle, CC BY-NC-SA 4.0.