I'm getting an InvalidCastException on the following line, when using the code unmodified from this documentation:
LinearRegressionModelParameters originalModelParameters =
((ISingleFeaturePredictionTransformer<object>)trainedModel).Model as LinearRegressionModelParameters;
The full exception message is:
System.InvalidCastException: 'Unable to cast object of type 'Microsoft.ML.Data.TransformerChain`1[Microsoft.ML.ITransformer]' to type 'Microsoft.ML.ISingleFeaturePredictionTransformer`1[System.Object]'.'
I'm using Microsoft.ML v1.4.0 in a .Net Core 2.1 console app.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I'm getting an
InvalidCastExceptionon the following line, when using the code unmodified from this documentation:The full exception message is:
I'm using Microsoft.ML v1.4.0 in a .Net Core 2.1 console app.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.