public class SVMROIFinder extends java.lang.Object implements MLROIFinder
| Constructor and Description |
|---|
SVMROIFinder()
Default constructor.
|
SVMROIFinder(double C)
Constructor for a linear kernel SVM.
|
SVMROIFinder(double Cp,
double Cn)
Constructor for a linear kernel SVM.
|
SVMROIFinder(smile.math.kernel.MercerKernel<double[]> kernel,
double C)
Constructor.
|
SVMROIFinder(smile.math.kernel.MercerKernel<double[]> kernel,
double Cp,
double Cn)
Constructor.
|
SVMROIFinder(smile.classification.SVM model)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
double |
getC()
Retrieves the soft penalty parameter.
|
double |
getCn()
Retrieves the soft penalty parameter for negative samples.
|
double |
getCp()
Retrieves the soft penalty parameter for positive samples.
|
int |
getNumFeatures()
Returns the number of features
|
java.util.Map<java.lang.String,java.lang.Object> |
getObjectMap()
Creates a map of the important fields for the instance, suitable for serialization.
|
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
int |
getVersion()
Returns the current class version.
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
boolean |
isROI(Dataset dataset)
Examine a dataset and return whether or not it seems to contain a region of interest (ROI)
|
boolean |
isROI(double[] data)
Examine an array of data and report whether it appears to contain a region of interest (ROI)
|
double |
negativeClass()
The numeric label assigned to negative samples i.e.
|
void |
negativeClass(int negClass)
Sets the negative (i.e.
|
double |
positiveClass()
The numeric label assigned to positive samples i.e.
|
void |
positiveClass(int posClass)
Sets the positive (i.e.
|
double |
predict(Dataset data)
Returns the predicted class/value of the sample
|
double |
predict(double[] data)
Returns the predicted class/value of the sample
|
void |
train(double[][] X,
int[] y)
Trains the ROI finder on new data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initPreviousVersion, initUnknownVersion, load, read, save, writepublic SVMROIFinder(smile.math.kernel.MercerKernel<double[]> kernel,
double Cp,
double Cn)
kernel - kernel functionCp - soft margin penalty parameter for positive instances (0-1)Cn - soft margin penalty parameter for negative instances (0-1)public SVMROIFinder(smile.math.kernel.MercerKernel<double[]> kernel,
double C)
kernel - kernel functionC - soft margin penalty parameter (0-1). The larger the penalty the more the model will try to avoid
misclassification.public SVMROIFinder(double Cp,
double Cn)
Cp - soft margin penalty parameter for positive instances (0-1)Cn - soft margin penalty parameter for negative instances (0-1)public SVMROIFinder(double C)
C - soft margin penalty parameter (0-1). The larger the penalty the more the model will try to avoid
misclassification.public SVMROIFinder()
public SVMROIFinder(smile.classification.SVM model)
model - SVM modelpublic void train(double[][] X,
int[] y)
train in interface MLROIFinderX - N examples with M features per exampley - N labels for the N examples in Xpublic double predict(double[] data)
MLROIFinderpredict in interface MLROIFinderdata - sample to predictpublic double predict(Dataset data)
MLROIFinderpredict in interface MLROIFinderdata - sample to predictpublic void positiveClass(int posClass)
posClass - label of positive classpublic double positiveClass()
MLROIFinderpositiveClass in interface MLROIFinderpublic void negativeClass(int negClass)
negClass - label of negative class.public double negativeClass()
MLROIFindernegativeClass in interface MLROIFinderpublic long getSerializationVersion()
ObjectMapgetSerializationVersion in interface ObjectMappublic int getVersion()
ObjectMapgetVersion in interface ObjectMappublic java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMapgetObjectMap in interface ObjectMappublic void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMapinitCurrentVersion in interface ObjectMapobjectMap - object graph for initializationpublic boolean isROI(double[] data)
ROIFinderpublic boolean isROI(Dataset dataset)
ROIFinderpublic int getNumFeatures()
public double getCp()
public double getCn()
public double getC()