Package se.hb.jcp.nc

Class ClassifierNonconformityFunctionBase

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      double[] calc_nc​(cern.colt.matrix.DoubleMatrix2D x, double[] y)
      Deprecated.
      double[] calc_nc​(cern.colt.matrix.DoubleMatrix2D xtr, double[] ytr, cern.colt.matrix.DoubleMatrix1D xtest, double ytest)  
      abstract double calculateNonConformityScore​(cern.colt.matrix.DoubleMatrix1D x, double y)
      Computes the non-conformity score for the instance x with the target y.
      void fit​(cern.colt.matrix.DoubleMatrix2D x, double[] y)
      Initializes this non-conformity function with the supplied data.
      abstract IClassificationNonconformityFunction fitNew​(cern.colt.matrix.DoubleMatrix2D x, double[] y)
      Returns a new non-conformity function based on the same parameters as the current one initialized with the supplied data.
      IClassificationNonconformityFunction fitNew​(cern.colt.matrix.DoubleMatrix2D xtr, double[] ytr, cern.colt.matrix.DoubleMatrix1D xtest, double ytest)
      Returns a new non-conformity function based on the same parameters as the current one initialized with the supplied data.
      int getAttributeCount()
      Returns the number of attributes the classifier has been trained on.
      IClassifier getClassifier()
      Returns the classifier used by this non-conformity function.
      java.lang.Double[] getLabels()
      Returns the set of class labels the classifier has been trained on.
      boolean isTrained()
      Returns whether this classifier has been trained.
      cern.colt.matrix.DoubleMatrix1D nativeStorageTemplate()
      Returns a value of the DoubleMatrix1D derived class that is the native storage format for the classifier.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassifierNonconformityFunctionBase

        public ClassifierNonconformityFunctionBase​(double[] classes,
                                                   IClassifier classifier)
    • Method Detail

      • fitNew

        public IClassificationNonconformityFunction fitNew​(cern.colt.matrix.DoubleMatrix2D xtr,
                                                           double[] ytr,
                                                           cern.colt.matrix.DoubleMatrix1D xtest,
                                                           double ytest)
        Description copied from interface: IClassificationNonconformityFunction
        Returns a new non-conformity function based on the same parameters as the current one initialized with the supplied data.
        Specified by:
        fitNew in interface IClassificationNonconformityFunction
        Parameters:
        xtr - the training instances.
        ytr - the training targets or classes of the instances.
        xtest - the test instances.
        ytest - the test targets/classes/labels of the instances.
        Returns:
        a new non-conformity function.
      • calc_nc

        public double[] calc_nc​(cern.colt.matrix.DoubleMatrix2D xtr,
                                double[] ytr,
                                cern.colt.matrix.DoubleMatrix1D xtest,
                                double ytest)
        Specified by:
        calc_nc in interface IClassificationNonconformityFunction
      • isTrained

        public final boolean isTrained()
        Description copied from interface: IClassifierInformation
        Returns whether this classifier has been trained.
        Specified by:
        isTrained in interface IClassifierInformation
        Returns:
        Returns true if the classifier has been trained or false otherwise.
      • getAttributeCount

        public final int getAttributeCount()
        Description copied from interface: IClassifierInformation
        Returns the number of attributes the classifier has been trained on.
        Specified by:
        getAttributeCount in interface IClassifierInformation
        Returns:
        Returns the number of attributes the classifier has been trained on or -1 if the classifier has not been trained.
      • getLabels

        public final java.lang.Double[] getLabels()
        Description copied from interface: IClassifierInformation
        Returns the set of class labels the classifier has been trained on.
        Specified by:
        getLabels in interface IClassifierInformation
        Returns:
        Returns the class labels the classifier has been trained on in increasing order (the index is the class id) or null if the classifier has not been trained.
      • nativeStorageTemplate

        public cern.colt.matrix.DoubleMatrix1D nativeStorageTemplate()
        Description copied from interface: IClassifierInformation
        Returns a value of the DoubleMatrix1D derived class that is the native storage format for the classifier.
        Specified by:
        nativeStorageTemplate in interface IClassifierInformation
        Returns:
        a value of the DoubleMatrix1D derived class of the native storage format for the classifier.