(C++)  1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::simulation::Dataset Class Reference

Public Member Functions

size_t DecisionVariablesCount () const
 Gets the number of measures (also know as considerations / decisions / columns in dataset). More...
 
const std::vector< DTConsiderationType > & GetConsiderationTypes () const
 Gets types of the respective consideration, in order of appearance. The types are either NUMERIC or NOMINAL. More...
 
const DTConsiderationType GetConsiderationType (int columnIndex) const
 Returns the type of the i-th consideration; i = columnIndex. More...
 
 Dataset (std::initializer_list< DTConsiderationType > considerationTypes)
 Creates a new dataset. More...
 
 Dataset (std::vector< DTConsiderationType > considerationTypes)
 Creates a new dataset. More...
 
void AddSample (std::unique_ptr< ISimulatedGameAction > decision, std::initializer_list< float > data)
 Constructs and insert new sample to the dataset. The sample is constructed using the and values for considerations ().
 
void AddSample (std::unique_ptr< ISimulatedGameAction > decision, std::vector< float > data)
 Constructs and insert new sample to the dataset. The sample is constructed using the and values for considerations ().
 
void AddSample (std::unique_ptr< DatasetSample > sample)
 Insert new sample to the dataset.
 
double ValidateBinary (DecisionNode< ISimulatedGameAction > &decisionTreeNodeRoot)
 Tests a decision tree (represented by the root node) against a dataset. Returns the accuracy of decision predictions vs. decisions that are in the dataset. More...
 
bool MoveFromOther (Dataset &sourceDataset)
 Moves samples from another dataset to the dataset this function was called on. It performs a basic check whether ConsiderationTypes are compatible between the two dataset. Warning: If succeeded, this will erase the sourceDataset. More...
 
bool CopyFromOther (Dataset &sourceDataset)
 Adds samples from another dataset to the dataset this function was called on. It performs a basic check whether ConsiderationTypes are compatible between the two dataset. More...
 

Public Attributes

std::vector< std::unique_ptr< DatasetSample > > Samples
 Data stored in Dataset. More...
 

Friends

class C45Algorithm
 

Constructor & Destructor Documentation

grail::simulation::Dataset::Dataset ( std::initializer_list< DTConsiderationType >  considerationTypes)

Creates a new dataset.

Parameters
considerationTypesData type {NUMERIC, NOMINAL} for the respective columns in the dataset.
grail::simulation::Dataset::Dataset ( std::vector< DTConsiderationType >  considerationTypes)

Creates a new dataset.

Parameters
considerationTypesData type {NUMERIC, NOMINAL} for the respective columns in the dataset.

Member Function Documentation

bool grail::simulation::Dataset::CopyFromOther ( Dataset sourceDataset)

Adds samples from another dataset to the dataset this function was called on. It performs a basic check whether ConsiderationTypes are compatible between the two dataset.

Parameters
sourceDatasetThe dataset to copy samples from.
Returns
TRUE: if samples been succesfully added. FALSE: when ConsiderationTypes are incompatible and therefore the data have not been added.
size_t grail::simulation::Dataset::DecisionVariablesCount ( ) const

Gets the number of measures (also know as considerations / decisions / columns in dataset).

const DTConsiderationType grail::simulation::Dataset::GetConsiderationType ( int  columnIndex) const

Returns the type of the i-th consideration; i = columnIndex.

const std::vector< DTConsiderationType > & grail::simulation::Dataset::GetConsiderationTypes ( ) const

Gets types of the respective consideration, in order of appearance. The types are either NUMERIC or NOMINAL.

bool grail::simulation::Dataset::MoveFromOther ( Dataset sourceDataset)

Moves samples from another dataset to the dataset this function was called on. It performs a basic check whether ConsiderationTypes are compatible between the two dataset. Warning: If succeeded, this will erase the sourceDataset.

Parameters
sourceDatasetThe dataset to move samples from.
Returns
TRUE: if samples been succesfully moved. FALSE: when ConsiderationTypes are incompatible and therefore the data have not been moved.
double grail::simulation::Dataset::ValidateBinary ( DecisionNode< ISimulatedGameAction > &  decisionTreeNodeRoot)

Tests a decision tree (represented by the root node) against a dataset. Returns the accuracy of decision predictions vs. decisions that are in the dataset.

Returns
Prediction accuracy.

Member Data Documentation

std::vector<std::unique_ptr<DatasetSample> > grail::simulation::Dataset::Samples

Data stored in Dataset.


The documentation for this class was generated from the following files: