diff --git a/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_array.hpp b/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_array.hpp index ce0d83ec5b..e06502aaa4 100644 --- a/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_array.hpp +++ b/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_array.hpp @@ -10,7 +10,8 @@ /** * An one-dimensional sparse vector that stores a fixed number of elements, consisting of an index and a value, in a - * C-contiguous array. + * C-contiguous array. Such a vector is similar to a `SparseArraysVector`, but uses a single array for storing the + * indices and values. * * @tparam T The type of the data that is stored in the vector */ diff --git a/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_arrays.hpp b/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_arrays.hpp new file mode 100644 index 0000000000..464ed11cea --- /dev/null +++ b/cpp/subprojects/common/include/mlrl/common/data/vector_sparse_arrays.hpp @@ -0,0 +1,109 @@ +/* + * @author Michael Rapp (michael.rapp.ml@gmail.com) + */ +#pragma once + +#include "mlrl/common/data/vector_dense.hpp" + +/** + * An one-dimensional sparse vector that stores a fixed number of elements, consisting of an index and a value, in + * C-contiguous arrays. Such a vector is similar to a `SparseArrayVector`, but uses separate arrays for storing the + * indices and values. + * + * @tparam T The type of the data that is stored in the vector + */ +template +class MLRLCOMMON_API SparseArraysVector : public IOneDimensionalView { + private: + + DenseVector indices_; + + DenseVector values_; + + public: + + /** + * @param numElements The number of elements in the vector + */ + SparseArraysVector(uint32 numElements); + + virtual ~SparseArraysVector() override {}; + + /** + * An iterator that provides access to the indices in the vector and allows to modify them. + */ + typedef DenseVector::iterator index_iterator; + + /** + * An iterator that provides read-only access to the indices in the vector. + */ + typedef DenseVector::const_iterator index_const_iterator; + + /** + * An iterator that provides access to the values in the vector and allows to modify them. + */ + typedef typename DenseVector::iterator value_iterator; + + /** + * An iterator that provides read-only access to the values in the vector. + */ + typedef typename DenseVector::const_iterator value_const_iterator; + + /** + * Returns an `index_iterator` to the beginning of the indices in the vector. + * + * @return An `index_iterator` to the beginning + */ + index_iterator indices_begin(); + + /** + * Returns an `index_iterator` to the end of the indices in the vector. + * + * @return An `index_iterator` to the end + */ + index_iterator indices_end(); + + /** + * Returns an `index_const_iterator` to the beginning of the indices in the vector. + * + * @return An `index_const_iterator` to the beginning + */ + index_const_iterator indices_cbegin() const; + + /** + * Returns an `index_const_iterator` to the end of the indices in the vector. + * + * @return An `index_const_iterator` to the end + */ + index_const_iterator indices_cend() const; + + /** + * Returns a `value_iterator` to the beginning of the values in the vector. + * + * @return A `value_iterator` to the beginning + */ + value_iterator values_begin(); + + /** + * Returns a `value_iterator` to the end of the values in the vector. + * + * @return A `value_iterator` to the end + */ + value_iterator values_end(); + + /** + * Returns a `value_const_iterator` to the beginning of the values in the vector. + * + * @return A `value_const_iterator` to the beginning + */ + value_const_iterator values_cbegin() const; + + /** + * Returns a `value_const_iterator` to the end of the values in the vector. + * + * @return A `value_const_iterator` to the end + */ + value_const_iterator values_cend() const; + + uint32 getNumElements() const override; +}; diff --git a/cpp/subprojects/common/include/mlrl/common/input/feature_type.hpp b/cpp/subprojects/common/include/mlrl/common/input/feature_type.hpp index e1960f7524..ed06ffb052 100644 --- a/cpp/subprojects/common/include/mlrl/common/input/feature_type.hpp +++ b/cpp/subprojects/common/include/mlrl/common/input/feature_type.hpp @@ -11,6 +11,13 @@ class IFeatureType { virtual ~IFeatureType() {}; + /** + * Returns whether the feature is ordinal or not. + * + * @return True, if the feature is ordinal, false otherwise + */ + virtual bool isOrdinal() const = 0; + /** * Returns whether the feature is nominal or not. * diff --git a/cpp/subprojects/common/include/mlrl/common/input/feature_type_nominal.hpp b/cpp/subprojects/common/include/mlrl/common/input/feature_type_nominal.hpp index 01afab2032..168d04ec13 100644 --- a/cpp/subprojects/common/include/mlrl/common/input/feature_type_nominal.hpp +++ b/cpp/subprojects/common/include/mlrl/common/input/feature_type_nominal.hpp @@ -11,5 +11,7 @@ class NominalFeatureType final : public IFeatureType { public: + bool isOrdinal() const override; + bool isNominal() const override; }; diff --git a/cpp/subprojects/common/include/mlrl/common/input/feature_type_numerical.hpp b/cpp/subprojects/common/include/mlrl/common/input/feature_type_numerical.hpp index 09eb1ab77d..f8bd0eccb6 100644 --- a/cpp/subprojects/common/include/mlrl/common/input/feature_type_numerical.hpp +++ b/cpp/subprojects/common/include/mlrl/common/input/feature_type_numerical.hpp @@ -11,5 +11,7 @@ class NumericalFeatureType final : public IFeatureType { public: + bool isOrdinal() const override; + bool isNominal() const override; }; diff --git a/cpp/subprojects/common/include/mlrl/common/input/feature_type_ordinal.hpp b/cpp/subprojects/common/include/mlrl/common/input/feature_type_ordinal.hpp index 811d040cf8..cb8e77152f 100644 --- a/cpp/subprojects/common/include/mlrl/common/input/feature_type_ordinal.hpp +++ b/cpp/subprojects/common/include/mlrl/common/input/feature_type_ordinal.hpp @@ -11,5 +11,7 @@ class OrdinalFeatureType final : public IFeatureType { public: + bool isOrdinal() const override; + bool isNominal() const override; }; diff --git a/cpp/subprojects/common/include/mlrl/common/model/body.hpp b/cpp/subprojects/common/include/mlrl/common/model/body.hpp index d966eb0b46..05882bf82a 100644 --- a/cpp/subprojects/common/include/mlrl/common/model/body.hpp +++ b/cpp/subprojects/common/include/mlrl/common/model/body.hpp @@ -14,26 +14,15 @@ class EmptyBody; class ConjunctiveBody; /** - * Defines an interface for all classes that represent the body of a rule. + * Defines an interface for all classes that allow to check whether an example is covered or not. */ -class MLRLCOMMON_API IBody { +class MLRLCOMMON_API IConditional { public: - virtual ~IBody() {}; - - /** - * A visitor function for handling objects of the type `EmptyBody`. - */ - typedef std::function EmptyBodyVisitor; - - /** - * A visitor function for handling objects of the type `ConjunctiveBody`. - */ - typedef std::function ConjunctiveBodyVisitor; + virtual ~IConditional() {}; /** - * Returns whether an individual example, which is stored in a C-contiguous matrix, is covered by the body or - * not. + * Returns whether an individual example, which is stored in a C-contiguous matrix, is covered or not. * * @param begin A `VectorConstView::const_iterator` to the beginning of the example's feature values * @param end A `VectorConstView::const_iterator` to the end of the example's feature values @@ -43,7 +32,7 @@ class MLRLCOMMON_API IBody { VectorConstView::const_iterator end) const = 0; /** - * Returns whether an individual example, which is stored in a CSR sparse matrix, is covered by the body or not. + * Returns whether an individual example, which is stored in a CSR sparse matrix, is covered or not. * * @param indicesBegin An iterator to the beginning of the example's feature values * @param indicesEnd An iterator to the end of the example's feature values @@ -64,6 +53,25 @@ class MLRLCOMMON_API IBody { CsrConstView::value_const_iterator valuesBegin, CsrConstView::value_const_iterator valuesEnd, float32* tmpArray1, uint32* tmpArray2, uint32 n) const = 0; +}; + +/** + * Defines an interface for all classes that represent the body of a rule. + */ +class MLRLCOMMON_API IBody : public IConditional { + public: + + virtual ~IBody() override {}; + + /** + * A visitor function for handling objects of the type `EmptyBody`. + */ + typedef std::function EmptyBodyVisitor; + + /** + * A visitor function for handling objects of the type `ConjunctiveBody`. + */ + typedef std::function ConjunctiveBodyVisitor; /** * Invokes one of the given visitor functions, depending on which one is able to handle this particular type of diff --git a/cpp/subprojects/common/include/mlrl/common/model/body_conjunctive.hpp b/cpp/subprojects/common/include/mlrl/common/model/body_conjunctive.hpp index a19a13e768..5ce3924a96 100644 --- a/cpp/subprojects/common/include/mlrl/common/model/body_conjunctive.hpp +++ b/cpp/subprojects/common/include/mlrl/common/model/body_conjunctive.hpp @@ -3,6 +3,7 @@ */ #pragma once +#include "mlrl/common/data/vector_sparse_arrays.hpp" #include "mlrl/common/model/body.hpp" /** @@ -12,357 +13,632 @@ class MLRLCOMMON_API ConjunctiveBody final : public IBody { private: - const uint32 numLeq_; + /** + * A vector that stores conditions of a specific type. + * + * @tparam Threshold The type of the thresholds used by the conditions + * @tparam Compare The type of the comparator that should be used to compare thresholds to feature values + */ + template + class ConditionVector final : public SparseArraysVector, + public IConditional { + private: - uint32* leqFeatureIndices_; + Compare compare_; - float32* leqThresholds_; + public: - const uint32 numGr_; + /** + * @param numConditions The number of conditions + */ + ConditionVector(uint32 numConditions); + + /** + * @see `IConditional::covers` + */ + bool covers(VectorConstView::const_iterator begin, + VectorConstView::const_iterator end) const override; + + /** + * @see `IConditional::covers` + */ + bool covers(CsrConstView::index_const_iterator indicesBegin, + CsrConstView::index_const_iterator indicesEnd, + CsrConstView::value_const_iterator valuesBegin, + CsrConstView::value_const_iterator valuesEnd, float32* tmpArray1, + uint32* tmpArray2, uint32 n) const override; + }; + + /** + * Allows to compare numerical feature values to threshold using the <= operator. + */ + struct CompareNumericalLeq final { + public: + + /** + * Returns whether a given feature value satisfies a specific threshold or not. + * + * @param featureValue The feature value + * @param threshold The threshold + * @return True, if the feature value satisfies the threshold, false otherwise + */ + inline bool operator()(const float32& featureValue, const float32& threshold) const { + return featureValue <= threshold; + } + }; - uint32* grFeatureIndices_; + /** + * Allows to compare numerical feature values to threshold using the > operator. + */ + struct CompareNumericalGr final { + public: - float32* grThresholds_; + /** + * Returns whether a given feature value satisfies a specific threshold or not. + * + * @param featureValue The feature value + * @param threshold The threshold + * @return True, if the feature value satisfies the threshold, false otherwise + */ + inline bool operator()(const float32& featureValue, const float32& threshold) const { + return featureValue > threshold; + } + }; - const uint32 numEq_; + /** + * Allows to compare ordinal feature values to threshold using the <= operator. + */ + struct CompareOrdinalLeq final { + public: - uint32* eqFeatureIndices_; + /** + * Returns whether a given feature value satisfies a specific threshold or not. + * + * @param featureValue The feature value + * @param threshold The threshold + * @return True, if the feature value satisfies the threshold, false otherwise + */ + inline bool operator()(const float32& featureValue, const float32& threshold) const { + return featureValue <= threshold; + } + }; - float32* eqThresholds_; + /** + * Allows to compare ordinal feature values to threshold using the > operator. + */ + struct CompareOrdinalGr final { + public: + + /** + * Returns whether a given feature value satisfies a specific threshold or not. + * + * @param featureValue The feature value + * @param threshold The threshold + * @return True, if the feature value satisfies the threshold, false otherwise + */ + inline bool operator()(const float32& featureValue, const float32& threshold) const { + return featureValue > threshold; + } + }; + + /** + * Allows to compare nominal feature values to threshold using the == operator. + */ + struct CompareNominalEq final { + public: + + /** + * Returns whether a given feature value satisfies a specific threshold or not. + * + * @param featureValue The feature value + * @param threshold The threshold + * @return True, if the feature value satisfies the threshold, false otherwise + */ + inline bool operator()(const float32& featureValue, const float32& threshold) const { + return featureValue == threshold; + } + }; - const uint32 numNeq_; + /** + * Allows to compare nominal feature values to threshold using the != operator. + */ + struct CompareNominalNeq final { + public: - uint32* neqFeatureIndices_; + /** + * Returns whether a given feature value satisfies a specific threshold or not. + * + * @param featureValue The feature value + * @param threshold The threshold + * @return True, if the feature value satisfies the threshold, false otherwise + */ + inline bool operator()(const float32& featureValue, const float32& threshold) const { + return featureValue != threshold; + } + }; + + ConditionVector numericalLeqVector_; - float32* neqThresholds_; + ConditionVector numericalGrVector_; + + ConditionVector ordinalLeqVector_; + + ConditionVector ordinalGrVector_; + + ConditionVector nominalEqVector_; + + ConditionVector nominalNeqVector_; public: /** - * @param numLeq The number of conditions that use the <= operator - * @param numGr The number of conditions that use the > operator - * @param numEq The number of conditions that use the == operator - * @param numNeq The number of conditions that use the != operator + * @param numNumericalLeq The number of numerical conditions that use the <= operator + * @param numNumericalGr The number of numerical conditions that use the > operator + * @param numOrdinalLeq The number of ordinal conditions that use the <= operator + * @param numOrdinalGr The number of ordinal conditions that use the > operator + * @param numNominalEq The number of nominal conditions that use the == operator + * @param numNominalNeq The number of nominal conditions that use the != operator */ - ConjunctiveBody(uint32 numLeq, uint32 numGr, uint32 numEq, uint32 numNeq); - - ~ConjunctiveBody() override; + ConjunctiveBody(uint32 numNumericalLeq, uint32 numNumericalGr, uint32 numOrdinalLeq, uint32 numOrdinalGr, + uint32 numNominalEq, uint32 numNominalNeq); /** * An iterator that provides access to the thresholds that are used by the conditions in the body and allows to * modify them. */ - typedef float32* threshold_iterator; + typedef SparseArraysVector::value_iterator threshold_iterator; /** * An iterator that provides read-only access to the thresholds that are used by the conditions in the body. */ - typedef const float32* threshold_const_iterator; + typedef SparseArraysVector::value_const_iterator threshold_const_iterator; /** * An iterator that provides access to the feature indices that correspond to the conditions in the body and * allows to modify them. */ - typedef uint32* index_iterator; + typedef SparseArraysVector::index_iterator index_iterator; /** * An iterator that provides read-only access to the feature indices that correspond to the conditions in the * body. */ - typedef const uint32* index_const_iterator; + typedef SparseArraysVector::index_const_iterator index_const_iterator; /** - * Returns the number of conditions that use the <= operator. + * Returns the number of numerical conditions that use the <= operator. * * @return The number of conditions */ - uint32 getNumLeq() const; + uint32 getNumNumericalLeq() const; /** - * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to conditions that use the - * <= operator. + * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to numerical conditions + * that use the <= operator. * * @return A `threshold_iterator` to the beginning */ - threshold_iterator leq_thresholds_begin(); + threshold_iterator numerical_leq_thresholds_begin(); /** - * Returns a `threshold_iterator` to the end of the thresholds that correspond to conditions that use the <= - * operator. + * Returns a `threshold_iterator` to the end of the thresholds that correspond to numerical conditions that use + * the <= operator. * * @return A `threshold_iterator` to the end */ - threshold_iterator leq_thresholds_end(); + threshold_iterator numerical_leq_thresholds_end(); /** - * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to conditions that - * use the <= operator. + * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to numerical + * conditions that use the <= operator. * * @return A `threshold_const_iterator` to the beginning */ - threshold_const_iterator leq_thresholds_cbegin() const; + threshold_const_iterator numerical_leq_thresholds_cbegin() const; /** - * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to conditions that use the - * <= operator. + * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to numerical conditions + * that use the <= operator. * * @return A `threshold_const_iterator` to the end */ - threshold_const_iterator leq_thresholds_cend() const; + threshold_const_iterator numerical_leq_thresholds_cend() const; /** - * Returns an `index_iterator` to the beginning of the feature indices that correspond to conditions that use - * the <= operator. + * Returns an `index_iterator` to the beginning of the feature indices that correspond to numerical conditions + * that use the <= operator. * * @return An `index_iterator` to the beginning */ - index_iterator leq_indices_begin(); + index_iterator numerical_leq_indices_begin(); /** - * Returns an `index_iterator` to the end of the feature indices that correspond to conditions that use the <= - * operator. + * Returns an `index_iterator` to the end of the feature indices that correspond to numerical conditions that + * use the <= operator. * * @return An `index_iterator` to the end */ - index_iterator leq_indices_end(); + index_iterator numerical_leq_indices_end(); /** - * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to conditions that - * use the <= operator. + * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to numerical + * conditions that use the <= operator. * * @return An `index_const_iterator` to the beginning */ - index_const_iterator leq_indices_cbegin() const; + index_const_iterator numerical_leq_indices_cbegin() const; /** - * Returns an `index_const_iterator` to the end of the feature indices that correspond to conditions that use - * the <= operator. + * Returns an `index_const_iterator` to the end of the feature indices that correspond to numerical conditions + * that use the <= operator. * * @return An `index_const_iterator` to the end */ - index_const_iterator leq_indices_cend() const; + index_const_iterator numerical_leq_indices_cend() const; /** - * Returns the number of conditions that use the > operator. + * Returns the number of numerical conditions that use the > operator. * * @return The number of conditions */ - uint32 getNumGr() const; + uint32 getNumNumericalGr() const; /** - * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to conditions that use the - * > operator. + * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to numerical conditions + * that use the > operator. * * @return A `threshold_iterator` to the beginning */ - threshold_iterator gr_thresholds_begin(); + threshold_iterator numerical_gr_thresholds_begin(); /** - * Returns a `threshold_iterator` to the end of the thresholds that correspond to conditions that use the > - * operator. + * Returns a `threshold_iterator` to the end of the thresholds that correspond to numerical conditions that use + * the > operator. * * @return A `threshold_iterator` to the end */ - threshold_iterator gr_thresholds_end(); + threshold_iterator numerical_gr_thresholds_end(); + + /** + * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to numerical + * conditions that use the > operator. + * + * @return A `threshold_const_iterator` to the beginning + */ + threshold_const_iterator numerical_gr_thresholds_cbegin() const; + + /** + * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to numerical conditions + * that use the > operator. + * + * @return A `threshold_const_iterator` to the end + */ + threshold_const_iterator numerical_gr_thresholds_cend() const; + + /** + * Returns an `index_iterator` to the beginning of the feature indices that correspond to numerical conditions + * that use the > operator. + * + * @return An `index_iterator` to the beginning + */ + index_iterator numerical_gr_indices_begin(); /** - * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to conditions that + * Returns an `index_iterator` to the end of the feature indices that correspond to numerical conditions that * use the > operator. * + * @return An `index_iterator` to the end + */ + index_iterator numerical_gr_indices_end(); + + /** + * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to numerical + * conditions that use the > operator. + * + * @return An `index_const_iterator` to the beginning + */ + index_const_iterator numerical_gr_indices_cbegin() const; + + /** + * Returns an `index_const_iterator` to the end of the feature indices that correspond to numerical conditions + * that use the > operator. + * + * @return An `index_const_iterator` to the end + */ + index_const_iterator numerical_gr_indices_cend() const; + + /** + * Returns the number of ordinal conditions that use the <= operator. + * + * @return The number of conditions + */ + uint32 getNumOrdinalLeq() const; + + /** + * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to ordinal conditions that + * use the <= operator. + * + * @return A `threshold_iterator` to the beginning + */ + threshold_iterator ordinal_leq_thresholds_begin(); + + /** + * Returns a `threshold_iterator` to the end of the thresholds that correspond to ordinal conditions that use + * the <= operator. + * + * @return A `threshold_iterator` to the end + */ + threshold_iterator ordinal_leq_thresholds_end(); + + /** + * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to ordinal conditions + * that use the <= operator. + * * @return A `threshold_const_iterator` to the beginning */ - threshold_const_iterator gr_thresholds_cbegin() const; + threshold_const_iterator ordinal_leq_thresholds_cbegin() const; /** - * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to conditions that use the - * > operator. + * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to ordinal conditions that + * use the <= operator. * * @return A `threshold_const_iterator` to the end */ - threshold_const_iterator gr_thresholds_cend() const; + threshold_const_iterator ordinal_leq_thresholds_cend() const; /** - * Returns an `index_iterator` to the beginning of the feature indices that correspond to conditions that use - * the > operator. + * Returns an `index_iterator` to the beginning of the feature indices that correspond to ordinal conditions + * that use the <= operator. * * @return An `index_iterator` to the beginning */ - index_iterator gr_indices_begin(); + index_iterator ordinal_leq_indices_begin(); /** - * Returns an `index_iterator` to the end of the feature indices that correspond to conditions that use the > - * operator. + * Returns an `index_iterator` to the end of the feature indices that correspond to ordinal conditions that use + * the <= operator. * * @return An `index_iterator` to the end */ - index_iterator gr_indices_end(); + index_iterator ordinal_leq_indices_end(); /** - * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to conditions that - * use the > operator. + * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to ordinal + * conditions that use the <= operator. * * @return An `index_const_iterator` to the beginning */ - index_const_iterator gr_indices_cbegin() const; + index_const_iterator ordinal_leq_indices_cbegin() const; /** - * Returns an `index_const_iterator` to the end of the feature indices that correspond to conditions that use - * the > operator. + * Returns an `index_const_iterator` to the end of the feature indices that correspond to ordinal conditions + * that use the <= operator. * * @return An `index_const_iterator` to the end */ - index_const_iterator gr_indices_cend() const; + index_const_iterator ordinal_leq_indices_cend() const; /** - * Returns the number of conditions that use the == operator. + * Returns the number of ordinal conditions that use the > operator. * * @return The number of conditions */ - uint32 getNumEq() const; + uint32 getNumOrdinalGr() const; /** - * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to conditions that use the - * == operator. + * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to ordinal conditions that + * use the > operator. * * @return A `threshold_iterator` to the beginning */ - threshold_iterator eq_thresholds_begin(); + threshold_iterator ordinal_gr_thresholds_begin(); /** - * Returns a `threshold_iterator` to the end of the thresholds that correspond to conditions that use the == - * operator. + * Returns a `threshold_iterator` to the end of the thresholds that correspond to ordinal conditions that use + * the > operator. * * @return A `threshold_iterator` to the end */ - threshold_iterator eq_thresholds_end(); + threshold_iterator ordinal_gr_thresholds_end(); /** - * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to conditions that - * use the == operator. + * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to ordinal conditions + * that use the > operator. * * @return A `threshold_const_iterator` to the beginning */ - threshold_const_iterator eq_thresholds_cbegin() const; + threshold_const_iterator ordinal_gr_thresholds_cbegin() const; /** - * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to conditions that use the - * == operator. + * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to ordinal conditions that + * use the > operator. * * @return A `threshold_const_iterator` to the end */ - threshold_const_iterator eq_thresholds_cend() const; + threshold_const_iterator ordinal_gr_thresholds_cend() const; /** - * Returns an `index_iterator` to the beginning of the feature indices that correspond to conditions that use - * the == operator. + * Returns an `index_iterator` to the beginning of the feature indices that correspond to ordinal conditions + * that use the > operator. * * @return An `index_iterator` to the beginning */ - index_iterator eq_indices_begin(); + index_iterator ordinal_gr_indices_begin(); /** - * Returns an `index_iterator` to the end of the feature indices that correspond to conditions that use the == - * operator. + * Returns an `index_iterator` to the end of the feature indices that correspond to ordinal conditions that use + * the > operator. * * @return An `index_iterator` to the end */ - index_iterator eq_indices_end(); + index_iterator ordinal_gr_indices_end(); /** - * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to conditions that - * use the == operator. + * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to ordinal + * conditions that use the > operator. * * @return An `index_const_iterator` to the beginning */ - index_const_iterator eq_indices_cbegin() const; + index_const_iterator ordinal_gr_indices_cbegin() const; /** - * Returns an `index_const_iterator` to the end of the feature indices that correspond to conditions that use - * the == operator. + * Returns an `index_const_iterator` to the end of the feature indices that correspond to ordinal conditions + * that use the > operator. * * @return An `index_const_iterator` to the end */ - index_const_iterator eq_indices_cend() const; + index_const_iterator ordinal_gr_indices_cend() const; /** - * Returns the number of conditions that use the != operator. + * Returns the number of nominal conditions that use the == operator. * * @return The number of conditions */ - uint32 getNumNeq() const; + uint32 getNumNominalEq() const; /** - * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to conditions that use the - * != operator. + * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to nominal conditions that + * use the == operator. * * @return A `threshold_iterator` to the beginning */ - threshold_iterator neq_thresholds_begin(); + threshold_iterator nominal_eq_thresholds_begin(); /** - * Returns a `threshold_iterator` to the end of the thresholds that correspond to conditions that use the != - * operator. + * Returns a `threshold_iterator` to the end of the thresholds that correspond to nominal conditions that use + * the == operator. * * @return A `threshold_iterator` to the end */ - threshold_iterator neq_thresholds_end(); + threshold_iterator nominal_eq_thresholds_end(); /** - * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to conditions that - * use the != operator. + * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to nominal conditions + * that use the == operator. * * @return A `threshold_const_iterator` to the beginning */ - threshold_const_iterator neq_thresholds_cbegin() const; + threshold_const_iterator nominal_eq_thresholds_cbegin() const; /** - * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to conditions that use the - * != operator. + * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to nominal conditions that + * use the == operator. * * @return A `threshold_const_iterator` to the end */ - threshold_const_iterator neq_thresholds_cend() const; + threshold_const_iterator nominal_eq_thresholds_cend() const; /** - * Returns an `index_iterator` to the beginning of the feature indices that correspond to conditions that use - * the != operator. + * Returns an `index_iterator` to the beginning of the feature indices that correspond to nominal conditions + * that use the == operator. * * @return An `index_iterator` to the beginning */ - index_iterator neq_indices_begin(); + index_iterator nominal_eq_indices_begin(); /** - * Returns an `index_iterator` to the end of the feature indices that correspond to conditions that use the != - * operator. + * Returns an `index_iterator` to the end of the feature indices that correspond to nominal conditions that use + * the == operator. * * @return An `index_iterator` to the end */ - index_iterator neq_indices_end(); + index_iterator nominal_eq_indices_end(); /** - * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to conditions that - * use the != operator. + * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to nominal + * conditions that use the == operator. * * @return An `index_const_iterator` to the beginning */ - index_const_iterator neq_indices_cbegin() const; + index_const_iterator nominal_eq_indices_cbegin() const; + + /** + * Returns an `index_const_iterator` to the end of the feature indices that correspond to nominal conditions + * that use the == operator. + * + * @return An `index_const_iterator` to the end + */ + index_const_iterator nominal_eq_indices_cend() const; + + /** + * Returns the number of nominal conditions that use the != operator. + * + * @return The number of conditions + */ + uint32 getNumNominalNeq() const; + + /** + * Returns a `threshold_iterator` to the beginning of the thresholds that correspond to nominal conditions that + * use the != operator. + * + * @return A `threshold_iterator` to the beginning + */ + threshold_iterator nominal_neq_thresholds_begin(); + + /** + * Returns a `threshold_iterator` to the end of the thresholds that correspond to nominal conditions that use + * the != operator. + * + * @return A `threshold_iterator` to the end + */ + threshold_iterator nominal_neq_thresholds_end(); + + /** + * Returns a `threshold_const_iterator` to the beginning of the thresholds that correspond to nominal conditions + * that use the != operator. + * + * @return A `threshold_const_iterator` to the beginning + */ + threshold_const_iterator nominal_neq_thresholds_cbegin() const; + + /** + * Returns a `threshold_const_iterator` to the end of the thresholds that correspond to nominal conditions that + * use the != operator. + * + * @return A `threshold_const_iterator` to the end + */ + threshold_const_iterator nominal_neq_thresholds_cend() const; /** - * Returns an `index_const_iterator` to the end of the feature indices that correspond to conditions that use + * Returns an `index_iterator` to the beginning of the feature indices that correspond to nominal conditions + * that use the != operator. + * + * @return An `index_iterator` to the beginning + */ + index_iterator nominal_neq_indices_begin(); + + /** + * Returns an `index_iterator` to the end of the feature indices that correspond to nominal conditions that use * the != operator. * + * @return An `index_iterator` to the end + */ + index_iterator nominal_neq_indices_end(); + + /** + * Returns an `index_const_iterator` to the beginning of the feature indices that correspond to nominal + * conditions that use the != operator. + * + * @return An `index_const_iterator` to the beginning + */ + index_const_iterator nominal_neq_indices_cbegin() const; + + /** + * Returns an `index_const_iterator` to the end of the feature indices that correspond to nominal conditions + * that use the != operator. + * * @return An `index_const_iterator` to the end */ - index_const_iterator neq_indices_cend() const; + index_const_iterator nominal_neq_indices_cend() const; /** - * @see `IBody::covers` + * @see `IConditional::covers` */ bool covers(VectorConstView::const_iterator begin, VectorConstView::const_iterator end) const override; /** - * @see `IBody::covers` + * @see `IConditional::covers` */ bool covers(CsrConstView::index_const_iterator indicesBegin, CsrConstView::index_const_iterator indicesEnd, diff --git a/cpp/subprojects/common/include/mlrl/common/model/condition.hpp b/cpp/subprojects/common/include/mlrl/common/model/condition.hpp index 14edb91cac..16a3923c2e 100644 --- a/cpp/subprojects/common/include/mlrl/common/model/condition.hpp +++ b/cpp/subprojects/common/include/mlrl/common/model/condition.hpp @@ -9,10 +9,12 @@ * An enum that specifies all possible types of operators used by a condition of a rule. */ enum Comparator : uint8 { - LEQ = 0, - GR = 1, - EQ = 2, - NEQ = 3 + NUMERICAL_LEQ = 0, + NUMERICAL_GR = 1, + ORDINAL_LEQ = 2, + ORDINAL_GR = 3, + NOMINAL_EQ = 4, + NOMINAL_NEQ = 5 }; /** diff --git a/cpp/subprojects/common/include/mlrl/common/model/condition_list.hpp b/cpp/subprojects/common/include/mlrl/common/model/condition_list.hpp index e8ad6dd093..25e62f4b82 100644 --- a/cpp/subprojects/common/include/mlrl/common/model/condition_list.hpp +++ b/cpp/subprojects/common/include/mlrl/common/model/condition_list.hpp @@ -18,7 +18,7 @@ class ConditionList final { std::vector vector_; - std::array numConditionsPerComparator_; + std::array numConditionsPerComparator_; public: diff --git a/cpp/subprojects/common/include/mlrl/common/model/head_complete.hpp b/cpp/subprojects/common/include/mlrl/common/model/head_complete.hpp index adee57778c..8ee0802896 100644 --- a/cpp/subprojects/common/include/mlrl/common/model/head_complete.hpp +++ b/cpp/subprojects/common/include/mlrl/common/model/head_complete.hpp @@ -3,7 +3,7 @@ */ #pragma once -#include "mlrl/common/data/types.hpp" +#include "mlrl/common/data/vector_dense.hpp" #include "mlrl/common/model/head.hpp" /** @@ -12,9 +12,7 @@ class MLRLCOMMON_API CompleteHead final : public IHead { private: - const uint32 numElements_; - - float64* scores_; + DenseVector vector_; public: @@ -23,17 +21,15 @@ class MLRLCOMMON_API CompleteHead final : public IHead { */ CompleteHead(uint32 numElements); - ~CompleteHead() override; - /** * An iterator that provides access to the scores the are contained by the head and allows to modify them. */ - typedef float64* score_iterator; + typedef DenseVector::iterator score_iterator; /** * An iterator that provides read-only access to the scores that are contained by the head. */ - typedef const float64* score_const_iterator; + typedef DenseVector::const_iterator score_const_iterator; /** * Returns the number of scores that are contained by the head. diff --git a/cpp/subprojects/common/include/mlrl/common/model/head_partial.hpp b/cpp/subprojects/common/include/mlrl/common/model/head_partial.hpp index 7d104f7904..7b6425ccf1 100644 --- a/cpp/subprojects/common/include/mlrl/common/model/head_partial.hpp +++ b/cpp/subprojects/common/include/mlrl/common/model/head_partial.hpp @@ -3,7 +3,7 @@ */ #pragma once -#include "mlrl/common/data/types.hpp" +#include "mlrl/common/data/vector_sparse_arrays.hpp" #include "mlrl/common/model/head.hpp" /** @@ -12,11 +12,7 @@ class MLRLCOMMON_API PartialHead final : public IHead { private: - const uint32 numElements_; - - float64* scores_; - - uint32* labelIndices_; + SparseArraysVector vector_; public: @@ -25,29 +21,27 @@ class MLRLCOMMON_API PartialHead final : public IHead { */ PartialHead(uint32 numElements); - ~PartialHead() override; - /** * An iterator that provides access to the scores that are contained by the head and allows to modify them. */ - typedef float64* score_iterator; + typedef SparseArraysVector::value_iterator score_iterator; /** * An iterator that provides read-only access to the scores that are contained by the head. */ - typedef const float64* score_const_iterator; + typedef SparseArraysVector::value_const_iterator score_const_iterator; /** * An iterator that provides access to the indices, the scores that are contained by the head, correspond to and * allows to modify them. */ - typedef uint32* index_iterator; + typedef SparseArraysVector::index_iterator index_iterator; /** * An iterator that provides read-only access to the indices, the scores that are contained by the head, * correspond to. */ - typedef const uint32* index_const_iterator; + typedef SparseArraysVector::index_const_iterator index_const_iterator; /** * Returns the number of scores that are contained by the head. diff --git a/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_approximate.hpp b/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_approximate.hpp index 99fdc7c067..48d608c20d 100644 --- a/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_approximate.hpp +++ b/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_approximate.hpp @@ -27,6 +27,8 @@ class ApproximateRuleRefinement final : public IRuleRefinement { const uint32 featureIndex_; + const bool ordinal_; + const bool nominal_; typedef IRuleRefinementCallback Callback; @@ -41,12 +43,13 @@ class ApproximateRuleRefinement final : public IRuleRefinement { * @param numExamples The total number of training examples with non-zero weights that are covered by the * existing rule * @param featureIndex The index of the feature, the new condition corresponds to + * @param ordinal True, if the feature at index `featureIndex` is ordinal, false otherwise * @param nominal True, if the feature at index `featureIndex` is nominal, false otherwise * @param callbackPtr An unique pointer to an object of type `IRuleRefinementCallback` that allows to * retrieve the information that is required to search for potential refinements */ ApproximateRuleRefinement(const IndexVector& labelIndices, uint32 numExamples, uint32 featureIndex, - bool nominal, std::unique_ptr callbackPtr); + bool ordinal, bool nominal, std::unique_ptr callbackPtr); void findRefinement(SingleRefinementComparator& comparator, uint32 minCoverage) override; diff --git a/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_exact.hpp b/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_exact.hpp index b436c181ce..d36d3b439c 100644 --- a/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_exact.hpp +++ b/cpp/subprojects/common/include/mlrl/common/rule_refinement/rule_refinement_exact.hpp @@ -26,6 +26,8 @@ class ExactRuleRefinement final : public IRuleRefinement { const uint32 featureIndex_; + const bool ordinal_; + const bool nominal_; const bool hasZeroWeights_; @@ -42,13 +44,14 @@ class ExactRuleRefinement final : public IRuleRefinement { * @param numExamples The total number of training examples with non-zero weights that are covered by the * existing rule * @param featureIndex The index of the feature, the new condition corresponds to + * @param ordinal True, if the feature at index `featureIndex` is ordinal, false otherwise * @param nominal True, if the feature at index `featureIndex` is nominal, false otherwise * @param hasZeroWeights True, if some training examples may have zero weights, false otherwise * @param callbackPtr An unique pointer to an object of type `IRuleRefinementCallback` that allows to * retrieve the information that is required to search for potential refinements */ - ExactRuleRefinement(const IndexVector& labelIndices, uint32 numExamples, uint32 featureIndex, bool nominal, - bool hasZeroWeights, std::unique_ptr callbackPtr); + ExactRuleRefinement(const IndexVector& labelIndices, uint32 numExamples, uint32 featureIndex, bool ordinal, + bool nominal, bool hasZeroWeights, std::unique_ptr callbackPtr); void findRefinement(SingleRefinementComparator& comparator, uint32 minCoverage) override; diff --git a/cpp/subprojects/common/meson.build b/cpp/subprojects/common/meson.build index 34d240c7ad..e4e19c0220 100644 --- a/cpp/subprojects/common/meson.build +++ b/cpp/subprojects/common/meson.build @@ -19,6 +19,7 @@ source_files = [ 'src/mlrl/common/data/vector_dok.cpp', 'src/mlrl/common/data/vector_dok_binary.cpp', 'src/mlrl/common/data/vector_sparse_array.cpp', + 'src/mlrl/common/data/vector_sparse_arrays.cpp', 'src/mlrl/common/data/view_c_contiguous.cpp', 'src/mlrl/common/data/view_csc.cpp', 'src/mlrl/common/data/view_csc_binary.cpp', diff --git a/cpp/subprojects/common/src/mlrl/common/data/vector_sparse_arrays.cpp b/cpp/subprojects/common/src/mlrl/common/data/vector_sparse_arrays.cpp new file mode 100644 index 0000000000..c966955837 --- /dev/null +++ b/cpp/subprojects/common/src/mlrl/common/data/vector_sparse_arrays.cpp @@ -0,0 +1,55 @@ +#include "mlrl/common/data/vector_sparse_arrays.hpp" + +template +SparseArraysVector::SparseArraysVector(uint32 numElements) + : indices_(DenseVector(numElements)), values_(DenseVector(numElements)) {} + +template +typename SparseArraysVector::index_iterator SparseArraysVector::indices_begin() { + return indices_.begin(); +} + +template +typename SparseArraysVector::index_iterator SparseArraysVector::indices_end() { + return indices_.end(); +} + +template +typename SparseArraysVector::index_const_iterator SparseArraysVector::indices_cbegin() const { + return indices_.cbegin(); +} + +template +typename SparseArraysVector::index_const_iterator SparseArraysVector::indices_cend() const { + return indices_.cend(); +} + +template +typename SparseArraysVector::value_iterator SparseArraysVector::values_begin() { + return values_.begin(); +} + +template +typename SparseArraysVector::value_iterator SparseArraysVector::values_end() { + return values_.end(); +} + +template +typename SparseArraysVector::value_const_iterator SparseArraysVector::values_cbegin() const { + return values_.cbegin(); +} + +template +typename SparseArraysVector::value_const_iterator SparseArraysVector::values_cend() const { + return values_.cend(); +} + +template +uint32 SparseArraysVector::getNumElements() const { + return indices_.getNumElements(); +} + +template class SparseArraysVector; +template class SparseArraysVector; +template class SparseArraysVector; +template class SparseArraysVector; diff --git a/cpp/subprojects/common/src/mlrl/common/input/feature_type_nominal.cpp b/cpp/subprojects/common/src/mlrl/common/input/feature_type_nominal.cpp index 7464d8b885..bbb52d00c2 100644 --- a/cpp/subprojects/common/src/mlrl/common/input/feature_type_nominal.cpp +++ b/cpp/subprojects/common/src/mlrl/common/input/feature_type_nominal.cpp @@ -1,5 +1,9 @@ #include "mlrl/common/input/feature_type_nominal.hpp" +bool NominalFeatureType::isOrdinal() const { + return false; +} + bool NominalFeatureType::isNominal() const { return true; } diff --git a/cpp/subprojects/common/src/mlrl/common/input/feature_type_numerical.cpp b/cpp/subprojects/common/src/mlrl/common/input/feature_type_numerical.cpp index b7208179ac..8b58664979 100644 --- a/cpp/subprojects/common/src/mlrl/common/input/feature_type_numerical.cpp +++ b/cpp/subprojects/common/src/mlrl/common/input/feature_type_numerical.cpp @@ -1,5 +1,9 @@ #include "mlrl/common/input/feature_type_numerical.hpp" +bool NumericalFeatureType::isOrdinal() const { + return false; +} + bool NumericalFeatureType::isNominal() const { return false; } diff --git a/cpp/subprojects/common/src/mlrl/common/input/feature_type_ordinal.cpp b/cpp/subprojects/common/src/mlrl/common/input/feature_type_ordinal.cpp index 39b7d914b0..a61646c9b8 100644 --- a/cpp/subprojects/common/src/mlrl/common/input/feature_type_ordinal.cpp +++ b/cpp/subprojects/common/src/mlrl/common/input/feature_type_ordinal.cpp @@ -1,5 +1,9 @@ #include "mlrl/common/input/feature_type_ordinal.hpp" +bool OrdinalFeatureType::isOrdinal() const { + return true; +} + bool OrdinalFeatureType::isNominal() const { return false; } diff --git a/cpp/subprojects/common/src/mlrl/common/model/body_conjunctive.cpp b/cpp/subprojects/common/src/mlrl/common/model/body_conjunctive.cpp index 6ff6a223ab..53feab29ed 100644 --- a/cpp/subprojects/common/src/mlrl/common/model/body_conjunctive.cpp +++ b/cpp/subprojects/common/src/mlrl/common/model/body_conjunctive.cpp @@ -1,272 +1,305 @@ #include "mlrl/common/model/body_conjunctive.hpp" -ConjunctiveBody::ConjunctiveBody(uint32 numLeq, uint32 numGr, uint32 numEq, uint32 numNeq) - : numLeq_(numLeq), leqFeatureIndices_(new uint32[numLeq_]), leqThresholds_(new float32[numLeq_]), numGr_(numGr), - grFeatureIndices_(new uint32[numGr_]), grThresholds_(new float32[numGr_]), numEq_(numEq), - eqFeatureIndices_(new uint32[numEq_]), eqThresholds_(new float32[numEq_]), numNeq_(numNeq), - neqFeatureIndices_(new uint32[numNeq_]), neqThresholds_(new float32[numNeq_]) {} +template +ConjunctiveBody::ConditionVector::ConditionVector(uint32 numConditions) + : SparseArraysVector(numConditions) {} + +template +bool ConjunctiveBody::ConditionVector::covers( + VectorConstView::const_iterator begin, VectorConstView::const_iterator end) const { + uint32 numConditions = this->getNumElements(); + typename SparseArraysVector::index_const_iterator featureIndexIterator = this->indices_cbegin(); + typename SparseArraysVector::value_const_iterator thresholdIterator = this->values_cbegin(); + + for (uint32 i = 0; i < numConditions; i++) { + uint32 featureIndex = featureIndexIterator[i]; + float32 threshold = thresholdIterator[i]; + float32 featureValue = begin[featureIndex]; + + if (!compare_(featureValue, threshold)) { + return false; + } + } -ConjunctiveBody::~ConjunctiveBody() { - delete[] leqFeatureIndices_; - delete[] leqThresholds_; - delete[] grFeatureIndices_; - delete[] grThresholds_; - delete[] eqFeatureIndices_; - delete[] eqThresholds_; - delete[] neqFeatureIndices_; - delete[] neqThresholds_; + return true; } -uint32 ConjunctiveBody::getNumLeq() const { - return numLeq_; +template +bool ConjunctiveBody::ConditionVector::covers( + CsrConstView::index_const_iterator indicesBegin, + CsrConstView::index_const_iterator indicesEnd, + CsrConstView::value_const_iterator valuesBegin, + CsrConstView::value_const_iterator valuesEnd, float32* tmpArray1, uint32* tmpArray2, uint32 n) const { + uint32 numConditions = this->getNumElements(); + typename SparseArraysVector::index_const_iterator featureIndexIterator = this->indices_cbegin(); + typename SparseArraysVector::value_const_iterator thresholdIterator = this->values_cbegin(); + + for (uint32 i = 0; i < numConditions; i++) { + uint32 featureIndex = featureIndexIterator[i]; + float32 threshold = thresholdIterator[i]; + float32 featureValue = tmpArray2[featureIndex] == n ? tmpArray1[featureIndex] : 0; + + if (!compare_(featureValue, threshold)) { + return false; + } + } + + return true; } -ConjunctiveBody::threshold_iterator ConjunctiveBody::leq_thresholds_begin() { - return leqThresholds_; +ConjunctiveBody::ConjunctiveBody(uint32 numNumericalLeq, uint32 numNumericalGr, uint32 numOrdinalLeq, + uint32 numOrdinalGr, uint32 numNominalEq, uint32 numNominalNeq) + : numericalLeqVector_(ConditionVector(numNumericalLeq)), + numericalGrVector_(ConditionVector(numNumericalGr)), + ordinalLeqVector_(ConditionVector(numOrdinalLeq)), + ordinalGrVector_(ConditionVector(numOrdinalGr)), + nominalEqVector_(ConditionVector(numNominalEq)), + nominalNeqVector_(ConditionVector(numNominalNeq)) {} + +uint32 ConjunctiveBody::getNumNumericalLeq() const { + return numericalLeqVector_.getNumElements(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::leq_thresholds_end() { - return &leqThresholds_[numLeq_]; +ConjunctiveBody::threshold_iterator ConjunctiveBody::numerical_leq_thresholds_begin() { + return numericalLeqVector_.values_begin(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::leq_thresholds_cbegin() const { - return leqThresholds_; +ConjunctiveBody::threshold_iterator ConjunctiveBody::numerical_leq_thresholds_end() { + return numericalLeqVector_.values_end(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::leq_thresholds_cend() const { - return &leqThresholds_[numLeq_]; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::numerical_leq_thresholds_cbegin() const { + return numericalLeqVector_.values_cbegin(); } -ConjunctiveBody::index_iterator ConjunctiveBody::leq_indices_begin() { - return leqFeatureIndices_; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::numerical_leq_thresholds_cend() const { + return numericalLeqVector_.values_cend(); } -ConjunctiveBody::index_iterator ConjunctiveBody::leq_indices_end() { - return &leqFeatureIndices_[numLeq_]; +ConjunctiveBody::index_iterator ConjunctiveBody::numerical_leq_indices_begin() { + return numericalLeqVector_.indices_begin(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::leq_indices_cbegin() const { - return leqFeatureIndices_; +ConjunctiveBody::index_iterator ConjunctiveBody::numerical_leq_indices_end() { + return numericalLeqVector_.indices_end(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::leq_indices_cend() const { - return &leqFeatureIndices_[numLeq_]; +ConjunctiveBody::index_const_iterator ConjunctiveBody::numerical_leq_indices_cbegin() const { + return numericalLeqVector_.indices_cbegin(); } -uint32 ConjunctiveBody::getNumGr() const { - return numGr_; +ConjunctiveBody::index_const_iterator ConjunctiveBody::numerical_leq_indices_cend() const { + return numericalLeqVector_.indices_cend(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::gr_thresholds_begin() { - return grThresholds_; +uint32 ConjunctiveBody::getNumNumericalGr() const { + return numericalGrVector_.getNumElements(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::gr_thresholds_end() { - return &grThresholds_[numLeq_]; +ConjunctiveBody::threshold_iterator ConjunctiveBody::numerical_gr_thresholds_begin() { + return numericalGrVector_.values_begin(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::gr_thresholds_cbegin() const { - return grThresholds_; +ConjunctiveBody::threshold_iterator ConjunctiveBody::numerical_gr_thresholds_end() { + return numericalGrVector_.values_end(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::gr_thresholds_cend() const { - return &grThresholds_[numLeq_]; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::numerical_gr_thresholds_cbegin() const { + return numericalGrVector_.values_cbegin(); } -ConjunctiveBody::index_iterator ConjunctiveBody::gr_indices_begin() { - return grFeatureIndices_; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::numerical_gr_thresholds_cend() const { + return numericalGrVector_.values_cend(); } -ConjunctiveBody::index_iterator ConjunctiveBody::gr_indices_end() { - return &grFeatureIndices_[numLeq_]; +ConjunctiveBody::index_iterator ConjunctiveBody::numerical_gr_indices_begin() { + return numericalGrVector_.indices_begin(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::gr_indices_cbegin() const { - return grFeatureIndices_; +ConjunctiveBody::index_iterator ConjunctiveBody::numerical_gr_indices_end() { + return numericalGrVector_.indices_end(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::gr_indices_cend() const { - return &grFeatureIndices_[numLeq_]; +ConjunctiveBody::index_const_iterator ConjunctiveBody::numerical_gr_indices_cbegin() const { + return numericalGrVector_.indices_cbegin(); } -uint32 ConjunctiveBody::getNumEq() const { - return numEq_; +ConjunctiveBody::index_const_iterator ConjunctiveBody::numerical_gr_indices_cend() const { + return numericalGrVector_.indices_cend(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::eq_thresholds_begin() { - return eqThresholds_; +uint32 ConjunctiveBody::getNumOrdinalLeq() const { + return ordinalLeqVector_.getNumElements(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::eq_thresholds_end() { - return &eqThresholds_[numLeq_]; +ConjunctiveBody::threshold_iterator ConjunctiveBody::ordinal_leq_thresholds_begin() { + return ordinalLeqVector_.values_begin(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::eq_thresholds_cbegin() const { - return eqThresholds_; +ConjunctiveBody::threshold_iterator ConjunctiveBody::ordinal_leq_thresholds_end() { + return ordinalLeqVector_.values_end(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::eq_thresholds_cend() const { - return &eqThresholds_[numLeq_]; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::ordinal_leq_thresholds_cbegin() const { + return ordinalLeqVector_.values_cbegin(); } -ConjunctiveBody::index_iterator ConjunctiveBody::eq_indices_begin() { - return eqFeatureIndices_; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::ordinal_leq_thresholds_cend() const { + return ordinalLeqVector_.values_cend(); } -ConjunctiveBody::index_iterator ConjunctiveBody::eq_indices_end() { - return &eqFeatureIndices_[numLeq_]; +ConjunctiveBody::index_iterator ConjunctiveBody::ordinal_leq_indices_begin() { + return ordinalLeqVector_.indices_begin(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::eq_indices_cbegin() const { - return eqFeatureIndices_; +ConjunctiveBody::index_iterator ConjunctiveBody::ordinal_leq_indices_end() { + return ordinalLeqVector_.indices_end(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::eq_indices_cend() const { - return &eqFeatureIndices_[numLeq_]; +ConjunctiveBody::index_const_iterator ConjunctiveBody::ordinal_leq_indices_cbegin() const { + return ordinalLeqVector_.indices_cbegin(); } -uint32 ConjunctiveBody::getNumNeq() const { - return numNeq_; +ConjunctiveBody::index_const_iterator ConjunctiveBody::ordinal_leq_indices_cend() const { + return ordinalLeqVector_.indices_cend(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::neq_thresholds_begin() { - return neqThresholds_; +uint32 ConjunctiveBody::getNumOrdinalGr() const { + return ordinalGrVector_.getNumElements(); } -ConjunctiveBody::threshold_iterator ConjunctiveBody::neq_thresholds_end() { - return &neqThresholds_[numLeq_]; +ConjunctiveBody::threshold_iterator ConjunctiveBody::ordinal_gr_thresholds_begin() { + return ordinalGrVector_.values_begin(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::neq_thresholds_cbegin() const { - return neqThresholds_; +ConjunctiveBody::threshold_iterator ConjunctiveBody::ordinal_gr_thresholds_end() { + return ordinalGrVector_.values_end(); } -ConjunctiveBody::threshold_const_iterator ConjunctiveBody::neq_thresholds_cend() const { - return &neqThresholds_[numLeq_]; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::ordinal_gr_thresholds_cbegin() const { + return ordinalGrVector_.values_cbegin(); } -ConjunctiveBody::index_iterator ConjunctiveBody::neq_indices_begin() { - return neqFeatureIndices_; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::ordinal_gr_thresholds_cend() const { + return ordinalGrVector_.values_cend(); } -ConjunctiveBody::index_iterator ConjunctiveBody::neq_indices_end() { - return &neqFeatureIndices_[numLeq_]; +ConjunctiveBody::index_iterator ConjunctiveBody::ordinal_gr_indices_begin() { + return ordinalGrVector_.indices_begin(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::neq_indices_cbegin() const { - return neqFeatureIndices_; +ConjunctiveBody::index_iterator ConjunctiveBody::ordinal_gr_indices_end() { + return ordinalGrVector_.indices_end(); } -ConjunctiveBody::index_const_iterator ConjunctiveBody::neq_indices_cend() const { - return &neqFeatureIndices_[numLeq_]; +ConjunctiveBody::index_const_iterator ConjunctiveBody::ordinal_gr_indices_cbegin() const { + return ordinalGrVector_.indices_cbegin(); } -bool ConjunctiveBody::covers(VectorConstView::const_iterator begin, - VectorConstView::const_iterator end) const { - // Test conditions using the <= operator... - for (uint32 i = 0; i < numLeq_; i++) { - uint32 featureIndex = leqFeatureIndices_[i]; - float32 threshold = leqThresholds_[i]; +ConjunctiveBody::index_const_iterator ConjunctiveBody::ordinal_gr_indices_cend() const { + return ordinalGrVector_.indices_cend(); +} - if (begin[featureIndex] > threshold) { - return false; - } - } +uint32 ConjunctiveBody::getNumNominalEq() const { + return nominalEqVector_.getNumElements(); +} - // Test conditions using the > operator... - for (uint32 i = 0; i < numGr_; i++) { - uint32 featureIndex = grFeatureIndices_[i]; - float32 threshold = grThresholds_[i]; +ConjunctiveBody::threshold_iterator ConjunctiveBody::nominal_eq_thresholds_begin() { + return nominalEqVector_.values_begin(); +} - if (begin[featureIndex] <= threshold) { - return false; - } - } +ConjunctiveBody::threshold_iterator ConjunctiveBody::nominal_eq_thresholds_end() { + return nominalEqVector_.values_end(); +} - // Test conditions using the == operator... - for (uint32 i = 0; i < numEq_; i++) { - uint32 featureIndex = eqFeatureIndices_[i]; - float32 threshold = eqThresholds_[i]; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::nominal_eq_thresholds_cbegin() const { + return nominalEqVector_.values_cbegin(); +} - if (begin[featureIndex] != threshold) { - return false; - } - } +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::nominal_eq_thresholds_cend() const { + return nominalEqVector_.values_cend(); +} - // Test conditions using the != operator... - for (uint32 i = 0; i < numNeq_; i++) { - uint32 featureIndex = neqFeatureIndices_[i]; - float32 threshold = neqThresholds_[i]; +ConjunctiveBody::index_iterator ConjunctiveBody::nominal_eq_indices_begin() { + return nominalEqVector_.indices_begin(); +} - if (begin[featureIndex] == threshold) { - return false; - } - } +ConjunctiveBody::index_iterator ConjunctiveBody::nominal_eq_indices_end() { + return nominalEqVector_.indices_end(); +} - return true; +ConjunctiveBody::index_const_iterator ConjunctiveBody::nominal_eq_indices_cbegin() const { + return nominalEqVector_.indices_cbegin(); } -bool ConjunctiveBody::covers(CsrConstView::index_const_iterator indicesBegin, - CsrConstView::index_const_iterator indicesEnd, - CsrConstView::value_const_iterator valuesBegin, - CsrConstView::value_const_iterator valuesEnd, float32* tmpArray1, - uint32* tmpArray2, uint32 n) const { - // Copy non-zero feature values to the temporary arrays... - auto valueIterator = valuesBegin; +ConjunctiveBody::index_const_iterator ConjunctiveBody::nominal_eq_indices_cend() const { + return nominalEqVector_.indices_cend(); +} - for (auto indexIterator = indicesBegin; indexIterator != indicesEnd; indexIterator++) { - uint32 featureIndex = *indexIterator; - float32 featureValue = *valueIterator; - tmpArray1[featureIndex] = featureValue; - tmpArray2[featureIndex] = n; - valueIterator++; - } +uint32 ConjunctiveBody::getNumNominalNeq() const { + return nominalNeqVector_.getNumElements(); +} - // Test conditions using the <= operator... - for (uint32 i = 0; i < numLeq_; i++) { - uint32 featureIndex = leqFeatureIndices_[i]; - float32 threshold = leqThresholds_[i]; - float32 featureValue = tmpArray2[featureIndex] == n ? tmpArray1[featureIndex] : 0; +ConjunctiveBody::threshold_iterator ConjunctiveBody::nominal_neq_thresholds_begin() { + return nominalNeqVector_.values_begin(); +} - if (featureValue > threshold) { - return false; - } - } +ConjunctiveBody::threshold_iterator ConjunctiveBody::nominal_neq_thresholds_end() { + return nominalNeqVector_.values_end(); +} - // Test conditions using the > operator... - for (uint32 i = 0; i < numGr_; i++) { - uint32 featureIndex = grFeatureIndices_[i]; - float32 threshold = grThresholds_[i]; - float32 featureValue = tmpArray2[featureIndex] == n ? tmpArray1[featureIndex] : 0; +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::nominal_neq_thresholds_cbegin() const { + return nominalNeqVector_.values_cbegin(); +} - if (featureValue <= threshold) { - return false; - } - } +ConjunctiveBody::threshold_const_iterator ConjunctiveBody::nominal_neq_thresholds_cend() const { + return nominalNeqVector_.values_cend(); +} - // Test conditions using the == operator... - for (uint32 i = 0; i < numEq_; i++) { - uint32 featureIndex = eqFeatureIndices_[i]; - float32 threshold = eqThresholds_[i]; - float32 featureValue = tmpArray2[featureIndex] == n ? tmpArray1[featureIndex] : 0; +ConjunctiveBody::index_iterator ConjunctiveBody::nominal_neq_indices_begin() { + return nominalNeqVector_.indices_begin(); +} - if (featureValue != threshold) { - return false; - } - } +ConjunctiveBody::index_iterator ConjunctiveBody::nominal_neq_indices_end() { + return nominalNeqVector_.indices_end(); +} - // Test conditions using the != operator... - for (uint32 i = 0; i < numNeq_; i++) { - uint32 featureIndex = neqFeatureIndices_[i]; - float32 threshold = neqThresholds_[i]; - float32 featureValue = tmpArray2[featureIndex] == n ? tmpArray1[featureIndex] : 0; +ConjunctiveBody::index_const_iterator ConjunctiveBody::nominal_neq_indices_cbegin() const { + return nominalNeqVector_.indices_cbegin(); +} - if (featureValue == threshold) { - return false; - } +ConjunctiveBody::index_const_iterator ConjunctiveBody::nominal_neq_indices_cend() const { + return nominalNeqVector_.indices_cend(); +} + +bool ConjunctiveBody::covers(VectorConstView::const_iterator begin, + VectorConstView::const_iterator end) const { + return numericalLeqVector_.covers(begin, end) && numericalGrVector_.covers(begin, end) + && ordinalLeqVector_.covers(begin, end) && ordinalGrVector_.covers(begin, end) + && nominalEqVector_.covers(begin, end) && nominalNeqVector_.covers(begin, end); +} + +bool ConjunctiveBody::covers(CsrConstView::index_const_iterator indicesBegin, + CsrConstView::index_const_iterator indicesEnd, + CsrConstView::value_const_iterator valuesBegin, + CsrConstView::value_const_iterator valuesEnd, float32* tmpArray1, + uint32* tmpArray2, uint32 n) const { + // Copy non-zero feature values to the temporary arrays... + uint32 numNonZeroFeatureValues = valuesEnd - valuesBegin; + + for (uint32 i = 0; i < numNonZeroFeatureValues; i++) { + uint32 featureIndex = indicesBegin[i]; + float32 featureValue = valuesBegin[i]; + tmpArray1[featureIndex] = featureValue; + tmpArray2[featureIndex] = n; } - return true; + return numericalLeqVector_.covers(indicesBegin, indicesEnd, valuesBegin, valuesEnd, tmpArray1, tmpArray2, n) + && numericalGrVector_.covers(indicesBegin, indicesEnd, valuesBegin, valuesEnd, tmpArray1, tmpArray2, n) + && ordinalLeqVector_.covers(indicesBegin, indicesEnd, valuesBegin, valuesEnd, tmpArray1, tmpArray2, n) + && ordinalGrVector_.covers(indicesBegin, indicesEnd, valuesBegin, valuesEnd, tmpArray1, tmpArray2, n) + && nominalEqVector_.covers(indicesBegin, indicesEnd, valuesBegin, valuesEnd, tmpArray1, tmpArray2, n) + && nominalNeqVector_.covers(indicesBegin, indicesEnd, valuesBegin, valuesEnd, tmpArray1, tmpArray2, n); } void ConjunctiveBody::visit(EmptyBodyVisitor emptyBodyVisitor, ConjunctiveBodyVisitor conjunctiveBodyVisitor) const { diff --git a/cpp/subprojects/common/src/mlrl/common/model/condition_list.cpp b/cpp/subprojects/common/src/mlrl/common/model/condition_list.cpp index 12d8e44a5e..2d358b5439 100644 --- a/cpp/subprojects/common/src/mlrl/common/model/condition_list.cpp +++ b/cpp/subprojects/common/src/mlrl/common/model/condition_list.cpp @@ -1,12 +1,13 @@ #include "mlrl/common/model/condition_list.hpp" -ConditionList::ConditionList() : numConditionsPerComparator_({0, 0, 0, 0}) {} +ConditionList::ConditionList() : numConditionsPerComparator_({0, 0, 0, 0, 0, 0}) {} ConditionList::ConditionList(const ConditionList& conditionList) : vector_(conditionList.vector_), numConditionsPerComparator_( {conditionList.numConditionsPerComparator_[0], conditionList.numConditionsPerComparator_[1], - conditionList.numConditionsPerComparator_[2], conditionList.numConditionsPerComparator_[3]}) {} + conditionList.numConditionsPerComparator_[2], conditionList.numConditionsPerComparator_[3], + conditionList.numConditionsPerComparator_[4], conditionList.numConditionsPerComparator_[4]}) {} ConditionList::const_iterator ConditionList::cbegin() const { return vector_.cbegin(); @@ -32,13 +33,16 @@ void ConditionList::removeLastCondition() { }; std::unique_ptr ConditionList::createConjunctiveBody() const { - std::unique_ptr bodyPtr = - std::make_unique(numConditionsPerComparator_[LEQ], numConditionsPerComparator_[GR], - numConditionsPerComparator_[EQ], numConditionsPerComparator_[NEQ]); - uint32 leqIndex = 0; - uint32 grIndex = 0; - uint32 eqIndex = 0; - uint32 neqIndex = 0; + std::unique_ptr bodyPtr = std::make_unique( + numConditionsPerComparator_[NUMERICAL_LEQ], numConditionsPerComparator_[NUMERICAL_GR], + numConditionsPerComparator_[ORDINAL_LEQ], numConditionsPerComparator_[ORDINAL_GR], + numConditionsPerComparator_[NOMINAL_EQ], numConditionsPerComparator_[NOMINAL_NEQ]); + uint32 numericalLeqIndex = 0; + uint32 numericalGrIndex = 0; + uint32 ordinalLeqIndex = 0; + uint32 ordinalGrIndex = 0; + uint32 nominalEqIndex = 0; + uint32 nominalNeqIndex = 0; for (auto it = vector_.cbegin(); it != vector_.cend(); it++) { const Condition& condition = *it; @@ -46,28 +50,40 @@ std::unique_ptr ConditionList::createConjunctiveBody() const { float32 threshold = condition.threshold; switch (condition.comparator) { - case LEQ: { - bodyPtr->leq_indices_begin()[leqIndex] = featureIndex; - bodyPtr->leq_thresholds_begin()[leqIndex] = threshold; - leqIndex++; + case NUMERICAL_LEQ: { + bodyPtr->numerical_leq_indices_begin()[numericalLeqIndex] = featureIndex; + bodyPtr->numerical_leq_thresholds_begin()[numericalLeqIndex] = threshold; + numericalLeqIndex++; break; } - case GR: { - bodyPtr->gr_indices_begin()[grIndex] = featureIndex; - bodyPtr->gr_thresholds_begin()[grIndex] = threshold; - grIndex++; + case NUMERICAL_GR: { + bodyPtr->numerical_gr_indices_begin()[numericalGrIndex] = featureIndex; + bodyPtr->numerical_gr_thresholds_begin()[numericalGrIndex] = threshold; + numericalGrIndex++; break; } - case EQ: { - bodyPtr->eq_indices_begin()[eqIndex] = featureIndex; - bodyPtr->eq_thresholds_begin()[eqIndex] = threshold; - eqIndex++; + case ORDINAL_LEQ: { + bodyPtr->ordinal_leq_indices_begin()[ordinalLeqIndex] = featureIndex; + bodyPtr->ordinal_leq_thresholds_begin()[ordinalLeqIndex] = threshold; + ordinalLeqIndex++; break; } - case NEQ: { - bodyPtr->neq_indices_begin()[neqIndex] = featureIndex; - bodyPtr->neq_thresholds_begin()[neqIndex] = threshold; - neqIndex++; + case ORDINAL_GR: { + bodyPtr->ordinal_gr_indices_begin()[ordinalGrIndex] = featureIndex; + bodyPtr->ordinal_gr_thresholds_begin()[ordinalGrIndex] = threshold; + ordinalGrIndex++; + break; + } + case NOMINAL_EQ: { + bodyPtr->nominal_eq_indices_begin()[nominalEqIndex] = featureIndex; + bodyPtr->nominal_eq_thresholds_begin()[nominalEqIndex] = threshold; + nominalEqIndex++; + break; + } + case NOMINAL_NEQ: { + bodyPtr->nominal_neq_indices_begin()[nominalNeqIndex] = featureIndex; + bodyPtr->nominal_neq_thresholds_begin()[nominalNeqIndex] = threshold; + nominalNeqIndex++; break; } default: { diff --git a/cpp/subprojects/common/src/mlrl/common/model/head_complete.cpp b/cpp/subprojects/common/src/mlrl/common/model/head_complete.cpp index e88a0900a6..801f7d0bf9 100644 --- a/cpp/subprojects/common/src/mlrl/common/model/head_complete.cpp +++ b/cpp/subprojects/common/src/mlrl/common/model/head_complete.cpp @@ -1,29 +1,25 @@ #include "mlrl/common/model/head_complete.hpp" -CompleteHead::CompleteHead(uint32 numElements) : numElements_(numElements), scores_(new float64[numElements]) {} - -CompleteHead::~CompleteHead() { - delete[] scores_; -} +CompleteHead::CompleteHead(uint32 numElements) : vector_(DenseVector(numElements)) {} uint32 CompleteHead::getNumElements() const { - return numElements_; + return vector_.getNumElements(); } CompleteHead::score_iterator CompleteHead::scores_begin() { - return scores_; + return vector_.begin(); } CompleteHead::score_iterator CompleteHead::scores_end() { - return &scores_[numElements_]; + return vector_.end(); } CompleteHead::score_const_iterator CompleteHead::scores_cbegin() const { - return scores_; + return vector_.cbegin(); } CompleteHead::score_const_iterator CompleteHead::scores_cend() const { - return &scores_[numElements_]; + return vector_.cend(); } void CompleteHead::visit(CompleteHeadVisitor completeHeadVisitor, PartialHeadVisitor partialHeadVisitor) const { diff --git a/cpp/subprojects/common/src/mlrl/common/model/head_partial.cpp b/cpp/subprojects/common/src/mlrl/common/model/head_partial.cpp index 00e523f1bb..5be5452308 100644 --- a/cpp/subprojects/common/src/mlrl/common/model/head_partial.cpp +++ b/cpp/subprojects/common/src/mlrl/common/model/head_partial.cpp @@ -1,47 +1,41 @@ #include "mlrl/common/model/head_partial.hpp" -PartialHead::PartialHead(uint32 numElements) - : numElements_(numElements), scores_(new float64[numElements]), labelIndices_(new uint32[numElements]) {} - -PartialHead::~PartialHead() { - delete[] scores_; - delete[] labelIndices_; -} +PartialHead::PartialHead(uint32 numElements) : vector_(SparseArraysVector(numElements)) {} uint32 PartialHead::getNumElements() const { - return numElements_; + return vector_.getNumElements(); } PartialHead::score_iterator PartialHead::scores_begin() { - return scores_; + return vector_.values_begin(); } PartialHead::score_iterator PartialHead::scores_end() { - return &scores_[numElements_]; + return vector_.values_end(); } PartialHead::score_const_iterator PartialHead::scores_cbegin() const { - return scores_; + return vector_.values_cbegin(); } PartialHead::score_const_iterator PartialHead::scores_cend() const { - return &scores_[numElements_]; + return vector_.values_cend(); } PartialHead::index_iterator PartialHead::indices_begin() { - return labelIndices_; + return vector_.indices_begin(); } PartialHead::index_iterator PartialHead::indices_end() { - return &labelIndices_[numElements_]; + return vector_.indices_end(); } PartialHead::index_const_iterator PartialHead::indices_cbegin() const { - return labelIndices_; + return vector_.indices_cbegin(); } PartialHead::index_const_iterator PartialHead::indices_cend() const { - return &labelIndices_[numElements_]; + return vector_.indices_cend(); } void PartialHead::visit(CompleteHeadVisitor completeHeadVisitor, PartialHeadVisitor partialHeadVisitor) const { diff --git a/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_approximate.cpp b/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_approximate.cpp index 58aaa16b49..b94a4918a0 100644 --- a/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_approximate.cpp +++ b/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_approximate.cpp @@ -4,7 +4,7 @@ template static inline void findRefinementInternally(const IndexVector& labelIndices, uint32 numExamples, uint32 featureIndex, - bool nominal, uint32 minCoverage, + bool ordinal, bool nominal, uint32 minCoverage, IRuleRefinementCallback& callback, RefinementComparator& comparator) { Refinement refinement; @@ -66,7 +66,7 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin refinement.numCovered = numCovered; refinement.covered = true; refinement.threshold = thresholdIterator[r - 1]; - refinement.comparator = nominal ? EQ : LEQ; + refinement.comparator = nominal ? NOMINAL_EQ : (ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ); comparator.pushRefinement(refinement, scoreVector); } } @@ -86,7 +86,7 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin refinement.numCovered = coverage; refinement.covered = false; refinement.threshold = thresholdIterator[r - 1]; - refinement.comparator = nominal ? NEQ : GR; + refinement.comparator = nominal ? NOMINAL_NEQ : (ordinal ? ORDINAL_GR : NUMERICAL_GR); comparator.pushRefinement(refinement, scoreVector); } } @@ -122,7 +122,7 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin refinement.numCovered = numCovered; refinement.covered = true; refinement.threshold = thresholdIterator[sparseBinIndex - 1]; - refinement.comparator = nominal ? EQ : LEQ; + refinement.comparator = nominal ? NOMINAL_EQ : (ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ); comparator.pushRefinement(refinement, scoreVector); } } @@ -142,7 +142,7 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin refinement.numCovered = coverage; refinement.covered = false; refinement.threshold = thresholdIterator[sparseBinIndex - 1]; - refinement.comparator = nominal ? NEQ : GR; + refinement.comparator = nominal ? NOMINAL_NEQ : (ordinal ? ORDINAL_GR : NUMERICAL_GR); comparator.pushRefinement(refinement, scoreVector); } } @@ -194,10 +194,10 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin if (nominal) { refinement.threshold = thresholdIterator[firstR]; - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; } else { refinement.threshold = thresholdIterator[r]; - refinement.comparator = GR; + refinement.comparator = ordinal ? ORDINAL_GR : NUMERICAL_GR; } comparator.pushRefinement(refinement, scoreVector); @@ -221,10 +221,10 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin if (nominal) { refinement.threshold = thresholdIterator[firstR]; - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; } else { refinement.threshold = thresholdIterator[r]; - refinement.comparator = LEQ; + refinement.comparator = ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ; } comparator.pushRefinement(refinement, scoreVector); @@ -264,10 +264,10 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin if (nominal) { refinement.threshold = thresholdIterator[firstR]; - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; } else { refinement.threshold = thresholdIterator[sparseBinIndex]; - refinement.comparator = GR; + refinement.comparator = ordinal ? ORDINAL_GR : NUMERICAL_GR; } comparator.pushRefinement(refinement, scoreVector); @@ -291,10 +291,10 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin if (nominal) { refinement.threshold = thresholdIterator[firstR]; - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; } else { refinement.threshold = thresholdIterator[sparseBinIndex]; - refinement.comparator = LEQ; + refinement.comparator = ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ; } comparator.pushRefinement(refinement, scoreVector); @@ -323,7 +323,7 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin refinement.numCovered = coverage; refinement.covered = false; refinement.threshold = thresholdIterator[sparseBinIndex]; - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; comparator.pushRefinement(refinement, scoreVector); } } @@ -343,7 +343,7 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin refinement.numCovered = coverage; refinement.covered = true; refinement.threshold = thresholdIterator[sparseBinIndex]; - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; comparator.pushRefinement(refinement, scoreVector); } } @@ -354,21 +354,21 @@ static inline void findRefinementInternally(const IndexVector& labelIndices, uin template ApproximateRuleRefinement::ApproximateRuleRefinement(const IndexVector& labelIndices, uint32 numExamples, - uint32 featureIndex, bool nominal, + uint32 featureIndex, bool ordinal, bool nominal, std::unique_ptr callbackPtr) - : labelIndices_(labelIndices), numExamples_(numExamples), featureIndex_(featureIndex), nominal_(nominal), - callbackPtr_(std::move(callbackPtr)) {} + : labelIndices_(labelIndices), numExamples_(numExamples), featureIndex_(featureIndex), ordinal_(ordinal), + nominal_(nominal), callbackPtr_(std::move(callbackPtr)) {} template void ApproximateRuleRefinement::findRefinement(SingleRefinementComparator& comparator, uint32 minCoverage) { - findRefinementInternally(labelIndices_, numExamples_, featureIndex_, nominal_, minCoverage, *callbackPtr_, + findRefinementInternally(labelIndices_, numExamples_, featureIndex_, ordinal_, nominal_, minCoverage, *callbackPtr_, comparator); } template void ApproximateRuleRefinement::findRefinement(FixedRefinementComparator& comparator, uint32 minCoverage) { - findRefinementInternally(labelIndices_, numExamples_, featureIndex_, nominal_, minCoverage, *callbackPtr_, + findRefinementInternally(labelIndices_, numExamples_, featureIndex_, ordinal_, nominal_, minCoverage, *callbackPtr_, comparator); } diff --git a/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_exact.cpp b/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_exact.cpp index c33403d9f9..50f0f28b24 100644 --- a/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_exact.cpp +++ b/cpp/subprojects/common/src/mlrl/common/rule_refinement/rule_refinement_exact.cpp @@ -32,9 +32,9 @@ static inline void adjustRefinement(Refinement& refinement, FeatureVector::const template static inline void findRefinementInternally( - const IndexIterator& labelIndices, uint32 numExamples, uint32 featureIndex, bool nominal, uint32 minCoverage, - bool hasZeroWeights, IRuleRefinementCallback& callback, - RefinementComparator& comparator) { + const IndexIterator& labelIndices, uint32 numExamples, uint32 featureIndex, bool ordinal, bool nominal, + uint32 minCoverage, bool hasZeroWeights, + IRuleRefinementCallback& callback, RefinementComparator& comparator) { Refinement refinement; refinement.featureIndex = featureIndex; @@ -116,10 +116,10 @@ static inline void findRefinementInternally( refinement.covered = true; if (nominal) { - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; refinement.threshold = previousThreshold; } else { - refinement.comparator = LEQ; + refinement.comparator = ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ; refinement.threshold = arithmeticMean(previousThreshold, currentThreshold); } @@ -144,10 +144,10 @@ static inline void findRefinementInternally( refinement.covered = false; if (nominal) { - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; refinement.threshold = previousThreshold; } else { - refinement.comparator = GR; + refinement.comparator = ordinal ? ORDINAL_GR : NUMERICAL_GR; refinement.threshold = arithmeticMean(previousThreshold, currentThreshold); } @@ -190,7 +190,7 @@ static inline void findRefinementInternally( refinement.previous = previousR; refinement.numCovered = numCovered; refinement.covered = true; - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; refinement.threshold = previousThreshold; comparator.pushRefinement(refinement, scoreVector); } @@ -210,7 +210,7 @@ static inline void findRefinementInternally( refinement.previous = previousR; refinement.numCovered = coverage; refinement.covered = false; - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; refinement.threshold = previousThreshold; comparator.pushRefinement(refinement, scoreVector); } @@ -272,10 +272,10 @@ static inline void findRefinementInternally( refinement.covered = true; if (nominal) { - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; refinement.threshold = previousThreshold; } else { - refinement.comparator = GR; + refinement.comparator = ordinal ? ORDINAL_GR : NUMERICAL_GR; refinement.threshold = arithmeticMean(currentThreshold, previousThreshold); } @@ -300,10 +300,10 @@ static inline void findRefinementInternally( refinement.covered = false; if (nominal) { - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; refinement.threshold = previousThreshold; } else { - refinement.comparator = LEQ; + refinement.comparator = ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ; refinement.threshold = arithmeticMean(currentThreshold, previousThreshold); } @@ -347,7 +347,7 @@ static inline void findRefinementInternally( refinement.previous = previousR; refinement.numCovered = numCovered; refinement.covered = true; - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; refinement.threshold = previousThreshold; comparator.pushRefinement(refinement, scoreVector); } @@ -367,7 +367,7 @@ static inline void findRefinementInternally( refinement.previous = previousR; refinement.numCovered = coverage; refinement.covered = false; - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; refinement.threshold = previousThreshold; comparator.pushRefinement(refinement, scoreVector); } @@ -406,12 +406,12 @@ static inline void findRefinementInternally( if (nominal) { refinement.end = -1; refinement.previous = -1; - refinement.comparator = NEQ; + refinement.comparator = NOMINAL_NEQ; refinement.threshold = 0.0; } else { refinement.end = lastNegativeR; refinement.previous = previousR; - refinement.comparator = GR; + refinement.comparator = ordinal ? ORDINAL_GR : NUMERICAL_GR; refinement.threshold = previousThreshold * 0.5; } @@ -437,13 +437,13 @@ static inline void findRefinementInternally( if (nominal) { refinement.end = -1; refinement.previous = -1; - refinement.comparator = EQ; + refinement.comparator = NOMINAL_EQ; refinement.threshold = 0.0; } else { refinement.end = lastNegativeR; refinement.previous = previousR; refinement.numCovered = (numExamples - numAccumulated); - refinement.comparator = LEQ; + refinement.comparator = ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ; refinement.threshold = previousThreshold * 0.5; } @@ -470,7 +470,7 @@ static inline void findRefinementInternally( refinement.previous = previousRNegative; refinement.numCovered = numAccumulatedNegative; refinement.covered = true; - refinement.comparator = LEQ; + refinement.comparator = ordinal ? ORDINAL_LEQ : NUMERICAL_LEQ; if (numAccumulatedTotal < numExamples) { // If the condition separates an example with feature value < 0 from an (sparse) example with @@ -500,7 +500,7 @@ static inline void findRefinementInternally( refinement.previous = previousRNegative; refinement.numCovered = coverage; refinement.covered = false; - refinement.comparator = GR; + refinement.comparator = ordinal ? ORDINAL_GR : NUMERICAL_GR; if (numAccumulatedTotal < numExamples) { // If the condition separates an example with feature value < 0 from an (sparse) example with @@ -530,21 +530,21 @@ static inline void findRefinementInternally( template ExactRuleRefinement::ExactRuleRefinement(const IndexVector& labelIndices, uint32 numExamples, - uint32 featureIndex, bool nominal, bool hasZeroWeights, - std::unique_ptr callbackPtr) - : labelIndices_(labelIndices), numExamples_(numExamples), featureIndex_(featureIndex), nominal_(nominal), - hasZeroWeights_(hasZeroWeights), callbackPtr_(std::move(callbackPtr)) {} + uint32 featureIndex, bool ordinal, bool nominal, + bool hasZeroWeights, std::unique_ptr callbackPtr) + : labelIndices_(labelIndices), numExamples_(numExamples), featureIndex_(featureIndex), ordinal_(ordinal), + nominal_(nominal), hasZeroWeights_(hasZeroWeights), callbackPtr_(std::move(callbackPtr)) {} template void ExactRuleRefinement::findRefinement(SingleRefinementComparator& comparator, uint32 minCoverage) { - findRefinementInternally(labelIndices_, numExamples_, featureIndex_, nominal_, minCoverage, hasZeroWeights_, - *callbackPtr_, comparator); + findRefinementInternally(labelIndices_, numExamples_, featureIndex_, ordinal_, nominal_, minCoverage, + hasZeroWeights_, *callbackPtr_, comparator); } template void ExactRuleRefinement::findRefinement(FixedRefinementComparator& comparator, uint32 minCoverage) { - findRefinementInternally(labelIndices_, numExamples_, featureIndex_, nominal_, minCoverage, hasZeroWeights_, - *callbackPtr_, comparator); + findRefinementInternally(labelIndices_, numExamples_, featureIndex_, ordinal_, nominal_, minCoverage, + hasZeroWeights_, *callbackPtr_, comparator); } template class ExactRuleRefinement; diff --git a/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_approximate.cpp b/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_approximate.cpp index eb909e1527..810359274c 100644 --- a/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_approximate.cpp +++ b/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_approximate.cpp @@ -202,10 +202,12 @@ class ApproximateThresholds final : public AbstractThresholds { std::unique_ptr featureTypePtr = thresholds_.featureInfo_.createFeatureType(featureIndex); + bool ordinal = featureTypePtr->isOrdinal(); bool nominal = featureTypePtr->isNominal(); std::unique_ptr callbackPtr = std::make_unique(*this, featureIndex, nominal); return std::make_unique>( - labelIndices, coverageSet_.getNumCovered(), featureIndex, nominal, std::move(callbackPtr)); + labelIndices, coverageSet_.getNumCovered(), featureIndex, ordinal, nominal, + std::move(callbackPtr)); } public: diff --git a/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_exact.cpp b/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_exact.cpp index 8868da6c2b..5102748720 100644 --- a/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_exact.cpp +++ b/cpp/subprojects/common/src/mlrl/common/thresholds/thresholds_exact.cpp @@ -107,7 +107,7 @@ static inline void filterCurrentVector(const FeatureVector& vector, FilteredCach statistics.removeCoveredStatistic(index); } - if (conditionComparator == NEQ) { + if (conditionComparator == NOMINAL_NEQ) { // Retain the indices at positions [currentStart, currentEnd), while leaving the corresponding values in // `coverageMask` untouched, such that all previously covered examples in said range are still marked // as covered, while previously uncovered examples are still marked as uncovered... @@ -316,10 +316,11 @@ class ExactThresholds final : public AbstractThresholds { std::unique_ptr featureTypePtr = thresholds_.featureInfo_.createFeatureType(featureIndex); + bool ordinal = featureTypePtr->isOrdinal(); bool nominal = featureTypePtr->isNominal(); std::unique_ptr callbackPtr = std::make_unique(*this, featureIndex); return std::make_unique>( - labelIndices, numCoveredExamples_, featureIndex, nominal, weights_.hasZeroWeights(), + labelIndices, numCoveredExamples_, featureIndex, ordinal, nominal, weights_.hasZeroWeights(), std::move(callbackPtr)); } diff --git a/python/subprojects/common/mlrl/common/cython/rule_model.pxd b/python/subprojects/common/mlrl/common/cython/rule_model.pxd index ffd32a8402..9c3fc6f251 100644 --- a/python/subprojects/common/mlrl/common/cython/rule_model.pxd +++ b/python/subprojects/common/mlrl/common/cython/rule_model.pxd @@ -33,49 +33,69 @@ cdef extern from "mlrl/common/model/body_conjunctive.hpp" nogil: # Constructors: - ConjunctiveBodyImpl(uint32 numLeq, uint32 numGr, uint32 numEq, uint32 numNeq) + ConjunctiveBodyImpl(uint32 numNumericalLeq, uint32 numNumericalGr, uint32 numNominalEq, uint32 numNominalNeq) # Functions: - uint32 getNumLeq() const + uint32 getNumNumericalLeq() const - threshold_iterator leq_thresholds_begin() + threshold_iterator numerical_leq_thresholds_begin() - threshold_const_iterator leq_thresholds_cbegin() const + threshold_const_iterator numerical_leq_thresholds_cbegin() const - index_iterator leq_indices_begin() + index_iterator numerical_leq_indices_begin() - index_const_iterator leq_indices_cbegin() const + index_const_iterator numerical_leq_indices_cbegin() const - uint32 getNumGr() const + uint32 getNumNumericalGr() const - threshold_iterator gr_thresholds_begin() + threshold_iterator numerical_gr_thresholds_begin() - threshold_const_iterator gr_thresholds_cbegin() const + threshold_const_iterator numerical_gr_thresholds_cbegin() const - index_iterator gr_indices_begin() + index_iterator numerical_gr_indices_begin() - index_const_iterator gr_indices_cbegin() const + index_const_iterator numerical_gr_indices_cbegin() const - uint32 getNumEq() const + uint32 getNumOrdinalLeq() const - threshold_iterator eq_thresholds_begin() + threshold_iterator ordinal_leq_thresholds_begin() - threshold_const_iterator eq_thresholds_cbegin() const + threshold_const_iterator ordinal_leq_thresholds_cbegin() const - index_iterator eq_indices_begin() + index_iterator ordinal_leq_indices_begin() - index_const_iterator eq_indices_cbegin() const + index_const_iterator ordinal_leq_indices_cbegin() const - uint32 getNumNeq() const + uint32 getNumOrdinalGr() const - threshold_iterator neq_thresholds_begin() + threshold_iterator ordinal_gr_thresholds_begin() - threshold_const_iterator neq_thresholds_cbegin() const + threshold_const_iterator ordinal_gr_thresholds_cbegin() const - index_iterator neq_indices_begin() + index_iterator ordinal_gr_indices_begin() - index_const_iterator neq_indices_cbegin() const + index_const_iterator ordinal_gr_indices_cbegin() const + + uint32 getNumNominalEq() const + + threshold_iterator nominal_eq_thresholds_begin() + + threshold_const_iterator nominal_eq_thresholds_cbegin() const + + index_iterator nominal_eq_indices_begin() + + index_const_iterator nominal_eq_indices_cbegin() const + + uint32 getNumNominalNeq() const + + threshold_iterator nominal_neq_thresholds_begin() + + threshold_const_iterator nominal_neq_thresholds_cbegin() const + + index_iterator nominal_neq_indices_begin() + + index_const_iterator nominal_neq_indices_cbegin() const cdef extern from "mlrl/common/model/head.hpp" nogil: @@ -240,21 +260,29 @@ cdef class ConjunctiveBody: # Attributes: - cdef readonly npc.ndarray leq_indices + cdef readonly npc.ndarray numerical_leq_indices + + cdef readonly npc.ndarray numerical_leq_thresholds + + cdef readonly npc.ndarray numerical_gr_indices + + cdef readonly npc.ndarray numerical_gr_thresholds + + cdef readonly npc.ndarray ordinal_leq_indices - cdef readonly npc.ndarray leq_thresholds + cdef readonly npc.ndarray ordinal_leq_thresholds - cdef readonly npc.ndarray gr_indices + cdef readonly npc.ndarray ordinal_gr_indices - cdef readonly npc.ndarray gr_thresholds + cdef readonly npc.ndarray ordinal_gr_thresholds - cdef readonly npc.ndarray eq_indices + cdef readonly npc.ndarray nominal_eq_indices - cdef readonly npc.ndarray eq_thresholds + cdef readonly npc.ndarray nominal_eq_thresholds - cdef readonly npc.ndarray neq_indices + cdef readonly npc.ndarray nominal_neq_indices - cdef readonly npc.ndarray neq_thresholds + cdef readonly npc.ndarray nominal_neq_thresholds cdef class CompleteHead: diff --git a/python/subprojects/common/mlrl/common/cython/rule_model.pyx b/python/subprojects/common/mlrl/common/cython/rule_model.pyx index 6df2cc5ede..c6526e8f07 100644 --- a/python/subprojects/common/mlrl/common/cython/rule_model.pyx +++ b/python/subprojects/common/mlrl/common/cython/rule_model.pyx @@ -8,7 +8,7 @@ from abc import abstractmethod import numpy as np -SERIALIZATION_VERSION = 3 +SERIALIZATION_VERSION = 4 cdef class EmptyBody: @@ -23,43 +23,64 @@ cdef class ConjunctiveBody: A body of a rule that is given as a conjunction of several conditions. """ - def __cinit__(self, const uint32[::1] leq_indices, const float32[::1] leq_thresholds, const uint32[::1] gr_indices, - const float32[::1] gr_thresholds, const uint32[::1] eq_indices, const float32[::1] eq_thresholds, - const uint32[::1] neq_indices, const float32[::1] neq_thresholds): + def __cinit__(self, const uint32[::1] numerical_leq_indices, const float32[::1] numerical_leq_thresholds, + const uint32[::1] numerical_gr_indices, const float32[::1] numerical_gr_thresholds, + const uint32[::1] ordinal_leq_indices, const float32[::1] ordinal_leq_thresholds, + const uint32[::1] ordinal_gr_indices, const float32[::1] ordinal_gr_thresholds, + const uint32[::1] nominal_eq_indices, const float32[::1] nominal_eq_thresholds, + const uint32[::1] nominal_neq_indices, const float32[::1] nominal_neq_thresholds): """ - :param leq_indices: A contiguous array of type `uint32`, shape `(num_leq_conditions)`, that stores the - feature indices of the conditions that use the <= operator or None, if no such - conditions are available - :param leq_thresholds: A contiguous array of type `float32`, shape `(num_leq_conditions)` that stores the - thresholds of the conditions that use the <= operator or None, if no such conditions are - available - :param gr_indices: A contiguous array of type `uint32`, shape `(num_gr_conditions)`, that stores the - feature indices of the conditions that use the > operator or None, if no such conditions - are available - :param gr_thresholds: A contiguous array of type `float32`, shape `(num_gr_conditions)` that stores the - thresholds of the conditions that use the > operator or None, if no such conditions are - available - :param eq_indices: A contiguous array of type `uint32`, shape `(num_eq_conditions)`, that stores the - feature indices of the conditions that use the == operator or None, if no such - conditions are available - :param eq_thresholds: A contiguous array of type `float32`, shape `(num_eq_conditions)` that stores the - thresholds of the conditions that use the == operator or None, if no such conditions are - available - :param neq_indices: A contiguous array of type `uint32`, shape `(num_neq_conditions)`, that stores the - feature indices of the conditions that use the != operator or None, if no such - conditions are available - :param neq_thresholds: A contiguous array of type `float32`, shape `(num_neq_conditions)` that stores the - thresholds of the conditions that use the != operator or None, if no such conditions are - available + :param numerical_leq_indices: A contiguous array of type `uint32`, shape `(num_numerical_leq_conditions)`, + that stores the feature indices of the numerical conditions that use the <= + operator or None, if no such conditions are available + :param numerical_leq_thresholds: A contiguous array of type `float32`, shape `(num_numerical_leq_conditions)` + that stores the thresholds of the numerical conditions that use the <= + operator or None, if no such conditions are available + :param numerical_gr_indices: A contiguous array of type `uint32`, shape `(num_numerical_gr_conditions)`, + that stores the feature indices of the numerical conditions that use the > + operator or None, if no such conditions are available + :param numerical_gr_thresholds: A contiguous array of type `float32`, shape `(num_numerical_gr_conditions)` + that stores the thresholds of the numerical conditions that use the > + operator or None, if no such conditions are available + :param ordinal_leq_indices: A contiguous array of type `uint32`, shape `(num_ordinal_leq_conditions)`, + that stores the feature indices of the oridnal conditions that use the <= + operator or None, if no such conditions are available + :param ordinal_leq_thresholds: A contiguous array of type `float32`, shape `(num_ordinal_leq_conditions)` + that stores the thresholds of the ordinal conditions that use the <= + operator or None, if no such conditions are available + :param ordinal_gr_indices: A contiguous array of type `uint32`, shape `(num_ordinal_gr_conditions)`, + that stores the feature indices of the ordinal conditions that use the > + operator or None, if no such conditions are available + :param ordinal_gr_thresholds: A contiguous array of type `float32`, shape `(num_ordinal_gr_conditions)` + that stores the thresholds of the ordinal conditions that use the > operator + or None, if no such conditions are available + :param nominal_eq_indices: A contiguous array of type `uint32`, shape `(num_nominal_eq_conditions)`, + that stores the feature indices of the nominal conditions that use the == + operator or None, if no such conditions are available + :param nominal_eq_thresholds: A contiguous array of type `float32`, shape `(num_nominal_eq_conditions)` + that stores the thresholds of the nominal conditions that use the == + operator or None, if no such conditions are available + :param nominal_neq_indices: A contiguous array of type `uint32`, shape `(num_nominal_neq_conditions)`, + that stores the feature indices of the nominal conditions that use the != + operator or None, if no such conditions are available + :param nominal_neq_thresholds: A contiguous array of type `float32`, shape `(num_nominal_neq_conditions)` + that stores the thresholds of the nominal conditions that use the != + operator or None, if no such conditions are available """ - self.leq_indices = np.asarray(leq_indices) if leq_indices is not None else None - self.leq_thresholds = np.asarray(leq_thresholds) if leq_thresholds is not None else None - self.gr_indices = np.asarray(gr_indices) if gr_indices is not None else None - self.gr_thresholds = np.asarray(gr_thresholds) if gr_thresholds is not None else None - self.eq_indices = np.asarray(eq_indices) if eq_indices is not None else None - self.eq_thresholds = np.asarray(eq_thresholds) if eq_thresholds is not None else None - self.neq_indices = np.asarray(neq_indices) if neq_indices is not None else None - self.neq_thresholds = np.asarray(neq_thresholds) if neq_thresholds is not None else None + self.numerical_leq_indices = np.asarray(numerical_leq_indices) if numerical_leq_indices is not None else None + self.numerical_leq_thresholds = \ + np.asarray(numerical_leq_thresholds) if numerical_leq_thresholds is not None else None + self.numerical_gr_indices = np.asarray(numerical_gr_indices) if numerical_gr_indices is not None else None + self.numerical_gr_thresholds = \ + np.asarray(numerical_gr_thresholds) if numerical_gr_thresholds is not None else None + self.ordinal_leq_indices = np.asarray(ordinal_leq_indices) if ordinal_leq_indices is not None else None + self.ordinal_leq_thresholds = np.asarray(ordinal_leq_thresholds) if ordinal_leq_thresholds is not None else None + self.ordinal_gr_indices = np.asarray(ordinal_gr_indices) if ordinal_gr_indices is not None else None + self.ordinal_gr_thresholds = np.asarray(ordinal_gr_thresholds) if ordinal_gr_thresholds is not None else None + self.nominal_eq_indices = np.asarray(nominal_eq_indices) if nominal_eq_indices is not None else None + self.nominal_eq_thresholds = np.asarray(nominal_eq_thresholds) if nominal_eq_thresholds is not None else None + self.nominal_neq_indices = np.asarray(nominal_neq_indices) if nominal_neq_indices is not None else None + self.nominal_neq_thresholds = np.asarray(nominal_neq_thresholds) if nominal_neq_thresholds is not None else None cdef class CompleteHead: @@ -200,23 +221,48 @@ cdef class RuleList(RuleModel): self.visitor.visit_empty_body(EmptyBody.__new__(EmptyBody)) cdef __visit_conjunctive_body(self, const ConjunctiveBodyImpl& body): - cdef uint32 num_leq = body.getNumLeq() - cdef const uint32[::1] leq_indices = body.leq_indices_cbegin() if num_leq > 0 else None - cdef const float32[::1] leq_thresholds = \ - body.leq_thresholds_cbegin() if num_leq > 0 else None - cdef uint32 num_gr = body.getNumGr() - cdef const uint32[::1] gr_indices = body.gr_indices_cbegin() if num_gr > 0 else None - cdef const float32[::1] gr_thresholds = body.gr_thresholds_cbegin() if num_gr > 0 else None - cdef uint32 num_eq = body.getNumEq() - cdef const uint32[::1] eq_indices = body.eq_indices_cbegin() if num_eq > 0 else None - cdef const float32[::1] eq_thresholds = body.eq_thresholds_cbegin() if num_eq > 0 else None - cdef uint32 num_neq = body.getNumNeq() - cdef const uint32[::1] neq_indices = body.neq_indices_cbegin() if num_neq > 0 else None - cdef const float32[::1] neq_thresholds = \ - body.neq_thresholds_cbegin() if num_neq > 0 else None - self.visitor.visit_conjunctive_body(ConjunctiveBody.__new__(ConjunctiveBody, leq_indices, leq_thresholds, - gr_indices, gr_thresholds, eq_indices, - eq_thresholds, neq_indices, neq_thresholds)) + cdef uint32 num_numerical_leq = body.getNumNumericalLeq() + cdef const uint32[::1] numerical_leq_indices = \ + body.numerical_leq_indices_cbegin() if num_numerical_leq > 0 else None + cdef const float32[::1] numerical_leq_thresholds = \ + body.numerical_leq_thresholds_cbegin() if num_numerical_leq > 0 else None + + cdef uint32 num_numerical_gr = body.getNumNumericalGr() + cdef const uint32[::1] numerical_gr_indices = \ + body.numerical_gr_indices_cbegin() if num_numerical_gr > 0 else None + cdef const float32[::1] numerical_gr_thresholds = \ + body.numerical_gr_thresholds_cbegin() if num_numerical_gr > 0 else None + + cdef uint32 num_ordinal_leq = body.getNumOrdinalLeq() + cdef const uint32[::1] ordinal_leq_indices = \ + body.ordinal_leq_indices_cbegin() if num_ordinal_leq > 0 else None + cdef const float32[::1] ordinal_leq_thresholds = \ + body.ordinal_leq_thresholds_cbegin() if num_ordinal_leq > 0 else None + + cdef uint32 num_ordinal_gr = body.getNumOrdinalGr() + cdef const uint32[::1] ordinal_gr_indices = \ + body.ordinal_gr_indices_cbegin() if num_ordinal_gr > 0 else None + cdef const float32[::1] ordinal_gr_thresholds = \ + body.ordinal_gr_thresholds_cbegin() if num_ordinal_gr > 0 else None + + cdef uint32 num_nominal_eq = body.getNumNominalEq() + cdef const uint32[::1] nominal_eq_indices = \ + body.nominal_eq_indices_cbegin() if num_nominal_eq > 0 else None + cdef const float32[::1] nominal_eq_thresholds = \ + body.nominal_eq_thresholds_cbegin() if num_nominal_eq > 0 else None + + cdef uint32 num_nominal_neq = body.getNumNominalNeq() + cdef const uint32[::1] nominal_neq_indices = \ + body.nominal_neq_indices_cbegin() if num_nominal_neq > 0 else None + cdef const float32[::1] nominal_neq_thresholds = \ + body.nominal_neq_thresholds_cbegin() if num_nominal_neq > 0 else None + + self.visitor.visit_conjunctive_body( + ConjunctiveBody.__new__(ConjunctiveBody, numerical_leq_indices, numerical_leq_thresholds, + numerical_gr_indices, numerical_gr_thresholds, ordinal_leq_indices, + ordinal_leq_thresholds, ordinal_gr_indices, ordinal_gr_thresholds, + nominal_eq_indices, nominal_eq_thresholds, nominal_neq_indices, + nominal_neq_thresholds)) cdef __visit_complete_head(self, const CompleteHeadImpl& head): cdef uint32 num_elements = head.getNumElements() @@ -235,18 +281,38 @@ cdef class RuleList(RuleModel): self.state.append(rule_state) cdef __serialize_conjunctive_body(self, const ConjunctiveBodyImpl& body): - cdef uint32 num_leq = body.getNumLeq() - cdef uint32 num_gr = body.getNumGr() - cdef uint32 num_eq = body.getNumEq() - cdef uint32 num_neq = body.getNumNeq() - cdef object body_state = (np.asarray(body.leq_thresholds_cbegin()) if num_leq > 0 else None, - np.asarray(body.leq_indices_cbegin()) if num_leq > 0 else None, - np.asarray(body.gr_thresholds_cbegin()) if num_gr > 0 else None, - np.asarray(body.gr_indices_cbegin()) if num_gr > 0 else None, - np.asarray(body.eq_thresholds_cbegin()) if num_eq > 0 else None, - np.asarray(body.eq_indices_cbegin()) if num_eq > 0 else None, - np.asarray(body.neq_thresholds_cbegin()) if num_neq > 0 else None, - np.asarray(body.neq_indices_cbegin()) if num_neq > 0 else None) + cdef uint32 num_numerical_leq = body.getNumNumericalLeq() + cdef uint32 num_numerical_gr = body.getNumNumericalGr() + cdef uint32 num_ordinal_leq = body.getNumOrdinalLeq() + cdef uint32 num_ordinal_gr = body.getNumOrdinalGr() + cdef uint32 num_nominal_eq = body.getNumNominalEq() + cdef uint32 num_nominal_neq = body.getNumNominalNeq() + cdef object body_state = ( + np.asarray(body.numerical_leq_thresholds_cbegin()) \ + if num_numerical_leq > 0 else None, + np.asarray(body.numerical_leq_indices_cbegin()) \ + if num_numerical_leq > 0 else None, + np.asarray(body.numerical_gr_thresholds_cbegin()) \ + if num_numerical_gr > 0 else None, + np.asarray(body.numerical_gr_indices_cbegin()) \ + if num_numerical_gr > 0 else None, + np.asarray(body.ordinal_leq_thresholds_cbegin()) \ + if num_ordinal_leq > 0 else None, + np.asarray(body.ordinal_leq_indices_cbegin()) \ + if num_ordinal_leq > 0 else None, + np.asarray(body.ordinal_gr_thresholds_cbegin()) \ + if num_ordinal_gr > 0 else None, + np.asarray(body.ordinal_gr_indices_cbegin()) \ + if num_ordinal_gr > 0 else None, + np.asarray(body.nominal_eq_thresholds_cbegin()) \ + if num_nominal_eq > 0 else None, + np.asarray(body.nominal_eq_indices_cbegin()) \ + if num_nominal_eq > 0 else None, + np.asarray(body.nominal_neq_thresholds_cbegin()) \ + if num_nominal_neq > 0 else None, + np.asarray(body.nominal_neq_indices_cbegin()) \ + if num_nominal_neq > 0 else None, + ) cdef object rule_state = [body_state, None] self.state.append(rule_state) @@ -272,48 +338,68 @@ cdef class RuleList(RuleModel): return move(body_ptr) cdef unique_ptr[IBody] __deserialize_conjunctive_body(self, object body_state): - cdef const float32[::1] leq_thresholds = body_state[0] - cdef const uint32[::1] leq_indices = body_state[1] - cdef const float32[::1] gr_thresholds = body_state[2] - cdef const uint32[::1] gr_indices = body_state[3] - cdef const float32[::1] eq_thresholds = body_state[4] - cdef const uint32[::1] eq_indices = body_state[5] - cdef const float32[::1] neq_thresholds = body_state[6] - cdef const uint32[::1] neq_indices = body_state[7] - cdef uint32 num_leq = leq_thresholds.shape[0] if leq_thresholds is not None else 0 - cdef uint32 num_gr = gr_thresholds.shape[0] if gr_thresholds is not None else 0 - cdef uint32 num_eq = eq_thresholds.shape[0] if eq_thresholds is not None else 0 - cdef uint32 num_neq = neq_thresholds.shape[0] if neq_thresholds is not None else 0 - cdef unique_ptr[ConjunctiveBodyImpl] body_ptr = make_unique[ConjunctiveBodyImpl](num_leq, num_gr, num_eq, - num_neq) - cdef ConjunctiveBodyImpl.threshold_iterator threshold_iterator = body_ptr.get().leq_thresholds_begin() - cdef ConjunctiveBodyImpl.index_iterator index_iterator = body_ptr.get().leq_indices_begin() + cdef const float32[::1] numerical_leq_thresholds = body_state[0] + cdef const uint32[::1] numerical_leq_indices = body_state[1] + cdef const float32[::1] numerical_gr_thresholds = body_state[2] + cdef const uint32[::1] numerical_gr_indices = body_state[3] + cdef const float32[::1] ordinal_leq_thresholds = body_state[4] + cdef const uint32[::1] ordinal_leq_indices = body_state[5] + cdef const float32[::1] ordinal_gr_thresholds = body_state[6] + cdef const uint32[::1] ordinal_gr_indices = body_state[7] + cdef const float32[::1] nominal_eq_thresholds = body_state[8] + cdef const uint32[::1] nominal_eq_indices = body_state[9] + cdef const float32[::1] nominal_neq_thresholds = body_state[10] + cdef const uint32[::1] nominal_neq_indices = body_state[11] + cdef uint32 num_numerical_leq = numerical_leq_thresholds.shape[0] if numerical_leq_thresholds is not None else 0 + cdef uint32 num_numerical_gr = numerical_gr_thresholds.shape[0] if numerical_gr_thresholds is not None else 0 + cdef uint32 num_ordinal_leq = ordinal_leq_thresholds.shape[0] if ordinal_leq_thresholds is not None else 0 + cdef uint32 num_ordinal_gr = ordinal_gr_thresholds.shape[0] if ordinal_gr_thresholds is not None else 0 + cdef uint32 num_nominal_eq = nominal_eq_thresholds.shape[0] if nominal_eq_thresholds is not None else 0 + cdef uint32 num_nominal_neq = nominal_neq_thresholds.shape[0] if nominal_neq_thresholds is not None else 0 + cdef unique_ptr[ConjunctiveBodyImpl] body_ptr = make_unique[ConjunctiveBodyImpl]( + num_numerical_leq, num_numerical_gr, num_ordinal_leq, num_ordinal_gr, num_nominal_eq, num_nominal_neq) + cdef ConjunctiveBodyImpl.threshold_iterator threshold_iterator = body_ptr.get().numerical_leq_thresholds_begin() + cdef ConjunctiveBodyImpl.index_iterator index_iterator = body_ptr.get().numerical_leq_indices_begin() cdef uint32 i - for i in range(num_leq): - threshold_iterator[i] = leq_thresholds[i] - index_iterator[i] = leq_indices[i] + for i in range(num_numerical_leq): + threshold_iterator[i] = numerical_leq_thresholds[i] + index_iterator[i] = numerical_leq_indices[i] - threshold_iterator = body_ptr.get().gr_thresholds_begin() - index_iterator = body_ptr.get().gr_indices_begin() + threshold_iterator = body_ptr.get().numerical_gr_thresholds_begin() + index_iterator = body_ptr.get().numerical_gr_indices_begin() - for i in range(num_gr): - threshold_iterator[i] = gr_thresholds[i] - index_iterator[i] = gr_indices[i] + for i in range(num_numerical_gr): + threshold_iterator[i] = numerical_gr_thresholds[i] + index_iterator[i] = numerical_gr_indices[i] - threshold_iterator = body_ptr.get().eq_thresholds_begin() - index_iterator = body_ptr.get().eq_indices_begin() + threshold_iterator = body_ptr.get().ordinal_leq_thresholds_begin() + index_iterator = body_ptr.get().ordinal_leq_indices_begin() - for i in range(num_eq): - threshold_iterator[i] = eq_thresholds[i] - index_iterator[i] = eq_indices[i] + for i in range(num_ordinal_leq): + threshold_iterator[i] = ordinal_leq_thresholds[i] + index_iterator[i] = ordinal_leq_indices[i] - threshold_iterator = body_ptr.get().neq_thresholds_begin() - index_iterator = body_ptr.get().neq_indices_begin() + threshold_iterator = body_ptr.get().ordinal_gr_thresholds_begin() + index_iterator = body_ptr.get().ordinal_gr_indices_begin() - for i in range(num_neq): - threshold_iterator[i] = neq_thresholds[i] - index_iterator[i] = neq_indices[i] + for i in range(num_ordinal_gr): + threshold_iterator[i] = ordinal_gr_thresholds[i] + index_iterator[i] = ordinal_gr_indices[i] + + threshold_iterator = body_ptr.get().nominal_eq_thresholds_begin() + index_iterator = body_ptr.get().nominal_eq_indices_begin() + + for i in range(num_nominal_eq): + threshold_iterator[i] = nominal_eq_thresholds[i] + index_iterator[i] = nominal_eq_indices[i] + + threshold_iterator = body_ptr.get().nominal_neq_thresholds_begin() + index_iterator = body_ptr.get().nominal_neq_indices_begin() + + for i in range(num_nominal_neq): + threshold_iterator[i] = nominal_neq_thresholds[i] + index_iterator[i] = nominal_neq_indices[i] return move(body_ptr) diff --git a/python/subprojects/testbed/mlrl/testbed/model_characteristics.py b/python/subprojects/testbed/mlrl/testbed/model_characteristics.py index 1a0de5294a..657b5c8592 100644 --- a/python/subprojects/testbed/mlrl/testbed/model_characteristics.py +++ b/python/subprojects/testbed/mlrl/testbed/model_characteristics.py @@ -59,20 +59,25 @@ class RuleModelCharacteristics(Formattable, Tabularizable): """ def __init__(self, default_rule_index: int, default_rule_pos_predictions: int, - default_rule_neg_predictions: int, num_leq: np.ndarray, num_gr: np.ndarray, num_eq: np.ndarray, - num_neq: np.ndarray, num_pos_predictions: np.ndarray, num_neg_predictions: np.ndarray): + default_rule_neg_predictions: int, num_numerical_leq: np.ndarray, num_numerical_gr: np.ndarray, + num_ordinal_leq: np.ndarray, num_ordinal_gr: np.ndarray, num_nominal_eq: np.ndarray, + num_nominal_neq: np.ndarray, num_pos_predictions: np.ndarray, num_neg_predictions: np.ndarray): """ :param default_rule_index: The index of the default rule or None, if no default rule is used :param default_rule_pos_predictions: The number of positive predictions of the default rule, if any :param default_rule_neg_predictions: The number of negative predictions of the default rule, if any - :param num_leq: A `np.ndarray`, shape `(num_rules)` that stores the number of - conditions that use the <= operator per rule - :param num_gr: A `np.ndarray`, shape `(num_rules)` that stores the number of - conditions that use the > operator per rule - :param num_eq: A `np.ndarray`, shape `(num_rules)` that stores the number of - conditions that use the == operator per rule - :param num_neq: A `np.ndarray`, shape `(num_rules)` that stores the number of - conditions that use the != operator per rule + :param num_numerical_leq: A `np.ndarray`, shape `(num_rules)` that stores the number of + numerical conditions that use the <= operator per rule + :param num_numerical_gr: A `np.ndarray`, shape `(num_rules)` that stores the number of + numerical conditions that use the > operator per rule + :param num_ordinal_leq: A `np.ndarray`, shape `(num_rules)` that stores the number of + ordinal conditions that use the <= operator per rule + :param num_ordinal_gr: A `np.ndarray`, shape `(num_rules)` that stores the number of + ordinal conditions that use the > operator per rule + :param num_nominal_eq: A `np.ndarray`, shape `(num_rules)` that stores the number of + nominal conditions that use the == operator per rule + :param num_nominal_neq: A `np.ndarray`, shape `(num_rules)` that stores the number of + nominal conditions that use the != operator per rule :param num_pos_predictions: A `np.ndarray`, shape `(num_rules)` that stores the number of positive predictions per rule :param num_neg_predictions: A `np.ndarray`, shape `(num_rules)` that stores the number of @@ -81,10 +86,12 @@ def __init__(self, default_rule_index: int, default_rule_pos_predictions: int, self.default_rule_index = default_rule_index self.default_rule_pos_predictions = default_rule_pos_predictions self.default_rule_neg_predictions = default_rule_neg_predictions - self.num_leq = num_leq - self.num_gr = num_gr - self.num_eq = num_eq - self.num_neq = num_neq + self.num_numerical_leq = num_numerical_leq + self.num_numerical_gr = num_numerical_gr + self.num_ordinal_leq = num_ordinal_leq + self.num_ordinal_gr = num_ordinal_gr + self.num_nominal_eq = num_nominal_eq + self.num_nominal_neq = num_nominal_neq self.num_pos_predictions = num_pos_predictions self.num_neg_predictions = num_neg_predictions @@ -94,23 +101,27 @@ def format(self, options: Options, **_): See :func:`mlrl.testbed.output_writer.Formattable.format` """ num_predictions = self.num_pos_predictions + self.num_neg_predictions - num_conditions = self.num_leq + self.num_gr + self.num_eq + self.num_neq + num_conditions = self.num_numerical_leq + self.num_numerical_gr + self.num_ordinal_leq + self.num_ordinal_gr + self.num_nominal_eq + self.num_nominal_neq num_total_conditions = np.sum(num_conditions) if num_total_conditions > 0: - frac_leq = np.sum(self.num_leq) / num_total_conditions * 100 - frac_gr = np.sum(self.num_gr) / num_total_conditions * 100 - frac_eq = np.sum(self.num_eq) / num_total_conditions * 100 - frac_neq = np.sum(self.num_neq) / num_total_conditions * 100 + frac_numerical_leq = np.sum(self.num_numerical_leq) / num_total_conditions * 100 + frac_numerical_gr = np.sum(self.num_numerical_gr) / num_total_conditions * 100 + frac_ordinal_leq = np.sum(self.num_ordinal_leq) / num_total_conditions * 100 + frac_ordinal_gr = np.sum(self.num_ordinal_gr) / num_total_conditions * 100 + frac_nominal_eq = np.sum(self.num_nominal_eq) / num_total_conditions * 100 + frac_nominal_neq = np.sum(self.num_nominal_neq) / num_total_conditions * 100 num_conditions_mean = np.mean(num_conditions) num_conditions_min = np.min(num_conditions) num_conditions_max = np.max(num_conditions) else: - frac_leq = 0.0 - frac_gr = 0.0 - frac_eq = 0.0 - frac_neq = 0.0 + frac_numerical_leq = 0.0 + frac_numerical_gr = 0.0 + frac_ordinal_leq = 0.0 + frac_ordinal_gr = 0.0 + frac_nominal_eq = 0.0 + frac_nominal_neq = 0.0 num_conditions_mean = 0.0 num_conditions_min = 0.0 num_conditions_max = 0.0 @@ -132,8 +143,11 @@ def format(self, options: Options, **_): num_rules = num_predictions.shape[0] - header = ['Statistics about conditions', 'Total', '<= operator', '> operator', '== operator', '!= operator'] - alignment = ['left', 'right', 'right', 'right', 'right', 'right'] + header = [ + 'Statistics about conditions', 'Total', 'Numerical <= operator', 'Numerical > operator', + 'Ordinal <= operator', 'Ordinal > operator', 'Nominal == operator', 'Nominal != operator' + ] + alignment = ['left', 'right', 'right', 'right', 'right', 'right', 'right', 'right'] rows = [] if self.default_rule_index is not None: @@ -143,16 +157,20 @@ def format(self, options: Options, **_): format_percentage(0), format_percentage(0), format_percentage(0), + format_percentage(0), + format_percentage(0), format_percentage(0) ]) rows.append([ str(num_rules) + ' local rules', str(num_total_conditions), - format_percentage(frac_leq), - format_percentage(frac_gr), - format_percentage(frac_eq), - format_percentage(frac_neq) + format_percentage(frac_numerical_leq), + format_percentage(frac_numerical_gr), + format_percentage(frac_ordinal_leq), + format_percentage(frac_ordinal_gr), + format_percentage(frac_nominal_eq), + format_percentage(frac_nominal_neq) ]) text = format_table(rows, header=header, alignment=alignment) + '\n\n' @@ -211,34 +229,42 @@ def tabularize(self, options: Options, **_) -> Optional[List[Dict[str, str]]]: if i == default_rule_index: rule_name += ' (Default rule)' - num_leq = 0 - num_gr = 0 - num_eq = 0 - num_neq = 0 + num_numerical_leq = 0 + num_numerical_gr = 0 + num_ordinal_leq = 0 + num_ordinal_gr = 0 + num_nominal_eq = 0 + num_nominal_neq = 0 num_pos_predictions = self.default_rule_pos_predictions num_neg_predictions = self.default_rule_neg_predictions else: - num_leq = self.num_leq[j] - num_gr = self.num_gr[j] - num_eq = self.num_eq[j] - num_neq = self.num_neq[j] + num_numerical_leq = self.num_numerical_leq[j] + num_numerical_gr = self.num_numerical_gr[j] + num_ordinal_leq = self.num_ordinal_leq[j] + num_ordinal_gr = self.num_ordinal_gr[j] + num_nominal_eq = self.num_nominal_eq[j] + num_nominal_neq = self.num_nominal_neq[j] num_pos_predictions = self.num_pos_predictions[j] num_neg_predictions = self.num_neg_predictions[j] j += 1 - num_numerical = num_leq + num_gr - num_nominal = num_eq + num_neq - num_conditions = num_numerical + num_nominal + num_numerical = num_numerical_leq + num_numerical_gr + num_ordinal = num_ordinal_leq + num_ordinal_gr + num_nominal = num_nominal_eq + num_nominal_neq + num_conditions = num_numerical + num_ordinal + num_nominal num_predictions = num_pos_predictions + num_neg_predictions rows.append({ 'Rule': rule_name, 'conditions': num_conditions, 'numerical conditions': num_numerical, - 'conditions using <= operator': num_leq, - 'conditions using > operator': num_gr, + 'conditions using <= operator': num_numerical_leq, + 'conditions using > operator': num_numerical_gr, + 'ordinal conditions': num_ordinal, + 'conditions using <= operator': num_ordinal_leq, + 'conditions using > operator': num_ordinal_gr, 'nominal conditions': num_nominal, - 'conditions using == operator': num_eq, - 'conditions using != operator': num_neq, + 'conditions using == operator': num_nominal_eq, + 'conditions using != operator': num_nominal_neq, 'predictions': num_predictions, 'pos. predictions': num_pos_predictions, 'neg. predictions': num_neg_predictions @@ -252,10 +278,12 @@ class RuleModelCharacteristicsVisitor(RuleModelVisitor): """ def __init__(self): - self.num_leq = [] - self.num_gr = [] - self.num_eq = [] - self.num_neq = [] + self.num_numerical_leq = [] + self.num_numerical_gr = [] + self.num_ordinal_leq = [] + self.num_ordinal_gr = [] + self.num_nominal_eq = [] + self.num_nominal_neq = [] self.num_pos_predictions = [] self.num_neg_predictions = [] self.default_rule_index = None @@ -275,10 +303,16 @@ def visit_conjunctive_body(self, body: ConjunctiveBody): See :func:`mlrl.common.cython.rule_model.RuleModelVisitor.visit_conjunctive_body` """ self.index += 1 - self.num_leq.append(body.leq_indices.shape[0] if body.leq_indices is not None else 0) - self.num_gr.append(body.gr_indices.shape[0] if body.gr_indices is not None else 0) - self.num_eq.append(body.eq_indices.shape[0] if body.eq_indices is not None else 0) - self.num_neq.append(body.neq_indices.shape[0] if body.neq_indices is not None else 0) + self.num_numerical_leq.append( + body.numerical_leq_indices.shape[0] if body.numerical_leq_indices is not None else 0) + self.num_numerical_gr.append( + body.numerical_gr_indices.shape[0] if body.numerical_gr_indices is not None else 0) + self.num_ordinal_leq.append( + body.ordinal_leq_indices.shape[0] if body.ordinal_leq_indices is not None else 0) + self.num_ordinal_gr.append(body.ordinal_gr_indices.shape[0] if body.ordinal_gr_indices is not None else 0) + self.num_nominal_eq.append(body.nominal_eq_indices.shape[0] if body.nominal_eq_indices is not None else 0) + self.num_nominal_neq.append( + body.nominal_neq_indices.shape[0] if body.nominal_neq_indices is not None else 0) def visit_complete_head(self, head: CompleteHead): """ @@ -323,10 +357,12 @@ def _generate_output_data(self, meta_data: MetaData, x, y, data_split: DataSplit default_rule_index=visitor.default_rule_index, default_rule_pos_predictions=visitor.default_rule_pos_predictions, default_rule_neg_predictions=visitor.default_rule_neg_predictions, - num_leq=np.asarray(visitor.num_leq), - num_gr=np.asarray(visitor.num_gr), - num_eq=np.asarray(visitor.num_eq), - num_neq=np.asarray(visitor.num_neq), + num_numerical_leq=np.asarray(visitor.num_numerical_leq), + num_numerical_gr=np.asarray(visitor.num_numerical_gr), + num_ordinal_leq=np.asarray(visitor.num_ordinal_leq), + num_ordinal_gr=np.asarray(visitor.num_ordinal_gr), + num_nominal_eq=np.asarray(visitor.num_nominal_eq), + num_nominal_neq=np.asarray(visitor.num_nominal_neq), num_pos_predictions=np.asarray(visitor.num_pos_predictions), num_neg_predictions=np.asarray(visitor.num_neg_predictions)) diff --git a/python/subprojects/testbed/mlrl/testbed/models.py b/python/subprojects/testbed/mlrl/testbed/models.py index 8b97884b62..21944aa324 100644 --- a/python/subprojects/testbed/mlrl/testbed/models.py +++ b/python/subprojects/testbed/mlrl/testbed/models.py @@ -149,10 +149,17 @@ def visit_conjunctive_body(self, body: ConjunctiveBody): if self.print_bodies: text = self.text text.write('{') - num_conditions = self.__format_conditions(0, body.leq_indices, body.leq_thresholds, '<=') - num_conditions = self.__format_conditions(num_conditions, body.gr_indices, body.gr_thresholds, '>') - num_conditions = self.__format_conditions(num_conditions, body.eq_indices, body.eq_thresholds, '==') - self.__format_conditions(num_conditions, body.neq_indices, body.neq_thresholds, '!=') + num_conditions = self.__format_conditions(0, body.numerical_leq_indices, body.numerical_leq_thresholds, + '<=') + num_conditions = self.__format_conditions(num_conditions, body.numerical_gr_indices, + body.numerical_gr_thresholds, '>') + num_conditions = self.__format_conditions(num_conditions, body.ordinal_leq_indices, + body.ordinal_leq_thresholds, '<=') + num_conditions = self.__format_conditions(num_conditions, body.ordinal_gr_indices, + body.ordinal_gr_thresholds, '>') + num_conditions = self.__format_conditions(num_conditions, body.nominal_eq_indices, + body.nominal_eq_thresholds, '==') + self.__format_conditions(num_conditions, body.nominal_neq_indices, body.nominal_neq_thresholds, '!=') text.write('}') def visit_complete_head(self, head: CompleteHead): diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads.txt index 6abc46262c..709c68bd7f 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 29.08 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 12085 │ 51.10% │ 48.90% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 12085 │ 51.10% │ 48.90% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads_equal-width-label-binning.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads_equal-width-label-binning.txt index 314864b812..2ac32d24c6 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads_equal-width-label-binning.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-complete-heads_equal-width-label-binning.txt @@ -31,12 +31,12 @@ Subset Accuracy 29.08 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 10418 │ 51.26% │ 48.74% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 10418 │ 51.26% │ 48.74% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads.txt index b61322e9ce..bfa9391f86 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 27.55 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5586 │ 50.50% │ 49.50% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5586 │ 50.50% │ 49.50% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads_equal-width-label-binning.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads_equal-width-label-binning.txt index 1d6f949853..ca817d8a76 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads_equal-width-label-binning.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-dynamic-heads_equal-width-label-binning.txt @@ -31,12 +31,12 @@ Subset Accuracy 31.63 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 4980 │ 51.71% │ 48.29% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 4980 │ 51.71% │ 48.29% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads.txt index 2da068b729..15248d0d1c 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 27.04 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 6380 │ 50.50% │ 49.50% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 6380 │ 50.50% │ 49.50% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads_equal-width-label-binning.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads_equal-width-label-binning.txt index e3dc5a9e98..864ff67c43 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads_equal-width-label-binning.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-partial-fixed-heads_equal-width-label-binning.txt @@ -31,12 +31,12 @@ Subset Accuracy 29.59 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 6445 │ 49.56% │ 50.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 6445 │ 49.56% │ 50.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/example-wise-single-label-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/example-wise-single-label-heads.txt index 2b2d8d1e71..6045988cf7 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/example-wise-single-label-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/example-wise-single-label-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 25 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5437 │ 50.97% │ 49.03% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5437 │ 50.97% │ 49.03% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads.txt index 821c62ba7b..628a6d4175 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 29.08 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 11897 │ 50.70% │ 49.30% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 11897 │ 50.70% │ 49.30% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads_equal-width-label-binning.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads_equal-width-label-binning.txt index 91f663bf32..5568bf9f82 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads_equal-width-label-binning.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-complete-heads_equal-width-label-binning.txt @@ -31,12 +31,12 @@ Subset Accuracy 30.61 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 11699 │ 51.00% │ 49.00% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 11699 │ 51.00% │ 49.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads.txt index d73f691cfb..5055cc0919 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 23.98 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 6254 │ 50.51% │ 49.49% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 6254 │ 50.51% │ 49.49% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads_equal-width-label-binning.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads_equal-width-label-binning.txt index c821a26332..c764780eb3 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads_equal-width-label-binning.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-dynamic-heads_equal-width-label-binning.txt @@ -31,12 +31,12 @@ Subset Accuracy 28.57 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5569 │ 50.08% │ 49.92% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5569 │ 50.08% │ 49.92% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads.txt index 4d6bf72be4..eb393c9ece 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 29.59 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 8475 │ 52.06% │ 47.94% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 8475 │ 52.06% │ 47.94% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads_equal-width-label-binning.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads_equal-width-label-binning.txt index 399073f7ef..9df4a71eaf 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads_equal-width-label-binning.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-partial-fixed-heads_equal-width-label-binning.txt @@ -31,12 +31,12 @@ Subset Accuracy 30.1 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5629 │ 51.29% │ 48.71% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5629 │ 51.29% │ 48.71% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/label-wise-single-label-heads.txt b/python/subprojects/testbed/tests/res/out/boomer/label-wise-single-label-heads.txt index b111e40e5f..5abd7eca01 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/label-wise-single-label-heads.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/label-wise-single-label-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 25.51 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_cross-validation.txt b/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_cross-validation.txt index f1f610d048..d17454ea86 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_cross-validation.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_cross-validation.txt @@ -9,12 +9,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5852 │ 49.98% │ 50.02% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5852 │ 49.98% │ 50.02% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -37,12 +37,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 2): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 6067 │ 49.56% │ 50.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 6067 │ 49.56% │ 50.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -65,12 +65,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 3): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 6116 │ 50.52% │ 49.48% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 6116 │ 50.52% │ 49.48% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -93,12 +93,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 4): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5969 │ 49.69% │ 50.31% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5969 │ 49.69% │ 50.31% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -121,12 +121,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 5): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5974 │ 49.56% │ 50.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5974 │ 49.56% │ 50.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -149,12 +149,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 6): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5932 │ 49.46% │ 50.54% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5932 │ 49.46% │ 50.54% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -177,12 +177,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 7): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5921 │ 49.30% │ 50.70% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5921 │ 49.30% │ 50.70% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -205,12 +205,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 8): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5910 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5910 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -233,12 +233,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 9): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5925 │ 50.16% │ 49.84% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5925 │ 50.16% │ 49.84% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -261,12 +261,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 10): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5882 │ 50.58% │ 49.42% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5882 │ 50.58% │ 49.42% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_single-fold.txt b/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_single-fold.txt index 03b2fa1822..8283192cff 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_single-fold.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_single-fold.txt @@ -9,12 +9,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5852 │ 49.98% │ 50.02% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5852 │ 49.98% │ 50.02% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_train-test.txt b/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_train-test.txt index cd626bd983..98de221a54 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_train-test.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/model-characteristics_train-test.txt @@ -8,12 +8,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/no-default-rule.txt b/python/subprojects/testbed/tests/res/out/boomer/no-default-rule.txt index 4836dc77a6..c127455a62 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/no-default-rule.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/no-default-rule.txt @@ -31,11 +31,11 @@ Subset Accuracy 23.98 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ 1000 local rules │ 5492 │ 49.71% │ 50.29% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ 1000 local rules │ 5492 │ 49.71% │ 50.29% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/parameters_cross-validation.txt b/python/subprojects/testbed/tests/res/out/boomer/parameters_cross-validation.txt index a9db08e35f..9470b4cf26 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/parameters_cross-validation.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/parameters_cross-validation.txt @@ -19,12 +19,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -57,12 +57,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 2): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -95,12 +95,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 3): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -133,12 +133,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 4): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -171,12 +171,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 5): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -209,12 +209,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 6): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -247,12 +247,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 7): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -285,12 +285,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 8): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -323,12 +323,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 9): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -361,12 +361,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 10): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/parameters_single-fold.txt b/python/subprojects/testbed/tests/res/out/boomer/parameters_single-fold.txt index df8fe84dad..6d3702c4fe 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/parameters_single-fold.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/parameters_single-fold.txt @@ -19,12 +19,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/parameters_train-test.txt b/python/subprojects/testbed/tests/res/out/boomer/parameters_train-test.txt index 7dc99f1f12..6a819b206c 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/parameters_train-test.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/parameters_train-test.txt @@ -18,12 +18,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 66.67% │ 33.33% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 66.67% │ 33.33% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_no-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_no-holdout.txt index b111e40e5f..5abd7eca01 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_no-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_no-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 25.51 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_random-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_random-holdout.txt index c24fd28396..746c60be46 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_random-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_random-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 25 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 123 local rules │ 588 │ 50.51% │ 49.49% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 123 local rules │ 588 │ 50.51% │ 49.49% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-example-wise-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-example-wise-holdout.txt index f493d05470..3df0795729 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-example-wise-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-example-wise-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 23.47 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 244 local rules │ 1055 │ 51.56% │ 48.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 244 local rules │ 1055 │ 51.56% │ 48.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-label-wise-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-label-wise-holdout.txt index d040fa741c..22650b4594 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-label-wise-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/post-pruning_stratified-label-wise-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 23.47 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 127 local rules │ 602 │ 54.65% │ 45.35% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 127 local rules │ 602 │ 54.65% │ 45.35% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_no-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_no-holdout.txt index b111e40e5f..5abd7eca01 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_no-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_no-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 25.51 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 999 local rules │ 5563 │ 50.39% │ 49.61% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_random-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_random-holdout.txt index c24fd28396..746c60be46 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_random-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_random-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 25 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 123 local rules │ 588 │ 50.51% │ 49.49% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 123 local rules │ 588 │ 50.51% │ 49.49% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-example-wise-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-example-wise-holdout.txt index f493d05470..3df0795729 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-example-wise-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-example-wise-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 23.47 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 244 local rules │ 1055 │ 51.56% │ 48.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 244 local rules │ 1055 │ 51.56% │ 48.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-label-wise-holdout.txt b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-label-wise-holdout.txt index d040fa741c..22650b4594 100644 --- a/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-label-wise-holdout.txt +++ b/python/subprojects/testbed/tests/res/out/boomer/pre-pruning_stratified-label-wise-holdout.txt @@ -31,12 +31,12 @@ Subset Accuracy 23.47 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 127 local rules │ 602 │ 54.65% │ 45.35% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 127 local rules │ 602 │ 54.65% │ 45.35% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/model-characteristics_cross-validation.txt b/python/subprojects/testbed/tests/res/out/seco/model-characteristics_cross-validation.txt index 51847a88eb..d9b3c46d42 100644 --- a/python/subprojects/testbed/tests/res/out/seco/model-characteristics_cross-validation.txt +++ b/python/subprojects/testbed/tests/res/out/seco/model-characteristics_cross-validation.txt @@ -9,12 +9,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 73 local rules │ 94 │ 46.81% │ 53.19% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 73 local rules │ 94 │ 46.81% │ 53.19% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -37,12 +37,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 2): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 71 local rules │ 84 │ 54.76% │ 45.24% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 71 local rules │ 84 │ 54.76% │ 45.24% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -65,12 +65,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 3): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 77 local rules │ 92 │ 50.00% │ 50.00% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 77 local rules │ 92 │ 50.00% │ 50.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -93,12 +93,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 4): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 72 local rules │ 94 │ 59.57% │ 40.43% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 72 local rules │ 94 │ 59.57% │ 40.43% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -121,12 +121,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 5): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 79 local rules │ 93 │ 52.69% │ 47.31% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 79 local rules │ 93 │ 52.69% │ 47.31% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -149,12 +149,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 6): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 68 local rules │ 84 │ 54.76% │ 45.24% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 68 local rules │ 84 │ 54.76% │ 45.24% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -177,12 +177,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 7): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 80 local rules │ 98 │ 51.02% │ 48.98% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 80 local rules │ 98 │ 51.02% │ 48.98% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -205,12 +205,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 8): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 72 local rules │ 84 │ 46.43% │ 53.57% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 72 local rules │ 84 │ 46.43% │ 53.57% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -233,12 +233,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 9): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 75 local rules │ 94 │ 43.62% │ 56.38% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 75 local rules │ 94 │ 43.62% │ 56.38% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -261,12 +261,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 10): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 77 local rules │ 91 │ 52.75% │ 47.25% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 77 local rules │ 91 │ 52.75% │ 47.25% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/model-characteristics_single-fold.txt b/python/subprojects/testbed/tests/res/out/seco/model-characteristics_single-fold.txt index 20d0194f15..a4591b9ef8 100644 --- a/python/subprojects/testbed/tests/res/out/seco/model-characteristics_single-fold.txt +++ b/python/subprojects/testbed/tests/res/out/seco/model-characteristics_single-fold.txt @@ -9,12 +9,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 73 local rules │ 94 │ 46.81% │ 53.19% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 73 local rules │ 94 │ 46.81% │ 53.19% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/model-characteristics_train-test.txt b/python/subprojects/testbed/tests/res/out/seco/model-characteristics_train-test.txt index 68dd501982..714617c5f1 100644 --- a/python/subprojects/testbed/tests/res/out/seco/model-characteristics_train-test.txt +++ b/python/subprojects/testbed/tests/res/out/seco/model-characteristics_train-test.txt @@ -8,12 +8,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 61 local rules │ 68 │ 57.35% │ 42.65% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 61 local rules │ 68 │ 57.35% │ 42.65% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/parameters_cross-validation.txt b/python/subprojects/testbed/tests/res/out/seco/parameters_cross-validation.txt index b05be0952f..ac66b634b5 100644 --- a/python/subprojects/testbed/tests/res/out/seco/parameters_cross-validation.txt +++ b/python/subprojects/testbed/tests/res/out/seco/parameters_cross-validation.txt @@ -19,12 +19,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -57,12 +57,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 2): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -95,12 +95,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 3): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 66.67% │ 33.33% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 66.67% │ 33.33% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -133,12 +133,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 4): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -171,12 +171,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 5): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -209,12 +209,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 6): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 77.78% │ 22.22% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 77.78% │ 22.22% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -247,12 +247,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 7): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -285,12 +285,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 8): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -323,12 +323,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 9): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ @@ -361,12 +361,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 10): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 66.67% │ 33.33% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 66.67% │ 33.33% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/parameters_single-fold.txt b/python/subprojects/testbed/tests/res/out/seco/parameters_single-fold.txt index ad32a6de76..08eb66142e 100644 --- a/python/subprojects/testbed/tests/res/out/seco/parameters_single-fold.txt +++ b/python/subprojects/testbed/tests/res/out/seco/parameters_single-fold.txt @@ -19,12 +19,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics (Fold 1): -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 44.44% │ 55.56% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/parameters_train-test.txt b/python/subprojects/testbed/tests/res/out/seco/parameters_train-test.txt index 608753a454..b813669e9d 100644 --- a/python/subprojects/testbed/tests/res/out/seco/parameters_train-test.txt +++ b/python/subprojects/testbed/tests/res/out/seco/parameters_train-test.txt @@ -18,12 +18,12 @@ DEBUG A dense matrix is used to store the labels of the training examples INFO Successfully fit model in INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 9 local rules │ 9 │ 55.56% │ 44.44% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/partial-heads_kln-lift-function.txt b/python/subprojects/testbed/tests/res/out/seco/partial-heads_kln-lift-function.txt index 7f3e9a9c8c..30aa1bac02 100644 --- a/python/subprojects/testbed/tests/res/out/seco/partial-heads_kln-lift-function.txt +++ b/python/subprojects/testbed/tests/res/out/seco/partial-heads_kln-lift-function.txt @@ -31,12 +31,12 @@ Subset Accuracy 20.41 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 68 local rules │ 75 │ 45.33% │ 54.67% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 68 local rules │ 75 │ 45.33% │ 54.67% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/partial-heads_no-lift-function.txt b/python/subprojects/testbed/tests/res/out/seco/partial-heads_no-lift-function.txt index a320ec304e..bb87fa17a7 100644 --- a/python/subprojects/testbed/tests/res/out/seco/partial-heads_no-lift-function.txt +++ b/python/subprojects/testbed/tests/res/out/seco/partial-heads_no-lift-function.txt @@ -31,12 +31,12 @@ Subset Accuracy 19.39 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 61 local rules │ 68 │ 57.35% │ 42.65% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 61 local rules │ 68 │ 57.35% │ 42.65% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/partial-heads_peak-lift-function.txt b/python/subprojects/testbed/tests/res/out/seco/partial-heads_peak-lift-function.txt index bca43519bb..cd46265294 100644 --- a/python/subprojects/testbed/tests/res/out/seco/partial-heads_peak-lift-function.txt +++ b/python/subprojects/testbed/tests/res/out/seco/partial-heads_peak-lift-function.txt @@ -31,12 +31,12 @@ Subset Accuracy 17.86 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 58 local rules │ 64 │ 50.00% │ 50.00% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 58 local rules │ 64 │ 50.00% │ 50.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │ diff --git a/python/subprojects/testbed/tests/res/out/seco/single-label-heads.txt b/python/subprojects/testbed/tests/res/out/seco/single-label-heads.txt index a320ec304e..bb87fa17a7 100644 --- a/python/subprojects/testbed/tests/res/out/seco/single-label-heads.txt +++ b/python/subprojects/testbed/tests/res/out/seco/single-label-heads.txt @@ -31,12 +31,12 @@ Subset Accuracy 19.39 INFO Model characteristics: -┌───────────────────────────────┬─────────┬───────────────┬──────────────┬───────────────┬───────────────┐ -│ Statistics about conditions │ Total │ <= operator │ > operator │ == operator │ != operator │ -├───────────────────────────────┼─────────┼───────────────┼──────────────┼───────────────┼───────────────┤ -│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ -│ 61 local rules │ 68 │ 57.35% │ 42.65% │ 0.00% │ 0.00% │ -└───────────────────────────────┴─────────┴───────────────┴──────────────┴───────────────┴───────────────┘ +┌───────────────────────────────┬─────────┬─────────────────────────┬────────────────────────┬───────────────────────┬──────────────────────┬───────────────────────┬───────────────────────┐ +│ Statistics about conditions │ Total │ Numerical <= operator │ Numerical > operator │ Ordinal <= operator │ Ordinal > operator │ Nominal == operator │ Nominal != operator │ +├───────────────────────────────┼─────────┼─────────────────────────┼────────────────────────┼───────────────────────┼──────────────────────┼───────────────────────┼───────────────────────┤ +│ Default rule │ 0 │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +│ 61 local rules │ 68 │ 57.35% │ 42.65% │ 0.00% │ 0.00% │ 0.00% │ 0.00% │ +└───────────────────────────────┴─────────┴─────────────────────────┴────────────────────────┴───────────────────────┴──────────────────────┴───────────────────────┴───────────────────────┘ ┌────────────────────────────────┬─────────┬────────────┬────────────┐ │ Statistics about predictions │ Total │ Positive │ Negative │