Class ClassifierMixin

  • Direct Known Subclasses:
    BaseNaiveBayes

    public abstract class ClassifierMixin
    extends Object
    Mixin class for all classifiers in scikit-learn.
    • Field Detail

      • classCounts

        protected NumpyArray<Double> classCounts
        The frequency of each class in the training set. Dimension: (class_count)
      • classes

        protected NumpyArray<Long> classes
        The list of class IDs. Dimension: (class_count)
    • Constructor Detail

      • ClassifierMixin

        public ClassifierMixin()
    • Method Detail

      • predict

        public abstract NumpyArray<Long> predict​(NumpyArray<Double> x)
        Perform classification on an array of test vectors X.
        Parameters:
        x - Array-like of shape (n_samples, n_features) The input samples.
        Returns:
        NumpyArray of shape (n_samples,) Predicted target values for X.
      • predictLogProbabilities

        public abstract NumpyArray<Double> predictLogProbabilities​(NumpyArray<Double> x)
        Return log-probability estimates for the test vector X.
        Parameters:
        x - array-like of shape (n_samples, n_features) The input samples.
        Returns:
        array-like of shape (n_samples, n_classes) Returns the log-probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute :term:`classes_`.
      • predictProbabilities

        public abstract NumpyArray<Double> predictProbabilities​(NumpyArray<Double> x)
        Return probability estimates for the test vector X.
        Parameters:
        x - array-like of shape (n_samples, n_features) The input samples.
        Returns:
        array-like of shape (n_samples, n_classes) Returns the probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute :term:`classes_`.
      • getFeatureNamesIn

        public String[] getFeatureNamesIn()
        Gets the feature names.
        Returns:
        The value of feature names.
      • setFeatureNamesIn

        public void setFeatureNamesIn​(String[] featureNamesIn)
        Sets the feature names.
        Parameters:
        featureNamesIn - New value to be stored.
      • getNumberOfFeatures

        public int getNumberOfFeatures()
        Gets the number of features.
        Returns:
        The value of number of features.
      • setNumberOfFeatures

        public void setNumberOfFeatures​(int numberOfFeatures)
        Sets the number of features.
        Parameters:
        numberOfFeatures - New value to be stored.
      • getClassCounts

        public NumpyArray<Double> getClassCounts()
        Gets the class counts.
        Returns:
        The value of class counts.
      • setClassCounts

        public void setClassCounts​(NumpyArray<Double> classCounts)
        Sets the class counts.
        Parameters:
        classCounts - New value to be stored.
      • getClasses

        public NumpyArray<Long> getClasses()
        Gets the classes.
        Returns:
        The value of classes.
      • setClasses

        public void setClasses​(NumpyArray<Long> classes)
        Sets the classes.
        Parameters:
        classes - New value to be stored.