Closed
Description
openedon Jul 9, 2019
I am trying to use PermutationFeatureImportance (PFI) with F# but the F# type system is not resolving ITransformer to ISingleFeaturePredictionTransformer - which is required by PFI.
I believe it is due to IPredictorProducing (and related interfaces) being marked as "internal".
F# supports explicit interfaces and maybe that is the reason for this issue.
Here is a snippet of code that shows what I am trying to do
(I am using the latest bits - v 1.2.0 at the time of this post)
let mutable schema = null
let mdl = ctx.Model.Load(@"F:\fwaris\data\t\analysis\model_cv_LightGbmBinary.bin", &schema)
let mdlt = mdl :?> TransformerChain<ITransformer>
let m1 = mdlt.LastTransformer //debugger shows it is Microsoft.ML.Data.BinaryPredictionTransformer<Microsoft.ML.IPredictorProducing<float>>
let scored = mdl.Transform(trainView)
scored.Preview()
ctx.BinaryClassification.PermutationFeatureImportance(m1 :?> _,scored)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment