machinelearning
machinelearning copied to clipboard
Legacy pipeline API needs to be loaded after subcomponent changes
Running legacy API against the new 0.6 nugets will cause "System.InvalidOperationException has been thrown". "Entry point '...' not found".
The entry points don't seem to be loaded for the pipeline and workaround is to manually load them, but the issue needs to be fixed.
I created a new project and added the 0.6 nugets then tried something like this:
using Microsoft.ML.Legacy.Models;
using Microsoft.ML.Legacy.Trainers;
using Microsoft.ML.Legacy.Transforms;
using Microsoft.ML.Legacy.Data;
using Microsoft.ML.Legacy;
using System;
using Microsoft.ML.Runtime.Api;
var pipeline = new LearningPipeline();
//var n = new Microsoft.ML.Runtime.Data.CategoricalEstimator.ColumnInfo("foo", "");
//new Microsoft.ML.Runtime.Learners.SdcaMultiClassTrainer.Arguments();
pipeline.Add(new TextLoader(dataPath).CreateFrom<HousePriceData>(useHeader: true, separator: ','));
pipeline.Add(new ColumnConcatenator(outputColumn: "NumericalFeatures",
...
"SqftLot15"));
pipeline.Add(new ColumnConcatenator(outputColumn: "CategoryFeatures",
...
"Zipcode"));
pipeline.Add(new CategoricalOneHotVectorizer("CategoryFeatures"));
pipeline.Add(new ColumnConcatenator(outputColumn: "Features",
"NumericalFeatures", "CategoryFeatures"));
pipeline.Add(new StochasticDualCoordinateAscentRegressor());
PredictionModel<HousePriceData, HousePricePrediction> model = pipeline.Train<HousePriceData, HousePricePrediction>();
note the two commented new lines. @eerhardt , @Zruty0