## org.apache.mahout.clustering.iterator
Class AbstractClusteringPolicy

    java.lang.Object
      org.apache.mahout.clustering.iterator.AbstractClusteringPolicy

All Implemented Interfaces:
  org.apache.hadoop.io.Writable, ClusteringPolicy

Direct Known Subclasses:
  CanopyClusteringPolicy, FuzzyKMeansClusteringPolicy, KMeansClusteringPolicy

    public abstract class AbstractClusteringPolicy

extends Object
implements ClusteringPolicy

Constructor Summary
`AbstractClusteringPolicy()`

Method Summary
`Vector` `classify(Vector data, ClusterClassifier prior)` Classify the data vector given the classifier's models
`void` `close(ClusterClassifier posterior)` Close the policy using the classifier's models
`abstract void` `readFields(DataInput in)`
`Vector` `select(Vector probabilities)` Return a vector of weights for each of the models given those probabilities
`void` `update(ClusterClassifier posterior)` Update the policy with the given classifier
`abstract void` `write(DataOutput out)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractClusteringPolicy

    public AbstractClusteringPolicy()

Method Detail

### write

    public abstract void write(DataOutput out)
                        throws IOException

  Specified by:
    `write` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `IOException`

### readFields

    public abstract void readFields(DataInput in)
                             throws IOException

  Specified by:
    `readFields` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `IOException`

### select

    public Vector select(Vector probabilities)

  Description copied from interface: `ClusteringPolicy`
  Return a vector of weights for each of the models given those probabilities

  Specified by:
    `select` in interface `ClusteringPolicy`
  Parameters:
    `probabilities` - a Vector of pdfs
  Returns:
    a Vector of weights

### update

    public void update(ClusterClassifier posterior)

  Description copied from interface: `ClusteringPolicy`
  Update the policy with the given classifier

  Specified by:
    `update` in interface `ClusteringPolicy`
  Parameters:
    `posterior` - a ClusterClassifier

### classify

    public Vector classify(Vector data,
                           ClusterClassifier prior)

  Description copied from interface: `ClusteringPolicy`
  Classify the data vector given the classifier's models

  Specified by:
    `classify` in interface `ClusteringPolicy`
  Parameters:
    `data` - a data Vector
    `prior` - a prior ClusterClassifier
  Returns:
    a Vector of probabilities that the data is described by each of the models

### close

    public void close(ClusterClassifier posterior)

  Description copied from interface: `ClusteringPolicy`
  Close the policy using the classifier's models

  Specified by:
    `close` in interface `ClusteringPolicy`
  Parameters:
    `posterior` - a posterior ClusterClassifier

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.