Package weka.knowledgeflow.steps
Class Clusterer
java.lang.Object
weka.knowledgeflow.steps.BaseStep
weka.knowledgeflow.steps.WekaAlgorithmWrapper
weka.knowledgeflow.steps.Clusterer
- All Implemented Interfaces:
Serializable
,BaseStepExtender
,PairedDataHelper.PairedProcessor<Clusterer>
,Step
@KFStep(name="Clusterer",
category="Clusterers",
toolTipText="Weka clusterer wrapper",
iconPath="",
resourceIntensive=true)
public class Clusterer
extends WekaAlgorithmWrapper
implements PairedDataHelper.PairedProcessor<Clusterer>
Step that wraps a Weka clusterer. Handles trainingSet and testSet incoming
connections
- Version:
- $Revision: $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the clusterer to trainGet a list of connection types that could be made to this Step at this point in timeGet the name of the clusterer to load at execution time.Get a list of outgoing connections that could be made from this step at this point in timeGet the class of the wrapped algorithmvoid
processIncoming
(Data data) Process an incoming data objectprocessPrimary
(Integer setNum, Integer maxSetNum, Data data, PairedDataHelper<Clusterer> helper) Process a training split (primary data handled by the PairedDataHelper)void
processSecondary
(Integer setNum, Integer maxSetNum, Data data, PairedDataHelper<Clusterer> helper) Process a test split/fold (secondary data handled by PairedDataHelper)void
setClusterer
(Clusterer clusterer) Set the clusterer to trainvoid
setLoadClustererFileName
(File filename) Set the name of the clusterer to load at execution time.void
setWrappedAlgorithm
(Object algo) Set the wrapped algorithmvoid
stepInit()
Initialize the stepMethods inherited from class weka.knowledgeflow.steps.WekaAlgorithmWrapper
getDefaultIconPath, getDefaultPackageLevelIconPath, getIconPath, getWrappedAlgorithm, globalInfo
Methods inherited from class weka.knowledgeflow.steps.BaseStep
environmentSubstitute, getCustomEditorForStep, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, isResourceIntensive, isStopRequested, outputStructureForConnectionType, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stop
-
Constructor Details
-
Clusterer
public Clusterer()
-
-
Method Details
-
getClusterer
Get the clusterer to train- Returns:
- the clusterer to train
-
setClusterer
Set the clusterer to train- Parameters:
clusterer
- the clusterer to train
-
getLoadClustererFileName
Get the name of the clusterer to load at execution time. This only applies in the case where the only incoming connection is a test set connection (batch mode) or an instance connection (incremental prediction mode).- Returns:
- the name of the file to load the model from
-
setLoadClustererFileName
@OptionMetadata(displayName="Clusterer model to load", description="Optional path to a clusterer to load at execution time (only applies when using testSet connections)") @FilePropertyMetadata(fileChooserDialogType=0, directoriesOnly=false) public void setLoadClustererFileName(File filename) Set the name of the clusterer to load at execution time. This only applies in the case where the only incoming connection is a test set connection (batch mode) or an instance connection (incremental prediction mode).- Parameters:
filename
- the name of the file to load the model from
-
getWrappedAlgorithmClass
Get the class of the wrapped algorithm- Specified by:
getWrappedAlgorithmClass
in classWekaAlgorithmWrapper
- Returns:
- the class of the wrapped algorithm
-
setWrappedAlgorithm
Set the wrapped algorithm- Overrides:
setWrappedAlgorithm
in classWekaAlgorithmWrapper
- Parameters:
algo
- the algorithm to wrap
-
stepInit
Initialize the step- Specified by:
stepInit
in interfaceBaseStepExtender
- Specified by:
stepInit
in interfaceStep
- Throws:
WekaException
- if a problem occurs
-
processIncoming
Process an incoming data object- Specified by:
processIncoming
in interfaceBaseStepExtender
- Specified by:
processIncoming
in interfaceStep
- Overrides:
processIncoming
in classBaseStep
- Parameters:
data
- the data to process- Throws:
WekaException
- if a problem occurs
-
getIncomingConnectionTypes
Get a list of connection types that could be made to this Step at this point in time- Specified by:
getIncomingConnectionTypes
in interfaceBaseStepExtender
- Specified by:
getIncomingConnectionTypes
in interfaceStep
- Returns:
- a list of incoming connection types that could be made at this time
-
getOutgoingConnectionTypes
Get a list of outgoing connections that could be made from this step at this point in time- Specified by:
getOutgoingConnectionTypes
in interfaceBaseStepExtender
- Specified by:
getOutgoingConnectionTypes
in interfaceStep
- Returns:
- a list of outgoing connections that could be made at this point in time
-
processPrimary
public Clusterer processPrimary(Integer setNum, Integer maxSetNum, Data data, PairedDataHelper<Clusterer> helper) throws WekaException Process a training split (primary data handled by the PairedDataHelper)- Specified by:
processPrimary
in interfacePairedDataHelper.PairedProcessor<Clusterer>
- Parameters:
setNum
- the number of this split/foldmaxSetNum
- the maximum number of splits/folds in the groupdata
- the actual split/fold datahelper
- the PairedDataHelper managing the paired data- Returns:
- a Classifier trained on this training split
- Throws:
WekaException
- if a problem occurs
-
processSecondary
public void processSecondary(Integer setNum, Integer maxSetNum, Data data, PairedDataHelper<Clusterer> helper) throws WekaException Process a test split/fold (secondary data handled by PairedDataHelper)- Specified by:
processSecondary
in interfacePairedDataHelper.PairedProcessor<Clusterer>
- Parameters:
setNum
- the set number of this split/foldmaxSetNum
- the maximum number of splits/folds in the groupdata
- the actual split/fold datahelper
- the PairedDataHelper managing the paried data- Throws:
WekaException
- if a problem occurs
-