Skip to content

Use inline training data in generated Console Project file. #4907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

LittleLittleCloud
Copy link
Contributor

@LittleLittleCloud LittleLittleCloud commented Mar 3, 2020

Code Sample

// This file was auto-generated by ML.NET Model Builder. 

using System;
using SampleRecommendation.Model;

namespace SampleRecommendation.ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create single instance of sample data from first line of dataset for model input
            ModelInput sampleData = new ModelInput()
            {
                UserId = 1,
                MovieId = 1,
                Timestamp = 9.649827E+08F,
            };

            // Make a single prediction on the sample data and print results
            var predictionResult = ConsumeModel.Predict(sampleData);

            Console.WriteLine("Using model to make single prediction -- Comparing actual Rating with predicted Rating from sample data...\n\n");
            Console.WriteLine($"userId: {sampleData.UserId}");
            Console.WriteLine($"movieId: {sampleData.MovieId}");
            Console.WriteLine($"timestamp: {sampleData.Timestamp}");
            Console.WriteLine($"\n\nActual Rating: {sampleData.Rating} \nPredicted Rating: {predictionResult.Score}\n\n");
            Console.WriteLine("=============== End of process, hit any key to finish ===============");
            Console.ReadKey();
        }
    }
}

Fix issue

@LittleLittleCloud LittleLittleCloud added the AutoML.NET Automating various steps of the machine learning process label Mar 3, 2020
@LittleLittleCloud LittleLittleCloud requested a review from a team as a code owner March 3, 2020 00:41
@@ -18,6 +18,7 @@ internal class MatrixFactorizationExtension : ITrainerExtension
options.LabelColumnName = columnInfo.LabelColumnName;
options.MatrixColumnIndexColumnName = columnInfo.UserIdColumnName;
options.MatrixRowIndexColumnName = columnInfo.ItemIdColumnName;
options.Quiet = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for quite the verbose output from MatrixFactorization trainer

INT = 2,
DOUBLE = 1.2,
FLOAT = 1.223E+10F,
TrickySTR = "ab\"\';@#$%^&-++==",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some others to test:

  • Single.NaN
  • Single.PositiveInfinity
  • "" (empty string)
  • 1 (as boolean)
  • "T" (as boolean)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LittleLittleCloud LittleLittleCloud merged commit 5db5127 into dotnet:master Mar 3, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AutoML.NET Automating various steps of the machine learning process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants