DJamin-2804 avatar image
0 Votes"
DJamin-2804 asked DJamin-2804 edited

Issues when retraining a model

Dear experts,

I am following the retraining page and I have issues :

1/ I am not clear about where I can find the file ?

     // Load data preparation pipeline
     ITransformer dataPrepPipeline = mlContext.Model.Load("", out dataPrepPipelineSchema);
     // Load trained model
     ITransformer trainedModel = mlContext.Model.Load("", 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 file in the output directory.
-> So I have assumed that everything goes into the 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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers