Vita
|
Provides a GP-specific interface to the generic problem
class.
More...
#include <problem.h>
Inherits vita::problem.
Classes | |
struct | default_symbols_t |
Public Member Functions | |
unsigned | categories () const |
unsigned | classes () const |
bool | classification () const |
Just a shorthand for checking number of classes. More... | |
dataframe & | data (dataset_t=dataset_t::training) |
const dataframe & | data (dataset_t=dataset_t::training) const |
bool | is_valid () const override |
bool | operator! () const |
std::size_t | setup_symbols (const std::filesystem::path &, typing=typing::weak) |
Sets up the symbol set. More... | |
std::size_t | setup_symbols (typing=typing::weak) |
Sets up the symbol set. More... | |
void | setup_terminals (typing) |
Inserts variables and states for nominal attributes into the symbol_set. More... | |
src_problem () | |
New empty instance of src_problem. More... | |
src_problem (const std::filesystem::path &, const default_symbols_t &, typing=typing::weak) | |
Initializes the problem with the default symbol set and data coming from a file. More... | |
src_problem (const std::filesystem::path &, const std::filesystem::path &, typing=typing::weak) | |
Initializes the problem with data / symbols coming from input files. More... | |
src_problem (const std::filesystem::path &, typing=typing::weak) | |
Initializes problem dataset with examples coming from a file. More... | |
src_problem (std::istream &, typing=typing::weak) | |
Initializes problem dataset with examples coming from a file. More... | |
unsigned | variables () const |
Public Member Functions inherited from vita::problem | |
template<class S , class ... Args> | |
symbol * | insert (Args &&... args) |
Adds a symbol to the internal symbol set. More... | |
template<class S , class ... Args> | |
symbol * | insert (Args &&...) |
virtual bool | is_valid () const |
problem () | |
A new problem. More... | |
Static Public Attributes | |
static const default_symbols_t | default_symbols = {} |
Additional Inherited Members | |
Public Attributes inherited from vita::problem | |
environment | env |
symbol_set | sset |
Provides a GP-specific interface to the generic problem
class.
The class is a facade that provides a simpler interface to represent symbolic regression / classification tasks.
Definition at line 43 of file gp/src/problem.h.
vita::src_problem::src_problem | ( | ) |
New empty instance of src_problem.
Definition at line 79 of file gp/src/problem.cc.
|
explicit |
Initializes problem dataset with examples coming from a file.
[in] | ds | name of the dataset file (CSV or XRFF format) |
[in] | t | weak or strong typing |
Definition at line 96 of file gp/src/problem.cc.
|
explicit |
Initializes problem dataset with examples coming from a file.
[in] | ds | dataset |
[in] | t | weak or strong typing |
Definition at line 123 of file gp/src/problem.cc.
vita::src_problem::src_problem | ( | const std::filesystem::path & | ds, |
const default_symbols_t & | , | ||
typing | t = typing::weak |
||
) |
Initializes the problem with the default symbol set and data coming from a file.
[in] | ds | name of the dataset file |
[in] | t | weak or strong typing |
Mainly useful for simple problems (single category regression / classification) or for the initial approach.
Definition at line 146 of file gp/src/problem.cc.
vita::src_problem::src_problem | ( | const std::filesystem::path & | ds, |
const std::filesystem::path & | symbols, | ||
typing | t = typing::weak |
||
) |
Initializes the problem with data / symbols coming from input files.
[in] | ds | name of the training dataset file |
[in] | symbols | name of the file containing the symbols to be used. |
[in] | t | weak or strong typing |
Definition at line 159 of file gp/src/problem.cc.
unsigned vita::src_problem::categories | ( | ) | const |
>= 1
) Definition at line 470 of file gp/src/problem.cc.
unsigned vita::src_problem::classes | ( | ) | const |
== 0
for a symbolic regression problem, > 1
for a classification problem) Definition at line 479 of file gp/src/problem.cc.
|
inline |
Just a shorthand for checking number of classes.
Definition at line 70 of file gp/src/problem.h.
[in] | t | a dataset type |
Definition at line 497 of file gp/src/problem.cc.
[in] | t | a dataset type |
Definition at line 506 of file gp/src/problem.cc.
|
overridevirtual |
true
if the object passes the internal consistency check Reimplemented from vita::problem.
Definition at line 514 of file gp/src/problem.cc.
bool vita::src_problem::operator! | ( | ) | const |
false
if the current problem isn't ready for a run Definition at line 177 of file gp/src/problem.cc.
std::size_t vita::src_problem::setup_symbols | ( | const std::filesystem::path & | file, |
typing | t = typing::weak |
||
) |
Sets up the symbol set.
[in] | file | name of the file containing the symbols |
If a file isn't specified, a predefined set is arranged (useful for simple problems: single category regression / classification).
Definition at line 274 of file gp/src/problem.cc.
std::size_t vita::src_problem::setup_symbols | ( | typing | t = typing::weak | ) |
Sets up the symbol set.
[in] | t | weak or strong typing |
A predefined set is arranged (useful for simple problems: single category regression / classification).
Definition at line 256 of file gp/src/problem.cc.
void vita::src_problem::setup_terminals | ( | typing | t | ) |
Inserts variables and states for nominal attributes into the symbol_set.
[in] | t | weak or strong typing |
`std::data_format` | unsupported state domain |
There is one variable for each feature.
The names used for variables, if not specified in the dataset, are in the form X1
, ... Xn
.
Definition at line 194 of file gp/src/problem.cc.
unsigned vita::src_problem::variables | ( | ) | const |
Definition at line 488 of file gp/src/problem.cc.
|
static |
Definition at line 53 of file gp/src/problem.h.