dotnet / dotnet/machinelearning
Can't pass TransformerChain to AnomalyDetection.ChangeModelThreshold
- Dominant language
- C#
- Stars
- 9.4k
- Forks
- 2k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 11
Description
ML.NET v1.3.1
[AnomalyDetectionCatalog.ChangeModelThreshold](https://github.com/dotnet/machinelearning/blob/master/src/Microsoft.ML.Data/TrainCatalog.cs#L715-L721) was [added](https://github.com/dotnet/machinelearning/pull/4039) to fix issue [3990](https://github.com/dotnet/machinelearning/issues/3990). However, I believe it should also support passing in an `ITransformerChain` where the LastTransformer is a `AnomalyPredictionTransformer` in addition to a single `AnomalyPredictionTransformer`.
Because `ChangeModelThreshold` must be [called after](https://github.com/dotnet/machinelearning/blob/master/test/Microsoft.ML.Tests/AnomalyDetectionTests.cs#L197-L199) `Fit`, in most real-world scenarios users will likely have a [`TransformerChain` instead of a single `ITransformer`](https://github.com/dotnet/machinelearning-samples/blob/master/samples/csharp/getting-started/AnomalyDetection_CreditCardFraudDetection/CreditCardFraudDetection.Trainer/Program.cs#L143). But as `ChangeModelThreshold` is currently implemented, it can't be used in this context.
Contributor guide
Assessment
This issue has not been assessed yet.