Sleipnir
|
Encapsulates a CPCL paired with a quantization file. More...
#include <datapair.h>
Public Member Functions | |
bool | Open (const char *szDatafile, size_t iSkip) |
Open the given data file as a PCL and load discretization bin edges from an accompanying QUANT file. | |
size_t | Quantize (float dValue, size_t iExperiment) const |
Return the discretized form of the given value using the PCL pair's current bin edges. | |
void | Quantize () |
unsigned char | GetValues (size_t iExperiment) const |
Returns the number of discrete values taken by this PCL pair. |
Encapsulates a CPCL paired with a quantization file.
A PCL pair consists of a CPCL paired with quantization information. This information is generally stored in a QUANT file with the same name and location as the PCL. For example, a PCL file named data.pcl
and a QUANT file named data.quant
might reside in the same directory; these would be loaded together as a CPCLPair. The discretization information from the QUANT can be used to convert continuous values in the PCL into discrete values, e.g. for use with a Bayes net.
Unlike a CDataPair, a PCL's QUANT file should contain one line per experiment. Each line is the equivalent of one standard QUANT file, i.e. it contains tab delimited bin edges in increasing order, the largest of which is ignored. This allows the values for individual experiments to be discretized differently if so desired.
Definition at line 192 of file datapair.h.
unsigned char Sleipnir::CPCLPair::GetValues | ( | size_t | iExperiment | ) | const [inline] |
Returns the number of discrete values taken by this PCL pair.
Definition at line 211 of file datapair.h.
bool Sleipnir::CPCLPair::Open | ( | const char * | szDatafile, |
size_t | iSkip | ||
) |
Open the given data file as a PCL and load discretization bin edges from an accompanying QUANT file.
szDatafile | Filename from which PCL is loaded. |
iSkip | Number of columns to skip between the ID and experiments. |
Definition at line 464 of file datapair.cpp.
References Sleipnir::CPCL::GetExperiments(), and Sleipnir::CPCL::Open().
size_t Sleipnir::CPCLPair::Quantize | ( | float | dValue, |
size_t | iExperiment | ||
) | const |
Return the discretized form of the given value using the PCL pair's current bin edges.
dValue | Continuous value to be discretized. |
iExperiment | Experiment index whose bin edges should be used for discretization. |
Definition at line 505 of file datapair.cpp.
References Sleipnir::CMeta::Quantize().