Ultra 0.9.4
Loading...
Searching...
No Matches
ultra::src::team_class_oracle< O, C > Class Template Reference

#include <oracle.h>

Inheritance diagram for ultra::src::team_class_oracle< O, C >:
ultra::src::basic_class_oracle ultra::src::basic_oracle

Public Member Functions

template<Individual I>
 team_class_oracle (const gp::team< I > &, const dataframe &, std::vector< std::string >={})
 team_class_oracle (std::istream &, const symbol_set &)
classification_result tag (const std::vector< value_t > &) const final
bool is_valid () const final
template<Individual I>
 team_class_oracle (const gp::team< I > &t, const dataframe &d, std::vector< std::string > names)
Public Member Functions inherited from ultra::src::basic_class_oracle
value_t operator() (const std::vector< value_t > &) const final
 Returns the predicted class label.
std::string name (const value_t &) const final
 Returns the class name, falling back to a numeric name for unknown IDs.

Static Public Attributes

static const std::string SERIALIZE_ID

Additional Inherited Members

Protected Member Functions inherited from ultra::src::basic_class_oracle
 basic_class_oracle (std::vector< std::string >={})
bool load_names (std::istream &)
 Loads the class names, accepting a zero count for omitted names.
bool save_names (std::ostream &) const
 Saves a count followed by one class name per line.
Static Protected Member Functions inherited from ultra::src::basic_class_oracle
static std::vector< std::string > class_names (const dataframe &)
 Collects the class names from the training set.

Detailed Description

template<ClassificationPredictor O, team_composition C = team_composition::standard>
class ultra::src::team_class_oracle< O, C >

An helper class for extending classification schemes to teams.

Template Parameters
Omember oracle type
Ccomposition method for team's member responses

Constructor & Destructor Documentation

◆ team_class_oracle() [1/3]

template<ClassificationPredictor O, team_composition C>
template<Individual I>
ultra::src::team_class_oracle< O, C >::team_class_oracle ( const gp::team< I > & t,
const dataframe & d,
std::vector< std::string > names = {} )
Parameters
[in]tteam "to be transformed" into an oracle
[in]dthe training set
[in]namesoptional class names

◆ team_class_oracle() [2/3]

template<ClassificationPredictor O, team_composition C>
team_class_oracle::team_class_oracle ( std::istream & in,
const symbol_set & ss )

Constructs the object reading data from an input stream.

Parameters
[in]ininput stream
[in]ssactive symbol set

◆ team_class_oracle() [3/3]

template<ClassificationPredictor O, team_composition C = team_composition::standard>
template<Individual I>
ultra::src::team_class_oracle< O, C >::team_class_oracle ( const gp::team< I > & t,
const dataframe & d,
std::vector< std::string > names )
Parameters
[in]tteam "to be transformed" into an oracle
[in]dthe training set
[in]namesoptional class names

Member Function Documentation

◆ is_valid()

template<ClassificationPredictor O, team_composition C>
bool team_class_oracle::is_valid ( ) const
nodiscardfinalvirtual
Returns
true if the object passes the internal consistency check

Implements ultra::src::basic_oracle.

◆ tag()

template<ClassificationPredictor O, team_composition C>
classification_result team_class_oracle::tag ( const std::vector< value_t > & instance) const
nodiscardfinalvirtual

Specialized method for teams.

Parameters
[in]instancedata to be classified
Returns
the class of instance (numerical id) and the confidence level (in the [0,1] interval)
  • team_composition::mv the class which most of the individuals predict for a given example is selected as team output.
  • team_composition::wta the winner is the individual with the highest confidence in its decision. Specialization may emerge if different members of the team win this contest for different fitness cases (of course, it isn't a feasible alternative to select the member with the best fitness. Then a decision on unknown data is only possible if the right outputs are known in advance and is not made by the team itself).

Implements ultra::src::basic_oracle.


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