This class is used to represent the predicted distribution made by a supervised learning algorithm. (It is just a shallow wrapper around GDistribution.) It is used in conjunction with calls to GSupervisedLearner::predictDistribution. The predicted distributions will be either categorical distributions (for nominal values) or Normal distributions (for continuous values).
More...
#include <GLearner.h>
|
static void | predictionArrayToVector (size_t nOutputCount, GPrediction *pOutputs, double *pVector) |
| Converts an array of prediction objects to a vector of most-likely values. More...
|
|
static void | vectorToPredictionArray (GRelation *pRelation, size_t nOutputCount, double *pVector, GPrediction *pOutputs) |
| Converts an array of values to an array of predictions. There's not really enough information for this conversion, so it simply fabricates the variance and class-probability information as needed. Only the mean (for normal distributions) and the most-likely class (for categorical distributions) is reliable after this conversion. More...
|
|
This class is used to represent the predicted distribution made by a supervised learning algorithm. (It is just a shallow wrapper around GDistribution.) It is used in conjunction with calls to GSupervisedLearner::predictDistribution. The predicted distributions will be either categorical distributions (for nominal values) or Normal distributions (for continuous values).
GClasses::GPrediction::GPrediction |
( |
| ) |
|
|
inline |
GClasses::GPrediction::~GPrediction |
( |
| ) |
|
Returns the current distribution. Throws if it is not a categorical distribution.
Returns the current distribution. Throws if it is not a normal distribution.
bool GClasses::GPrediction::isContinuous |
( |
| ) |
|
Returns true if this wraps a normal distribution, false otherwise.
If the current distribution is not a categorical distribution, then it replaces it with a new categorical distribution. Then it returns the current (categorical) distribution.
If the current distribution is not a normal distribution, then it replaces it with a new normal distribution. Then it returns the current (normal) distribution.
double GClasses::GPrediction::mode |
( |
| ) |
|
Returns the mode (most likely value). For the Normal distribution, this is the same as the mean.
static void GClasses::GPrediction::predictionArrayToVector |
( |
size_t |
nOutputCount, |
|
|
GPrediction * |
pOutputs, |
|
|
double * |
pVector |
|
) |
| |
|
static |
Converts an array of prediction objects to a vector of most-likely values.
static void GClasses::GPrediction::vectorToPredictionArray |
( |
GRelation * |
pRelation, |
|
|
size_t |
nOutputCount, |
|
|
double * |
pVector, |
|
|
GPrediction * |
pOutputs |
|
) |
| |
|
static |
Converts an array of values to an array of predictions. There's not really enough information for this conversion, so it simply fabricates the variance and class-probability information as needed. Only the mean (for normal distributions) and the most-likely class (for categorical distributions) is reliable after this conversion.