Grail (C#)
1.2.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
Container for data in form of [consideration_values][decision], where consideration values are [float, float,...,float] and decision is TDecisionType. USe it for training the decision tree. More...
Public Member Functions | |
Dataset (params DecisionConsiderationType[] considerationTypes) | |
Creates a new dataset. More... | |
bool | MoveFromOther (Dataset< TDecisionType > 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 (in Dataset< TDecisionType > 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... | |
double | ValidateBinary (DecisionNode< TDecisionType > rootNode) |
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... | |
void | WriteToFile (IDecisionStringSerializer< TDecisionType > decisionSerializer, StreamWriter writer) |
Use this method to serialize content of the Dataset to the file. More... | |
void | ReadFromFile (IDecisionStringSerializer< TDecisionType > decisionSerializer, StreamReader reader) |
Use this method to read the Dataset content from a file. More... | |
Public Attributes | |
int | DecisionVariablesCount => ConsiderationTypes.Length |
The number of measures (also know as considerations / decisions / columns in dataset). More... | |
Properties | |
DecisionConsiderationType [] | ConsiderationTypes [get] |
Gets types of the respective consideration, in order of appearance. The types are either NUMERIC or NOMINAL. More... | |
List< DatasetSample< TDecisionType > > | Samples [get] |
Data stored in Dataset. More... | |
DatasetSample< TDecisionType > | this[int index] [get] |
Container for data in form of [consideration_values][decision], where consideration values are [float, float,...,float] and decision is TDecisionType. USe it for training the decision tree.
TDecisionType |
|
inline |
Creates a new dataset.
considerationTypes | Data type {NUMERIC, NOMINAL} for the respective columns in the dataset. |
|
inline |
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.
sourceDataset | The dataset to copy samples from. |
|
inline |
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.
sourceDataset | The dataset to move samples from. |
|
inline |
Use this method to read the Dataset content from a file.
decisionSerializer | Provide instance of a class responsible for serialization of the decision type to string. The decision is in each dataset sample. |
reader | A standard .NET StreamReader object |
|
inline |
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.
|
inline |
Use this method to serialize content of the Dataset to the file.
decisionSerializer | Provide instance of a class responsible for serialization of the decision type to string. The decision is in each dataset sample. |
writer | A standard .NET StreamWriter object |
int Grail.SimulatedGames.OfflineLearning.Dataset< TDecisionType >.DecisionVariablesCount => ConsiderationTypes.Length |
The number of measures (also know as considerations / decisions / columns in dataset).
|
get |
Gets types of the respective consideration, in order of appearance. The types are either NUMERIC or NOMINAL.
|
get |