public class PassiveAggressiveROIFinder extends MLROIConfFinder
confThr| Constructor and Description |
|---|
PassiveAggressiveROIFinder()
Creates a new PassiveAggressiveROIFinder with a learning rate of 0.1.
|
PassiveAggressiveROIFinder(double learningRate)
Creates a new PassiveAggressiveROIFinder with the specified learning rate.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.mahout.math.Vector |
classify(org.apache.mahout.math.DenseVector d) |
double |
getLearningRate()
Returns the current learning rate.
|
org.apache.mahout.classifier.sgd.PassiveAggressive |
getModel()
Returns the current model.
|
int |
getNumCategories()
Returns the number of labels known by the current model.
|
int |
getNumFeatures()
Get the number of features in the data i.e.
|
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)
Predict if a sample contains a region of interest.
|
boolean |
isROI(double[] data)
Predict if a sample contains a region of interest.
|
void |
legacyRead(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input) |
void |
legacyWrite(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output) |
double |
negativeClass()
Returns the numeric value of the negative class of a two-category model.
|
double |
positiveClass()
Returns the numeric value of the positive class of a two-category model.
|
void |
setLearningRate(double learningRate)
Sets the learning rate.
|
void |
setModel(org.apache.mahout.classifier.sgd.PassiveAggressive model)
Sets the ROI model.
|
void |
setNumCategories(int numCategories)
Sets the number of categories for the model.
|
void |
setNumFeatures(int numFeatures)
Sets the number of features in the sample data.
|
void |
train(double[][] X,
int[] y)
Incrementally trains the model with new samples, creating the model if required.
|
getConfidenceThreshold, predict, predict, setConfidenceThreshold, writableWriteToBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initPreviousVersion, initUnknownVersion, load, read, save, writepredict_proba, predict_probapublic PassiveAggressiveROIFinder(double learningRate)
learningRate - learning ratepublic PassiveAggressiveROIFinder()
public void train(double[][] X,
int[] y)
X - N examples with M features per exampley - N labels for the N examples in Xpublic double positiveClass()
public double negativeClass()
public boolean isROI(double[] data)
data - data to examinepublic boolean isROI(Dataset dataset)
dataset - data to examinepublic long getSerializationVersion()
ObjectMappublic int getVersion()
ObjectMappublic java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMappublic void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMapobjectMap - object graph for initializationpublic int getNumCategories()
public void setNumCategories(int numCategories)
numCategories - number of categoriespublic int getNumFeatures()
public void setNumFeatures(int numFeatures)
numFeatures - number of features in the datapublic org.apache.mahout.classifier.sgd.PassiveAggressive getModel()
public void setModel(org.apache.mahout.classifier.sgd.PassiveAggressive model)
model - model to predict regions of interestpublic double getLearningRate()
public void setLearningRate(double learningRate)
learningRate - new learning ratepublic void legacyWrite(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output output)
public void legacyRead(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input)
public org.apache.mahout.math.Vector classify(org.apache.mahout.math.DenseVector d)