public class BinarizeOperation extends java.lang.Object implements DatasetOperation
Constructor and Description |
---|
BinarizeOperation()
Creates a new BinarizeOperation with a threshold of 0.
|
BinarizeOperation(double threshold)
Creates a new BinarizeOperation with the specified threshold.
|
Modifier and Type | Method and Description |
---|---|
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.
|
double |
getThreshold()
Threshold for binarization
|
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.
|
Dataset |
run(Dataset input)
Binarizes a Dataset - elements less than the threshold are set to 0, elements greater than the threshold
are set to 1.
|
void |
setThreshold(double threshold)
Threshold for binarization
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, initPreviousVersion, initUnknownVersion, load, read, save, write
public BinarizeOperation(double threshold)
threshold
- binarization threshold.public BinarizeOperation()
public Dataset run(Dataset input)
run
in interface DatasetOperation
input
- input datasetpublic 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 double getThreshold()
public void setThreshold(double threshold)