You want to predict movie ratings, so the rating column is the Label. In machine learning, the columns that are used to make a prediction are called Features, and the column with the returned prediction is called the Label. In the *.csv files, there are four columns: It's common to have an 80/20 split with Train and Test data.īelow is a preview of the data from your *.csv files: The Test data is used to make predictions with your trained model and evaluate model performance. The Train data is used to fit your model. The recommendation ratings data is split into Train and Test datasets. The first step in the ML.NET process is to prepare and load your model training and testing data. Under Advanced, change the value of Copy to Output Directory to Copy if newer. In Solution Explorer, right-click each of the *.csv files and select Properties. Make sure you either save the *.csv files to the Data folder, or after you save it elsewhere, move the *.csv files to the Data folder. Right click on recommendation-ratings-test.csv and select "Save Link (or Target) As." Right click on recommendation-ratings-train.csv and select "Save Link (or Target) As." Repeat these steps for Microsoft.ML.Recommender.Īdd the following using statements at the top of your Program.cs file: using Microsoft.ML ĭownload the two datasets and save them to the Data folder you previously created: Select the OK button on the Preview Changes dialog and then select the I Accept button on the License Acceptance dialog if you agree with the license terms for the packages listed. Choose "" as the Package source, select the Browse tab, search for Microsoft.ML, select the package in the list, and select the Install button. In Solution Explorer, right-click the project and select Manage NuGet Packages. This sample uses the latest stable version of the NuGet packages mentioned unless otherwise stated. Install the Microsoft.ML and Microsoft.ML.Recommender NuGet Packages: In Solution Explorer, right-click the project and select Add > New Folder. Click the Create button.Ĭreate a directory named Data in your project to store the data set: Create a console application Create a projectĬreate a C# Console Application called "MovieRecommender". There are several ways to approach recommendation problems, such as recommending a list of movies or recommending a list of related products, but in this case you will predict what rating (1-5) a user will give to a particular movie and recommend that movie if it's higher than a defined threshold (the higher the rating, the higher the likelihood of a user liking a particular movie). Select the appropriate machine learning task You will use the following steps to accomplish your task, as well as any other ML.NET task: You can find the source code for this tutorial at the dotnet/samples repository.
0 Comments
Leave a Reply. |