machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

Legacy pipeline API needs to be loaded after subcomponent changes

Open shauheen opened this issue 8 years ago • 0 comments

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

shauheen avatar Sep 26 '18 20:09 shauheen