Vita
Public Member Functions | List of all members
vita::category_set Class Reference

Information about the set of categories used in a specific problem. More...

#include <category_set.h>

Public Member Functions

auto begin () const
 
const category_infocategory (category_t) const
 
 category_set (const dataframe::columns_info &, typing=typing::weak)
 Builds a category_set extracting data from a columns_info object. More...
 
const category_infocolumn (const std::string &) const
 
const category_infocolumn (std::size_t) const
 
auto end () const
 
bool is_valid () const
 
std::set< category_tused_categories () const
 

Detailed Description

Information about the set of categories used in a specific problem.

More fine grained data types are required for Strongly Typed Genetic Programming: i.e. not just double but possibly multiple categories (category_t) that are subset of a d_double domain_t. Categories avoid mixing 3 Km/h with 4 Kg (in simple cases there is only one category for each domain).

The src_problem class uses a category_set object for creating the symbol set.

See also
https://github.com/morinim/vita/wiki/bibliography#14

Definition at line 67 of file category_set.h.

Constructor & Destructor Documentation

◆ category_set()

vita::category_set::category_set ( const dataframe::columns_info cols,
typing  t = typing::weak 
)
explicit

Builds a category_set extracting data from a columns_info object.

Parameters
[in]colscolumns of a dataframe
[in]tweak or strong (see typing)

Definition at line 30 of file category_set.cc.

Member Function Documentation

◆ begin()

auto vita::category_set::begin ( ) const
inline

Definition at line 80 of file category_set.h.

◆ category()

const category_info & vita::category_set::category ( category_t  category) const
Parameters
[in]categorya category
Returns
information about column 'category'

Definition at line 64 of file category_set.cc.

◆ column() [1/2]

const category_info & vita::category_set::column ( const std::string &  name) const
Parameters
[in]namecolumn name
Returns
information about column 'name'

Definition at line 88 of file category_set.cc.

◆ column() [2/2]

const category_info & vita::category_set::column ( std::size_t  i) const
Parameters
[in]iindex of a dataframe column
Returns
information about column 'i'

Definition at line 78 of file category_set.cc.

◆ end()

auto vita::category_set::end ( ) const
inline

Definition at line 81 of file category_set.h.

◆ is_valid()

bool vita::category_set::is_valid ( ) const
Returns
true if the object satisfies class invariants

Definition at line 114 of file category_set.cc.

◆ used_categories()

std::set< category_t > vita::category_set::used_categories ( ) const
Returns
the set of used categories

Definition at line 101 of file category_set.cc.


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