Posts

ML.NET: Sentiment Analysis with Binary Classification

Image
In this article, we will build an ASP.NET Core 10 MVC application that finds out whether a statement typed by the user is Positive or Negative . The training data comes from a SQL Server table, the model is built with ML.NET using binary classification, and the application keeps working correctly when new rows are inserted in the table while it is running. We will go step by step. First we create the database and the table. Then we create the MVC project, add the packages and write the classes one by one. After each piece of code, we will see what the code is doing. At the end we will look closely at how the application handles new rows in the table, including the Refresh model now button that has a 2 minute timer and posts to the server by itself when nobody clicks it. Figure 1: The architecture of the application. The request path is on top and the training path is below it. What is ML.NET? ML.NET is an open source and cross platform machine learning framework from Micros...

ML.NET Predictions with In-Memory Data, CSV Files and SQL Server

Image
In this article, we will see the ML.NET with the prediction implementation with In-Memory Data, CSV file data, and SQL Server. We will create one solution that has four projects. The first one, mllib , is a class library with a reusable class named DataTrainer . It takes the data, prepares the columns and trains a model. The other three projects are console applications and all of them use DataTrainer . The only thing that changes from one project to another is the place where the data comes from. mllib : class library that has the DataTrainer class. mlnetdemo : data is kept in memory in a C# list. It predicts the price of a house from its size. loadtextfiledemo : data is read from a CSV file named orders.csv. It predicts whether an order will be returned. mlnet_sql : data is read from the Sales.SalesOrderHeader table of the AdventureWorks2025 database in SQL Server. It predicts whether an order was placed online or through a reseller. What is ML.NET? ML.NET is an open sou...