edu.udo.cs.yale.operator.learner
Class DiscreteDistribution
java.lang.Object
edu.udo.cs.yale.operator.learner.DiscreteDistribution
- All Implemented Interfaces:
- Distribution
public class DiscreteDistribution
- extends java.lang.Object
- implements Distribution
DiscreteDistribution is an distribution for nominal values. For probability
calculation it counts the frequency of all values and returns this number + 1
of the given value divided by the total number of all examples + the
number of different values.
- Version:
- $Id$
- Author:
- Sebastian Land
Constructor Summary |
DiscreteDistribution(java.util.Set<java.lang.Double> possibleValues,
int possibleValueNumber,
java.util.Collection<java.lang.Double> allValues)
|
Method Summary |
double |
getProbability(double x)
This method returns the density of the given distribution at the specified value |
java.lang.String |
toString()
Should return an textual representation of the distribution. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
values
java.util.ArrayList<java.lang.Double> values
occurences
java.util.ArrayList<java.lang.Double> occurences
totalOccurences
int totalOccurences
totalValueNumber
int totalValueNumber
totalProbability
double totalProbability
DiscreteDistribution
public DiscreteDistribution(java.util.Set<java.lang.Double> possibleValues,
int possibleValueNumber,
java.util.Collection<java.lang.Double> allValues)
getProbability
public double getProbability(double x)
- Description copied from interface:
Distribution
- This method returns the density of the given distribution at the specified value
- Specified by:
getProbability
in interface Distribution
- Parameters:
x
- the value which density shall be returned
toString
public java.lang.String toString()
- Description copied from interface:
Distribution
- Should return an textual representation of the distribution.
- Specified by:
toString
in interface Distribution
- Overrides:
toString
in class java.lang.Object
Copyright © 2001-2006