Package se.hb.jcp.nc
Interface IClassificationNonconformityFunction
-
- All Superinterfaces:
IClassifierInformation,java.io.Serializable
- All Known Implementing Classes:
AverageClassificationNonconformityFunction,ClassifierNonconformityFunctionBase,ClassProbabilityNonconformityFunctionBase,HingeLossNonconformityFunction,kNearestSameClassNeighbourNonconformityFunction,MarginNonconformityFunction,SVMDistanceNonconformityFunction
public interface IClassificationNonconformityFunction extends IClassifierInformation, java.io.Serializable
Represents an instance of a specific non-conformity function for conformal classification. Contract for JCP use: 1. The non-conformity function must be serializable, both as untrained and as trained. 2. The fitNew, calculateNonConformityScore and calc_nc methods of the non-conformity function must be reentrant.
-
-
Method Summary
All Methods Instance Methods Abstract 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 xtrain, double[] ytrain, cern.colt.matrix.DoubleMatrix1D xtest, double ytest)doublecalculateNonConformityScore(cern.colt.matrix.DoubleMatrix1D x, double y)Computes the non-conformity score for the instance x with the target y.voidfit(cern.colt.matrix.DoubleMatrix2D x, double[] y)Initializes this non-conformity function with the supplied data.IClassificationNonconformityFunctionfitNew(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.IClassificationNonconformityFunctionfitNew(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.IClassifiergetClassifier()Returns the classifier used by this non-conformity function.-
Methods inherited from interface se.hb.jcp.ml.IClassifierInformation
getAttributeCount, getLabels, isTrained, nativeStorageTemplate
-
-
-
-
Method Detail
-
fit
void fit(cern.colt.matrix.DoubleMatrix2D x, double[] y)Initializes this non-conformity function with the supplied data.- Parameters:
x- the instances.y- the targets/classes/labels of the instances.
-
fitNew
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.- Parameters:
x- the instances.y- the targets or classes of the instances.- Returns:
- a new non-conformity function.
-
fitNew
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.- 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
@Deprecated double[] calc_nc(cern.colt.matrix.DoubleMatrix2D x, double[] y)Deprecated.
-
calc_nc
double[] calc_nc(cern.colt.matrix.DoubleMatrix2D xtrain, double[] ytrain, cern.colt.matrix.DoubleMatrix1D xtest, double ytest)
-
calculateNonConformityScore
double calculateNonConformityScore(cern.colt.matrix.DoubleMatrix1D x, double y)Computes the non-conformity score for the instance x with the target y.- Parameters:
x- the instance.y- the target/class/label.- Returns:
- the non-conformity score. Large means less conforming.
-
getClassifier
IClassifier getClassifier()
Returns the classifier used by this non-conformity function.- Returns:
- the classifier used by this non-conformity function; or null if there isn't one.
-
-