public final class SVMLearner extends ExecutableOperator implements RecordSinkOperator
PMMLSupportVectorMachineModel
from an input dataset.
NOTE: This operator is implemented as a wrapper for
LIBSVM. Please refer to
the LIBSVM
documentation for additional information regarding the parameters.
NOTE: this operator is non-parallel
Constructor and Description |
---|
SVMLearner()
Learns an SVM model from a training dataset.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to the following contracts
|
protected void |
execute(ExecutionContext ctx)
Executes the operator.
|
double |
getEpsilon()
Returns the tolerance for termination criteria.
|
List<String> |
getIncludedColumns()
Returns the list of columns to include for the purpose of building
the model.
|
RecordPort |
getInput()
The input data.
|
KernelType |
getKernelType()
Returns the kernel and associated parameters to use.
|
PMMLPort |
getModel()
Returns a dataflow variable that will contain the PMML model.
|
double |
getSvmCacheSizeMB()
Returns the cache size.
|
SVMType |
getType()
Returns the type of SVM model to build.
|
static boolean |
isSilent()
Our default SVM library will send regular status reports to System.out.
|
void |
setEpsilon(double epsilon)
Sets the tolerance for termination criteria.
|
void |
setIncludedColumns(List<String> includedColumns)
Sets the list of columns to include.
|
void |
setKernelType(KernelType kernelType)
Sets the kernel and associated parameters to use.
|
static void |
setSilent(boolean quiet)
Our default SVM library will send regular status reports to System.out.
|
void |
setSvmCacheSizeMB(double svmCacheSizeMB)
Sets the cache size.
|
void |
setType(SVMType type)
Sets the type of SVM model to build.
|
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutput
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public PMMLPort getModel()
public RecordPort getInput()
SVMPredictorType
.getInput
in interface RecordSinkOperator
getInput
in interface SinkOperator<RecordPort>
public static void setSilent(boolean quiet)
quiet
- true if this SVMLearner will suppress libSVM's console output; false if it shouldn't.public static boolean isSilent()
public List<String> getIncludedColumns()
double
.public void setIncludedColumns(List<String> includedColumns)
double
.includedColumns
- The list of columns to includepublic final KernelType getKernelType()
public final void setKernelType(KernelType kernelType)
kernelType
- the kernel and associated parameters to use.public double getEpsilon()
LIBSVM
"-e" command line flag.public void setEpsilon(double epsilon)
LIBSVM
"-e" command line flag.epsilon
- the tolerance for termination criteriapublic SVMType getType()
SVMTypeOneClass
.public void setType(SVMType type)
SVMTypeOneClass
.type
- the type of SVM model to build.public double getSvmCacheSizeMB()
LIBSVM
"-m" command line flag.public void setSvmCacheSizeMB(double svmCacheSizeMB)
LIBSVM
"-m" command line flag.svmCacheSizeMB
- the cache size.protected void computeMetadata(StreamingMetadataContext ctx)
StreamingOperator
StreamingMetadataContext.parallelize(ParallelismStrategy)
.
RecordPort#setRequiredDataOrdering
, otherwise data may arrive in any order.
RecordPort#setRequiredDataDistribution
, otherwise data will arrive in an unspecified partial distribution
.
RecordPort#getSourceDataDistribution
and RecordPort#getSourceDataOrdering
. These should be
viewed as a hints to help chose a more efficient algorithm. In such cases, though, operators must
still declare data ordering and data distribution requirements; otherwise there is no guarantee that
data will arrive sorted/distributed as required.
RecordPort#setType
.RecordPort#setOutputDataOrdering
RecordPort#setOutputDataDistribution
AbstractModelPort#setMergeHandler
.MergeModel
is a convenient, re-usable model reducer, parameterized with
a merge-handler.
SimpleModelPort
's have no associated metadata and therefore there is
never any output metadata to declare. PMMLPort
's, on the other hand,
do have associated metadata. For all PMMLPorts, implementations must declare
the following:
PMMLPort.setPMMLModelSpec
.
computeMetadata
in class StreamingOperator
ctx
- the contextprotected void execute(ExecutionContext ctx)
ExecutableOperator
execute
in class ExecutableOperator
ctx
- context in which to lookup physical ports bound to logical portsCopyright © 2021 Actian Corporation. All rights reserved.