An open API service indexing awesome lists of open source software.

https://github.com/nishanc/ml.net-productrecommendation

This demo accompanies the tech talk "Building Intelligent Applications with ML.NET", where we explore how to use Matrix Factorization to build a product recommendation system based on co-purchase behavior.
https://github.com/nishanc/ml.net-productrecommendation

dotnet microsoft mldotnet recommendation-system

Last synced: 2 months ago
JSON representation

This demo accompanies the tech talk "Building Intelligent Applications with ML.NET", where we explore how to use Matrix Factorization to build a product recommendation system based on co-purchase behavior.

Awesome Lists containing this project

README

          

# 🧠 ML.NET Product Recommendation Demo – Co-Purchase Scenario

This demo accompanies the tech talk **"Building Intelligent Applications with ML.NET"**, where we explore how to use **Matrix Factorization** to build a **product recommendation system** based on co-purchase behavior.

---

## πŸ“Œ Scenario

Imagine you're running an e-commerce platform. You have customer purchase data and want to recommend products that are **frequently bought together** β€” even if the user hasn't seen them before.

This solution uses:
- ML.NET’s `MatrixFactorizationTrainer`
- A small sample dataset of `user_id`, `product_id`, and `Label`

---

## πŸ’‘ What You'll Learn

- Basics of Matrix Factorization for collaborative filtering
- How to implement recommendations in ML.NET
- Training a model using implicit purchase data
- Making product predictions for a given customer

---

## πŸ”§ Prerequisites

- [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download)
- Visual Studio or VS Code
- ML.NET NuGet Package:

```
dotnet add package Microsoft.ML
```

## πŸ› οΈ How to Run the Demo

1. **Clone or download the repo**.
2. Open the folder in Visual Studio or run via CLI.
3. Make sure the dataset `amazon.csv` is in the `Data/` folder.
4. Run the program:
```bash
dotnet run
```


## πŸ”— Further Reading and References

### πŸ“¦ ML.NET Samples

- πŸ”Ή [Product Recommendation - Matrix Factorization Problem Sample](https://github.com/dotnet/machinelearning-samples/tree/main/samples/csharp/getting-started/MatrixFactorization_ProductRecommendation#product-recommendation---matrix-factorization-problem-sample)
- 🎬 [Movie Recommendation - Matrix Factorization Sample 1 (Program.cs)](https://github.com/dotnet/samples/blob/main/machine-learning/tutorials/MovieRecommendation/Program.cs)
- 🎬 [Movie Recommendation - Matrix Factorization Sample 2](https://github.com/dotnet/machinelearning-samples/tree/main/samples/csharp/getting-started/MatrixFactorization_MovieRecommendation#movie-recommendation---matrix-factorization-problem-sample)

### πŸ“˜ Documentation and Tutorials

- πŸ“„ [What is ML.NET and How Does It Work?](https://learn.microsoft.com/en-us/dotnet/machine-learning/mldotnet-api)
- βš™οΈ [What is Automated Machine Learning (AutoML)?](https://learn.microsoft.com/en-us/dotnet/machine-learning/automated-machine-learning-mlnet)
- πŸ› οΈ [ML.NET AutoML Model Builder (Step-by-Step Walkthrough)](https://blog.nishanc.com/2023/08/mlnet-automl-model-builder-step-by-step.html)
- πŸš€ [Deploy a Model in an ASP.NET Core Web API](https://learn.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/serve-model-web-api-ml-net)

### πŸ“Š Data & Research

- πŸ›’ [Amazon Sales Dataset (Kaggle)](https://www.kaggle.com/datasets/karkavelrajaj/amazon-sales-dataset?resource=download)
- πŸ“‘ [Machine Learning at Microsoft with ML.NET (Research Paper)](https://arxiv.org/pdf/1905.05715)

### πŸ€– Ecosystem & Showcase

- 🌐 [Open Neural Network Exchange (ONNX)](https://onnx.ai/)
- 🏒 [Artificial Intelligence & ML Customer Showcase (Microsoft)](https://dotnet.microsoft.com/en-us/platform/customers/machinelearning-ai)