Machine Learning in E-Commerce: Data to 10X More Revenue
Look, I’m not going to pretend this is some grand thesis. I’m Likhon Hussain. I build cloud infrastructure and AI/ML systems for e-commerce companies. I’ve been doing this for about a decade now, and I’ve made pretty much every mistake you can make and learned from most of them. This article isn’t about theory. It’s about what actually works. What I’ve seen fail. What surprised me. What I’d do differently if I started over.
How I Got Here
Honestly? I fell into this. Ten years ago, I was building straightforward web applications. Then someone asked me to help optimize their database queries. Then it was about understanding customer behavior. Then we started building systems that could predict what customers wanted. And here I am.
I’ve worked with shops doing $100K a year and companies doing hundreds of millions. I’ve sat in boardrooms where people wanted magic solutions, and I’ve been in startups where we were figuring it out with whatever we had.
The thing I notice most? The ones who succeed aren’t necessarily the ones with the biggest budgets. They’re the ones who understand a simple truth: machine learning is just a tool. A really useful tool, but a tool nonetheless.
The Problem Nobody Wants to Admit
I was having coffee with a founder last year. His e-commerce business was doing well. Like, genuinely well. $5M in revenue. Good margins. Healthy growth.
But he told me something that stuck with me: “I feel like I’m flying blind. I have all this data, but I don’t actually know what to do with it. I know customers are leaving but I don’t know why. I know some products are more profitable than others, but the spreadsheets don’t tell me what to stock. And don’t get me started on my pricing strategy it’s basically a guess.”
That conversation? I’ve had it fifty times. Maybe more. You build something, it works, then it plateaus. You can’t figure out why. Your margins are good but not great. You’re spending money on customer acquisition but you’re not great at keeping them around. You have mountains of data but it just sits there.
And meanwhile, you’re watching Amazon figure out exactly what to recommend, Netflix serve up the perfect show, and your direct competitors seem to have some kind of unfair advantage. That’s where machine learning comes in. Not as some complicated technology thing. Just as a way to actually use the data you already have.
Why This Important Right Now (And Why It Didn’t Before)
Here’s what’s changed: five years ago, you could run a solid e-commerce business without worrying too much about personalization or data. You could compete on price, on product selection, on customer service.
Now? That’s not enough anymore. Your customers come from Netflix where everything is recommended to them. They come from Instagram where ads are weirdly accurate. They shop on Amazon where products are recommended perfectly. Then they come to your store and see… a product catalog. Just laid out there.
It feels outdated. And your customers feel it too. The other thing that’s changed: it’s gotten way easier to do this stuff. Five years ago, you needed a team of PhD data scientists and serious infrastructure. Now there are tools. Real tools. Not marketing BS.
Tools that a decent developer can actually use. And your competitors are already doing this. Maybe not all of them, but enough that you’re noticing the gap.
The Actual Things We Do With Machine Learning
Let me tell you what I’ve actually built and seen work. Not the theoretical stuff. The real things.
Recommendations (And Why It’s Not As Simple As You’d Think)
Most e-commerce stores show products in basically the same way to everyone. You get similar products based on product attributes. Maybe some bestsellers. Maybe some new arrivals. Now, imagine if every customer saw products that were specifically chosen because based on everything we know about them, they’d probably like it.
That’s a recommendation engine. And yeah, it sounds straightforward. In practice, it’s not. I worked with a fashion store. They were selling well enough, but their average customer bought one item per visit. Sometimes two. I kept thinking this person likes this style, why aren’t we showing them other things they’d probably like?
So we built a recommendation system. Nothing fancy. We looked at what similar customers bought. We looked at product attributes. We showed recommendations on the product page and in emails. Three months in? Their average order value went up 28%. That’s not a small number.
But here’s the tricky part that nobody talks about: the recommendations have to actually make sense. If you’re showing things that feel random, people ignore them. We spent almost as much time tuning what gets recommended as we did building the recommendation engine.
Knowing What to Stock
This one saved a company I worked with an absolutely stupid amount of money. They sold outdoor gear. Tents, backpacks, sleeping bags, that kind of thing. Seasonal demand is huge. Summer gear sells in spring. Winter gear sells in fall. And they were basically guessing.
Their approach was “let’s order what we sold last year plus 20%.” Sometimes that worked. Sometimes they had $200K in excess inventory of sleeping bags in July.
We built a demand forecasting model. Sounds fancy, right? Really what it does is look at historical patterns, account for seasonality, look at what people are searching for, what people are talking about online, and make an educated guess about what’s going to sell.
It’s not perfect. But it’s better than guessing. After the first year, they reduced excess inventory by about 22%. Which is huge. That’s money sitting in a warehouse that’s now freed up. Or more importantly, it’s money they can use to stock more of the things that are actually selling.
The secondary benefit? Fewer stockouts. So you’re not in the position of “that item sold out, sorry.” You have what customers want.
Know About Why Some Customers Leave (And Some Stay)
I’ve never understood why more people don’t care about churn. You’re focused on getting new customers. But the ones you already have? They’re worth so much more than new customers. We looked at a company’s customer data. On the surface, they had a pretty healthy customer base. Good retention.
But when we actually looked closely? There was a subset of customers about 8% of the base who were buying high-value items but leaving after one purchase. 67% churn rate. Meanwhile, another group was buying lower-value stuff but staying around. 94% came back. The obvious play is “focus on the high-value customers.”
But we looked deeper. Why were they leaving? Turns out, after they bought expensive items, they weren’t getting any follow-up. No support. No check-in. No recommendations on complementary products. They felt like they’d been abandoned.
So we changed the approach. We identified these customers early. We assigned them account managers. We sent personalized follow-ups. We made sure they felt taken care of. Their churn dropped from 67% to 23%. That’s a massive improvement, right? And it came from actually understanding the data, not just guessing.
Pricing (And Why “Always Lower” Isn’t Actually the Answer)
People get weird about dynamic pricing. They think it means “charge different people different prices.” And yeah, technically that’s true, but that’s not the whole story. What we actually do: look at demand. Look at inventory levels. Look at what competitors are charging. Look at what each product can probably sell for. And optimize price to maximize revenue while keeping customers happy.
I worked with an electronics store. They were using a pricing strategy that was basically “check what competitors charge, undercut them by 10%.” That’s… not smart. You’re basically racing to the bottom.
We implemented a dynamic pricing model. It looked at historical demand patterns, current inventory, competitor pricing, and customer behavior. For each product, it suggested the best price given current conditions. In three months, total revenue went up 12%. Same traffic. Same customers. Just smarter pricing.
The key part that actually matters? Customers didn’t feel ripped off. Why? Because the algorithm wasn’t being greedy. It was being smart about it. If inventory was high, prices went down to clear it. If inventory was low, prices went up. If a competitor was way cheaper, we matched them. It made sense.
Not Getting Scammed (And Protecting Your Customers Too)
Fraud is real. Chargebacks, stolen cards, account takeovers. It costs e-commerce companies billions annually. Traditional approach is rules. If a customer in Canada makes a purchase in Japan in two minutes, block it.
That works for obvious stuff. But actual fraudsters? They’re more sophisticated. We implemented ML-based fraud detection for a company. The system learns what “normal” looks like for transactions, then flags things that are weird.
But here’s what’s interesting: it’s not just about catching fraud. It’s about not blocking legitimate customers. A rule-based system flags a lot of false positives. Someone traveling for work? Might get blocked. Someone with a new card? Might get blocked.
An ML system understands context better. It catches more fraud while blocking fewer legitimate transactions. One company reduced actual fraud by 45% while reducing false positives by 30%. That’s real money. Fewer chargebacks. Fewer frustrated customers.
Customer Service That Doesn’t Suck
I’m not going to pretend chatbots are perfect. They’re not. But they’re gotten better. Way better. What we’ve done is use AI to handle the stuff that’s genuinely boring and repetitive. “Where’s my order?” “How do I return this?” “Do you have this in a different size?”
And then route the complicated stuff to actual humans. Returns with issues. Problems that need creative solutions. Angry customers. The impact? Your human customer service people actually have time to help people, instead of answering the same questions fifty times a day. And customers get faster responses because the system is handling the volume.
One company cut support response time from 4 hours to 5 minutes for 70% of inquiries. And customer satisfaction went up because people felt taken care of.
Here’s How We Actually Do This
Everyone wants to jump straight to “build the AI model.” That’s the fun part. But there’s a ton of work before that even makes sense.
First: Figure Out If You Even Have the Right Data
Before I recommend anything, I ask: “Where does your data live?” Usually people point me to their database. Then their Google Analytics. Then their email platform. Then their payment processor. It’s scattered everywhere.
And it’s messy. Missing values. Inconsistent formatting. Customer IDs that don’t match across systems. Dates in different formats.
One company I worked with had customer records duplicated in multiple places. The same customer had three different IDs depending on which system you looked at. Try building ML on top of that. So the first thing you do is audit. Where is everything? How complete is it? How clean is it?
This is boring work. But I’m going to be honest with you: if you skip this, everything else is garbage. You’ll build a beautiful model that works perfectly on clean test data, then it hits production and falls apart. I usually spend 3-4 weeks just understanding data before recommending any ML work.
Second: Get Your Infrastructure Sorted
You can’t just build a model in a spreadsheet and expect it to work. Well, you can, but it won’t scale. If you’re on Shopify, you can pipe data to BigQuery. If you built your own system, you need something to centralize data. AWS S3 plus Redshift. Or BigQuery. Or Snowflake. Or several other options.
You need a data pipeline. Which sounds fancy. It’s not. It just means: automated processes that move data from where it is to where it needs to be, regularly, reliably, in a clean format. One company I worked with didn’t have this. Every month, someone manually exported data from their systems, cleaned it in Excel, and put it in a shared Google Drive folder.
When we said “let’s automate this,” they looked relieved. Because they knew it was ridiculous. This infrastructure stuff costs money. Real money. For a mid-sized business, $15K-$50K to set up properly. But you only set it up once. Then you build everything else on top of it.
Third: Start Small and Actually Measure Something
People want to jump to “build the perfect recommendation engine” or “implement full dynamic pricing.”
I always recommend starting smaller. Pick one thing. Something you can build and test in 2-3 months. Something where you can actually measure if it worked.
One of the things I always recommend first is demand forecasting for key products. Why? Because it’s relatively straightforward. You have historical sales data. You can test the model against past data. And the business impact is clear: less excess inventory or fewer stockouts.
We build the model. We test it against historical data. We see if it would have made better decisions. Then we run it live for a month and see if it actually works. Usually? It does. And it gives the company confidence. Which is important. Because building ML is actually a cultural thing, not just a technical thing. People need to believe in it.
Fourth: Get It Running, Then Keep It Running
Building the model is maybe 30% of the work. Getting it into production and keeping it running is 70%. You need the system to run automatically. To check if the new model is actually better than the old one. To send alerts if something’s wrong. To log what happened so you can debug later.
Most companies hire engineers for this phase. Sometimes one person. Sometimes a small team. Depends on complexity.
I’ve seen teams build beautiful models that looked perfect, then they took a week to implement in production because they didn’t think through monitoring, versioning, rollback capabilities, etc.
Fifth: Actually Look at What’s Happening
After you deploy, you need to watch it. Is it working? Are customers using it? Are you getting the business outcome you expected? At a company that implemented recommendations, they saw increased engagement with recommendations (people clicking on them). But they weren’t translating to more sales as much as expected.
Why? Because the recommendations were technically correct but didn’t feel intuitive. If you bought a blue t-shirt, the system would sometimes recommend other t-shirts in completely different styles because the AI learned you liked cotton. But that’s not actually what humans wanted.
So we adjusted. We added more weight to style consistency. Recommendations went down slightly (fewer of them), but conversion on those recommendations went way up. That’s the iterative process. Build something. See what happens. Adjust. Repeat.
The Stuff That Actually Goes Wrong
I want to be honest about the problems because nobody talks about them until you’re in the middle of them.
Your data is going to be worse than you think. I’ve never worked on a project where the data was as clean and complete as the business owner thought. There are always missing values. Always weird edge cases. Always things that don’t make sense until someone explains the history of how the system was built.
Budget extra time for this. Seriously.
You might not have enough data. If you’re newer to e-commerce, you might not have a year or two of historical data. In that case, you have options (transfer learning, synthetic data, starting simple), but you have to know this going in.
Finding someone who actually knows how to do this is hard. Good ML engineers are rare and expensive. You have options: hire a consultant to get you started, use managed services that do a lot of the work for you, or bring on a junior engineer and have them learn while doing it.
Nobody will care as much as you do. You’re excited about the model. Your engineering team understands it. But the business stakeholders? They just want to know: did revenue go up or down? Make sure you can answer that question clearly.
Models get worse over time. You build a model. It works great for three months. Then you notice it’s not working as well. This happens because the real world changed. Customer behavior shifted. Seasonality is different. Competition changed.
You need to retrain models regularly. Automate this if possible.
Privacy is actually important. If you’re collecting customer data, you need to actually think about privacy. Not as a box to check, but as something that matters. GDPR, CCPA, and other regulations exist for a reason. Build compliance in from the start, not as an afterthought.
People get uncomfortable with algorithms making decisions. If you’re using dynamic pricing and customers feel like they’re being charged more than other people, they’ll get upset. If you’re filtering out certain customers from seeing certain products, that could be problematic. Think through the ethics of what you’re building.
Tools and Platforms
There are a lot of options now. Honestly too many. Here’s what I actually recommend:
If you want to build custom stuff: Python (scikit-learn, TensorFlow, PyTorch), hosted on AWS or Google Cloud. This gives you flexibility and control. It also means you need people who know how to use these tools.
If you want managed services: AWS SageMaker, Google Vertex AI, or Azure ML. These handle infrastructure so your team can focus on building models. Good middle ground.
If you want done-for-you solutions: There are specialized platforms for different problems. Lokad for demand forecasting. Forter for fraud detection. Klaviyo for customer segmentation. These are plug-and-play. You don’t need data scientists. Tradeoff is less customization.
Honest take on build vs. buy: If a solution exists that does what you need, buy it. You’ll move faster. If what you need is custom or specialized to your business, build it. Most healthy companies use both.
What’s Actually Happening Now (2026 Stuff)
The space is changing. Generative AI is becoming normal. Most e-commerce companies will have some AI involved in product descriptions, customer service, marketing copy. The question won’t be “should we use AI?” It’ll be “how do we use it responsibly?”
Autonomous marketing is getting real. Not just “set it and forget it” but actual AI systems managing marketing operations. Still early, but coming.
Privacy is becoming a bigger deal. Regulations are tightening. Federated learning and other privacy-preserving techniques are moving from research to practice. This matters because you can still leverage customer data without centralizing all of it.
Real-time personalization at scale is becoming the minimum expectation. Pricing, offers, content, recommendations everything tailored to each customer. The supply chain is being optimized end-to-end. Not just your warehouse but your entire logistics network.
The companies winning aren’t the ones with the most advanced technology. They’re the ones who understand their business deeply and use AI to solve real problems.
If You’re Going to Do This, Here’s What I’d Actually Do
Right now, this quarter: Figure out where your pain is. Is it inventory? Churn? Pricing? Customer acquisition? Pick one thing that’s costing you real money.
Next quarter: Get your data sorted. Build the infrastructure. Understand what you’re working with. This isn’t glamorous but it matters.
Quarter after that: Build something small and real. Not a proof of concept on clean test data. Actually implement something and see if it changes your business.
Then: Learn from it. Double down on what works. Fix what doesn’t.
Don’t try to do everything at once. Don’t believe anyone who promises magic. Don’t hire a consultant who wants to charge you six figures without understanding your business first. Build something real. Measure it carefully. Iterate.
My Last Thing
I’ve been doing this for a decade. I’ve seen this work incredibly well. I’ve seen it fail spectacularly. The difference? The ones that win understand that machine learning is just a tool. It’s not magic. It’s not going to solve problems you don’t actually understand. It won’t fix bad data. It won’t work if nobody’s using it.
But when you apply it correctly? When you solve a real problem with real data and actually care about the result? It’s genuinely powerful. Your competitors are already doing this. Maybe not all of them, but enough. The gap between companies that leverage this stuff well and companies that don’t is real and it’s growing.
If you’re going to do it, start now. Start small. Start with something real. And if you get stuck or you’re not sure where to start? That’s normal. This is new for most people. Just make sure you’re solving a problem you actually understand. That’s it. That’s my advice.
