oracle.dmt.odm
Class PriorProbabilities

java.lang.Object
  |
  +--oracle.dmt.odm.MiningObject
        |
        +--oracle.dmt.odm.PriorProbabilities
All Implemented Interfaces:
java.io.Serializable

public class PriorProbabilities
extends MiningObject

An instance of PriorProbabilities contains prior probabilities corresponding to target values. Priors are an optional input for building classification models. A prior probability is assigned to each target class and used to overcome a known bias in the sampling procedure that was used to collect the data presented to the model.

For example, consider two target classes, responders and non-responders. Suppose that responders make up only 1% of population. For reasons of cost, convenience, or because of the rarity of the responders, the data might be collected such that it consists of 50% responders and 50% non-responders, thereby over-sampling the responder population. To correct this condition, the user may specify prior probabilities for each class when no known sampling bias exists, the user may specify the priors as NULL, indicating to the algorithm that the priors are to be constructed internally from the training table data.

Since:
9.2.0
See Also:
Serialized Form

Constructor Summary
PriorProbabilities()
          Creates an empty PriorProbabilities instance.
 
Method Summary
TypeMethod
 void addEntry(Category target, float probability)
          Adds a new prior probability for the target value.
 float getValue(Category target)
          Returns the prior probability value associated with the given target Category.
 Category[] listTargetValues()
          Lists all target Categories present in the PriorProbabilities instance.
 void validate()
          Validates the set of priors entries to ensure all probability values are between 0 and 1 and the total of all values is less than or equal to 1.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorProbabilities

public PriorProbabilities()
Creates an empty PriorProbabilities instance.
Method Detail

addEntry

public void addEntry(Category target,
                     float probability)
              throws ODMException
Adds a new prior probability for the target value.
Parameters:
target - target Category
probability - prior probability value of the given target
Throws:
ODMException
- target is null
- probability < 0 or probability > 1
- All targets do not have the same data type
- A duplicated entry is being added - sum of all probabilities > 1

getValue

public float getValue(Category target)
               throws ODMException
Returns the prior probability value associated with the given target Category.
Parameters:
target - target Category
Returns:
prior probability value of the given target
Throws:
ODMException
- no entry was found in the prior of the given target

validate

public void validate()
              throws ODMException
Validates the set of priors entries to ensure all probability values are between 0 and 1 and the total of all values is less than or equal to 1.
Throws:
ODMException
- prior probability value is null
- prior probability value < 0 or prior probability value > 1
- sum of all prior probability values > 1

listTargetValues

public Category[] listTargetValues()
Lists all target Categories present in the PriorProbabilities instance.
Returns:
an array of target Category in the prior