## org.apache.mahout.clustering
Interface Model<O>

All Superinterfaces:
  org.apache.hadoop.io.Writable

All Known Subinterfaces:
  Cluster

All Known Implementing Classes:
  AbstractCluster, Canopy, DistanceMeasureCluster, Kluster, SoftCluster

    public interface Model<O>

extends org.apache.hadoop.io.Writable

A model is a probability distribution over observed data points and allows the probability of any data point to be computed. All Models have a persistent representation and extend WritablesampleFromPosterior(Model<VectorWritable>[])

Method Summary
`void` `computeParameters()` Compute a new set of posterior parameters based upon the Observations that have been observed since my creation
`long` `getNumObservations()` Return the number of observations that this model has seen since its parameters were last computed
`long` `getTotalObservations()` Return the number of observations that this model has seen over its lifetime
`void` `observe(Model<O> x)` Observe the given model, retaining information about its observations
`void` `observe(O x)` Observe the given observation, retaining information about it
`void` `observe(O x, double weight)` Observe the given observation, retaining information about it
`double` `pdf(O x)` Return the probability that the observation is described by this model
`Model<VectorWritable>` `sampleFromPosterior()`

Methods inherited from interface org.apache.hadoop.io.Writable
`readFields, write`

Method Detail

### pdf

    double pdf(O x)

  Return the probability that the observation is described by this model

  Parameters:
    `x` - an Observation from the posterior
  Returns:
    the probability that x is in the receiver

### observe

    void observe(O x)

  Observe the given observation, retaining information about it

  Parameters:
    `x` - an Observation from the posterior

### observe

    void observe(O x,
                 double weight)

  Observe the given observation, retaining information about it

  Parameters:
    `x` - an Observation from the posterior
    `weight` - a double weighting factor

### observe

    void observe(Model<O> x)

  Observe the given model, retaining information about its observations

  Parameters:
    `x` - a Model<0>

### computeParameters

    void computeParameters()

  Compute a new set of posterior parameters based upon the Observations that have been observed since my creation

### getNumObservations

    long getNumObservations()

  Return the number of observations that this model has seen since its parameters were last computed

  Returns:
    a long

### getTotalObservations

    long getTotalObservations()

  Return the number of observations that this model has seen over its lifetime

  Returns:
    a long

### sampleFromPosterior

    Model<VectorWritable> sampleFromPosterior()

  Returns:
    a sample of my posterior model

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