Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to implement the Recommendation Engine for my project using ML.Net.
Which algorithm supports recommendation engine?
Please help me.

What I have tried:

I have tried with
public void TrainAndWrite()
     {
         var pipeLine = new LearningPipeline();
         pipeLine.Add(new Microsoft.ML.Legacy.Data.TextLoader("path").CreateFrom(useHeader: true, separator: ','));
         pipeLine.Add(new CategoricalHashOneHotVectorizer(("UserId", "UserId")));
         pipeLine.Add(new CategoricalHashOneHotVectorizer(("MovieId", "MovieId")));
         pipeLine.Add(new ColumnConcatenator("Features", "UserId", "MovieId"));
         pipeLine.Add(new FieldAwareFactorizationMachineBinaryClassifier());
         var model = pipeLine.Train();
         model.WriteAsync(@"path../../Model.zip");
         ReadAndEvaluate(model);
     }
     public void ReadAndEvaluate(PredictionModel model)
     {
         var testData = new Microsoft.ML.Legacy.Data.TextLoader("").CreateFrom(useHeader: true, separator: ',');
         model = PredictionModel.ReadAsync(@"path../../Model.zip").Result;
         var alogEvalutate = new BinaryClassifierEvaluator();
         alogEvalutate.Evaluate(model, testData);
         Predict(model);
     }
     public void Predict(PredictionModel model)
     {
         model.Predict(new InputDetails());
     }
Posted
Comments
ZurdoDev 3-Dec-18 9:36am    
Member 10318092 4-Dec-18 10:16am    
I have developed using ML.Net.
ZurdoDev 4-Dec-18 10:27am    
And?
Member 10318092 4-Dec-18 10:34am    
using Microsoft.ML.Legacy;
using Microsoft.ML.Legacy.Trainers;
using Microsoft.ML.Legacy.Transforms;
using Microsoft.ML.Runtime.Api;

above namespaces I have used to create a recommendation engine. but I am failing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900