I have the same problem!
Issues when retraining a model
Dear experts,
I am following the retraining page and I have issues :
https://learn.microsoft.com/fr-fr/dotnet/machine-learning/how-to-guides/retrain-model-ml-net
1/ I am not clear about where I can find the data_prep_pipeline.zip file ?
// Load data preparation pipeline
ITransformer dataPrepPipeline = mlContext.Model.Load("data_preparation_pipeline.zip", out dataPrepPipelineSchema);
// Load trained model
ITransformer trainedModel = mlContext.Model.Load("ogd_model.zip", out modelSchema);
I have performed training by doing Add/Machine Learning and following the clickable steps.
Then after testing step, I have saved the project and I can only find the model.zip file in the output directory.
-> So I have assumed that everything goes into the model.zip file. And I have used the "ITransformer trainedModel" as "ITransformer dataPrepPipeline".
2/ The line :
LinearRegressionModelParameters originalModelParameters =
((ISingleFeaturePredictionTransformer<object>)trainedModel).Model as LinearRegressionModelParameters;
returns the following error :
System.InvalidCastException : 'Unable to cast object of type 'Microsoft.ML.Data.TransformerChain`1[Microsoft.ML.ITransformer]' to type 'Microsoft.ML.ISingleFeaturePredictionTransformer`1
How can I solve this?
I hope that someone can help me.
Best regards,
David Jamin