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, writableWriteToBytes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, initPreviousVersion, initUnknownVersion, load, read, save, write
predict_proba, predict_proba
public 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()
ObjectMap
public int getVersion()
ObjectMap
public java.util.Map<java.lang.String,java.lang.Object> getObjectMap()
ObjectMap
public void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMap
objectMap
- 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)