weka.knowledgeflow.steps

## Class Clusterer

- java.lang.Object
- - weka.knowledgeflow.steps.BaseStep
  - - weka.knowledgeflow.steps.WekaAlgorithmWrapper
    - - weka.knowledgeflow.steps.Clusterer

- All Implemented Interfaces:
    java.io.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:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Clusterer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Clusterer` | `getClusterer()` Get the clusterer to train
    `java.util.List<java.lang.String>` | `getIncomingConnectionTypes()` Get a list of connection types that could be made to this Step at this point in time
    `java.io.File` | `getLoadClustererFileName()` Get the name of the clusterer to load at execution time.
    `java.util.List<java.lang.String>` | `getOutgoingConnectionTypes()` Get a list of outgoing connections that could be made from this step at this point in time
    `java.lang.Class` | `getWrappedAlgorithmClass()` Get the class of the wrapped algorithm
    `void` | `processIncoming(Data data)` Process an incoming data object
    `Clusterer` | `processPrimary(java.lang.Integer setNum, java.lang.Integer maxSetNum, Data data, PairedDataHelper<Clusterer> helper)` Process a training split (primary data handled by the PairedDataHelper)
    `void` | `processSecondary(java.lang.Integer setNum, java.lang.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 train
    `void` | `setLoadClustererFileName(java.io.File filename)` Set the name of the clusterer to load at execution time.
    `void` | `setWrappedAlgorithm(java.lang.Object algo)` Set the wrapped algorithm
    `void` | `stepInit()` Initialize the step

    - ### Methods 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, setName, setStepIsResourceIntensive, setStepManager, start, stop`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Clusterer

          public Clusterer()

  - ### Method Detail

    - #### getClusterer

          public Clusterer getClusterer()

      Get the clusterer to train
      Returns:
        the clusterer to train

    - #### setClusterer

          @ProgrammaticProperty
          public void setClusterer(Clusterer clusterer)

      Set the clusterer to train
      Parameters:
        `clusterer` - the clusterer to train

    - #### getLoadClustererFileName

          public java.io.File 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(java.io.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

          public java.lang.Class getWrappedAlgorithmClass()

      Get the class of the wrapped algorithm
      Specified by:
        `getWrappedAlgorithmClass` in class `WekaAlgorithmWrapper`
      Returns:
        the class of the wrapped algorithm

    - #### setWrappedAlgorithm

          public void setWrappedAlgorithm(java.lang.Object algo)

      Set the wrapped algorithm
      Overrides:
        `setWrappedAlgorithm` in class `WekaAlgorithmWrapper`
      Parameters:
        `algo` - the algorithm to wrap

    - #### stepInit

          public void stepInit()
                        throws WekaException

      Initialize the step
      Specified by:
        `stepInit` in interface `BaseStepExtender`
      Specified by:
        `stepInit` in interface `Step`
      Throws:
        `WekaException` - if a problem occurs

    - #### processIncoming

          public void processIncoming(Data data)
                               throws WekaException

      Process an incoming data object
      Specified by:
        `processIncoming` in interface `BaseStepExtender`
      Specified by:
        `processIncoming` in interface `Step`
      Overrides:
        `processIncoming` in class `BaseStep`
      Parameters:
        `data` - the data to process
      Throws:
        `WekaException` - if a problem occurs

    - #### getIncomingConnectionTypes

          public java.util.List<java.lang.String> getIncomingConnectionTypes()

      Get a list of connection types that could be made to this Step at this point in time
      Specified by:
        `getIncomingConnectionTypes` in interface `BaseStepExtender`
      Specified by:
        `getIncomingConnectionTypes` in interface `Step`
      Returns:
        a list of incoming connection types that could be made at this time

    - #### getOutgoingConnectionTypes

          public java.util.List<java.lang.String> getOutgoingConnectionTypes()

      Get a list of outgoing connections that could be made from this step at this point in time
      Specified by:
        `getOutgoingConnectionTypes` in interface `BaseStepExtender`
      Specified by:
        `getOutgoingConnectionTypes` in interface `Step`
      Returns:
        a list of outgoing connections that could be made at this point in time

    - #### processPrimary

          public Clusterer processPrimary(java.lang.Integer setNum,
                                          java.lang.Integer maxSetNum,
                                          Data data,
                                          PairedDataHelper<Clusterer> helper)
                                   throws WekaException

      Process a training split (primary data handled by the PairedDataHelper)
      Specified by:
        `processPrimary` in interface `PairedDataHelper.PairedProcessor<Clusterer>`
      Parameters:
        `setNum` - the number of this split/fold
        `maxSetNum` - the maximum number of splits/folds in the group
        `data` - the actual split/fold data
        `helper` - the PairedDataHelper managing the paired data
      Returns:
        a Classifier trained on this training split
      Throws:
        `WekaException` - if a problem occurs

    - #### processSecondary

          public void processSecondary(java.lang.Integer setNum,
                                       java.lang.Integer maxSetNum,
                                       Data data,
                                       PairedDataHelper<Clusterer> helper)
                                throws WekaException

      Process a test split/fold (secondary data handled by PairedDataHelper)
      Specified by:
        `processSecondary` in interface `PairedDataHelper.PairedProcessor<Clusterer>`
      Parameters:
        `setNum` - the set number of this split/fold
        `maxSetNum` - the maximum number of splits/folds in the group
        `data` - the actual split/fold data
        `helper` - the PairedDataHelper managing the paried data
      Throws:
        `WekaException` - if a problem occurs