From 06c00efdd5a973ae5bdeb82a3661c05c1476d68d Mon Sep 17 00:00:00 2001 From: Shenguito Date: Wed, 2 Oct 2019 18:12:40 +0100 Subject: [PATCH] Add generic test for classify method of concrete openml providers The method classify was returning opposite value in the feedzai/openml-java project. In order to improve UTs, the method AbstractProviderModelBaseTest#classifyIndexOfMaxScoresValue() was added in order to test the method #classify for all the providers. --- .../openml/model/ClassificationMLModel.java | 5 +++++ .../AbstractProviderModelBaseTest.java | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/openml-api/src/main/java/com/feedzai/openml/model/ClassificationMLModel.java b/openml-api/src/main/java/com/feedzai/openml/model/ClassificationMLModel.java index da64833..b8bd74b 100644 --- a/openml-api/src/main/java/com/feedzai/openml/model/ClassificationMLModel.java +++ b/openml-api/src/main/java/com/feedzai/openml/model/ClassificationMLModel.java @@ -42,7 +42,12 @@ public interface ClassificationMLModel extends MachineLearningModel { * @param instance The {@link Instance} to be classified. * @return The index of the class nominal value according to the {@link DatasetSchema} * provided during training of the model. + * + * @deprecated The idea is to classify the biggest value of the class probabilities distribution obtained from #getClassDistribution(), + * We no longer need this because we can just obtain the biggest value from the class probabilities distribution itself. + * */ + @Deprecated int classify(Instance instance); } diff --git a/openml-utils/src/test/java/com/feedzai/openml/util/provider/AbstractProviderModelBaseTest.java b/openml-utils/src/test/java/com/feedzai/openml/util/provider/AbstractProviderModelBaseTest.java index adc694b..244396b 100644 --- a/openml-utils/src/test/java/com/feedzai/openml/util/provider/AbstractProviderModelBaseTest.java +++ b/openml-utils/src/test/java/com/feedzai/openml/util/provider/AbstractProviderModelBaseTest.java @@ -78,6 +78,28 @@ public abstract class AbstractProviderModelBaseTest