public class GradMachineROIFinder extends MLROIConfFinder
confThr
Constructor and Description |
---|
GradMachineROIFinder()
Default no-arg constructor for serialization
|
GradMachineROIFinder(int numCats)
Constructor.
|
GradMachineROIFinder(int numCats,
int numHidden,
double learningRate,
double sparsity,
double regularization)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.apache.mahout.math.Vector |
classify(org.apache.mahout.math.DenseVector d) |
double |
getLearningRate() |
org.apache.mahout.classifier.sgd.GradientMachine |
getModel() |
int |
getNumCategories() |
int |
getNumFeatures() |
int |
getNumHidden() |
java.util.Map<java.lang.String,java.lang.Object> |
getObjectMap()
Creates a map of the important fields for the instance, suitable for serialization.
|
double |
getRegularization() |
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
double |
getSparsity() |
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)
|
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()
The numeric label assigned to negative samples i.e.
|
double |
positiveClass()
The numeric label assigned to positive samples i.e.
|
void |
setModel(org.apache.mahout.classifier.sgd.GradientMachine model) |
void |
train(double[][] X,
int[] y)
Trains the flaw finder on new data.
|
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 GradMachineROIFinder()
public GradMachineROIFinder(int numCats, int numHidden, double learningRate, double sparsity, double regularization)
numCats
- number of categories in the datanumHidden
- number of nodes in the hidden layerlearningRate
- learning rate (0-1)sparsity
- sparsity of hidden layer (0-1)regularization
- reqularization of weight vectorpublic GradMachineROIFinder(int numCats)
numCats
- number of categories in the datapublic void train(double[][] X, int[] y) throws java.lang.Exception
X
- N examples with M features per exampley
- N labels for the N examples in Xjava.lang.Exception
- if an error occurspublic double positiveClass()
public double negativeClass()
public boolean isROI(double[] data)
data
- raw 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 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)
public org.apache.mahout.classifier.sgd.GradientMachine getModel()
public void setModel(org.apache.mahout.classifier.sgd.GradientMachine model)
public int getNumFeatures()
public int getNumCategories()
public int getNumHidden()
public double getLearningRate()
public double getSparsity()
public double getRegularization()