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, wait
init, initPreviousVersion, initUnknownVersion, load, read, save, write
public 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 MLROIFinder
X
- N examples with M features per exampley
- N labels for the N examples in Xpublic double predict(double[] data)
MLROIFinder
predict
in interface MLROIFinder
data
- sample to predictpublic double predict(Dataset data)
MLROIFinder
predict
in interface MLROIFinder
data
- sample to predictpublic void positiveClass(int posClass)
posClass
- label of positive classpublic double positiveClass()
MLROIFinder
positiveClass
in interface MLROIFinder
public void negativeClass(int negClass)
negClass
- label of negative class.public double negativeClass()
MLROIFinder
negativeClass
in interface MLROIFinder
public long getSerializationVersion()
ObjectMap
getSerializationVersion
in interface ObjectMap
public int getVersion()
ObjectMap
getVersion
in interface ObjectMap
public java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMap
getObjectMap
in interface ObjectMap
public void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMap
initCurrentVersion
in interface ObjectMap
objectMap
- object graph for initializationpublic boolean isROI(double[] data)
ROIFinder
public boolean isROI(Dataset dataset)
ROIFinder
public int getNumFeatures()
public double getCp()
public double getCn()
public double getC()