forpy 2

Public Member Functions | Protected Member Functions | Private Member Functions | Friends | List of all members
forpy::IDecider Class Referenceabstract
Deciders

Interface for the decider. It does the optimization of the deciding classifier for each node and stores the parameters. More...

`#include <idecider.h>`

Inheritance diagram for forpy::IDecider:

## Public Member Functions
virtual | ~IDecider ()
virtual std::shared_ptr< IDecider > | create_duplicate (const uint &random_seed) const VIRTUAL_PTR
virtual void | make_node (const TodoMark &todo_info, const uint &min_samples_at_leaf, const IDataProvider &data_provider, Desk *d) const VIRTUAL_VOID
| Optimizes a classifier for the given data and stores the params. More...
virtual bool | is_compatible_with (const IDataProvider &dprov) VIRTUAL(bool)
virtual void | transfer_or_run_check (const std::shared_ptr< IDecider > &other, IDataProvider *dprov) VIRTUAL_VOID
virtual void | ensure_capacity (const size_t &n_samples) VIRTUAL_VOID
virtual void | finalize_capacity (const size_t &size) VIRTUAL_VOID
virtual bool | decide (const id_t &node_id, const Data< MatCRef > &data, const std::function< void(void *)> &dptf=nullptr) const VIRTUAL(bool)
| Makes a decision for a node with already optimized parameters. More...
virtual bool | supports_weights () const VIRTUAL(bool)
| Whether this classifier manager supports sample weights during training. More...
virtual size_t | get_data_dim () const VIRTUAL(size_t)
virtual void | set_data_dim (const size_t &val) VIRTUAL_VOID
virtual std::shared_ptr< IThreshOpt > | get_threshopt () const VIRTUAL_PTR
virtual bool | operator== (const IDecider &rhs) const VIRTUAL(bool)
virtual std::pair< const std::vector< size_t > *, const mu::variant< std::vector< float >, std::vector< double >, std::vector< uint32_t >, std::vector< uint8_t > > * > | get_maps () const =0

## Protected Member Functions
| IDecider ()
| Empty constructor to allow inheritance though DISALLOW_COPY_AND_ASSIGN is applied. More...

## Private Member Functions
template<class Archive >
void | serialize (Archive &, const uint &)
| DISALLOW_COPY_AND_ASSIGN (IDecider)

## Friends
class | cereal::access

## Detailed Description

Interface for the decider. It does the optimization of the deciding classifier for each node and stores the parameters.

Parameters

  input_dtype | The datatype of the data to classify.
  annotation_dtype | The datatype of the annotations.
  feature_dtype | The datatype in which features are calculated.

Definition at line 31 of file idecider.h.

## Constructor & Destructor Documentation

## ◆ ~IDecider()

virtual forpy::IDecider::~IDecider | ( |  | ) |
| virtual

## ◆ IDecider()

forpy::IDecider::IDecider | ( |  | ) |
| protected

Empty constructor to allow inheritance though DISALLOW_COPY_AND_ASSIGN is applied.

## Member Function Documentation

## ◆ create_duplicate()

virtual std::shared_ptr<IDecider> forpy::IDecider::create_duplicate | ( | const uint & | random_seed | ) | const
| virtual

Create an equivalent, but empty, duplicate.

Reimplemented in forpy::FastDecider.

## ◆ decide()

virtual bool forpy::IDecider::decide | ( | const id_t & | node_id,
|  | const Data< MatCRef > & | data,
|  | const std::function< void(void *)> & | dptf = `nullptr`
| ) |  | const
| virtual

Makes a decision for a node with already optimized parameters.

The classifier parameters must have been optimized for the node_id before this method is called.

Parameters

  node_id | The node id of the node for which the decision should be made.
  data | The input data.
  dptf | Feature transformation function; currently unused.

Returns
  true, if the decision goes to left, false otherwise.

Reimplemented in forpy::FastDecider.

## ◆ DISALLOW_COPY_AND_ASSIGN()

forpy::IDecider::DISALLOW_COPY_AND_ASSIGN | ( | IDecider |  | ) |
| private

## ◆ ensure_capacity()

virtual void forpy::IDecider::ensure_capacity | ( | const size_t & | n_samples | ) |
| virtual

Reimplemented in forpy::FastDecider.

## ◆ finalize_capacity()

virtual void forpy::IDecider::finalize_capacity | ( | const size_t & | size | ) |
| virtual

Reimplemented in forpy::FastDecider.

## ◆ get_data_dim()

virtual size_t forpy::IDecider::get_data_dim | ( |  | ) | const
| virtual

Gets the input dimension of the feature selection provider.

Reimplemented in forpy::FastDecider.

## ◆ get_maps()

virtual std::pair<const std::vector<size_t> *, const mu::variant<std::vector<float>, std::vector<double>, std::vector<uint32_t>, std::vector<uint8_t> > *> forpy::IDecider::get_maps | ( |  | ) | const
| pure virtual

Implemented in forpy::FastDecider.

## ◆ get_threshopt()

virtual std::shared_ptr<IThreshOpt> forpy::IDecider::get_threshopt | ( |  | ) | const
| virtual

Reimplemented in forpy::FastDecider.

## ◆ is_compatible_with()

virtual bool forpy::IDecider::is_compatible_with | ( | const IDataProvider & | dprov | ) |
| virtual

Reimplemented in forpy::FastDecider.

## ◆ make_node()

virtual void forpy::IDecider::make_node | ( | const TodoMark & | todo_info,
|  | const uint & | min_samples_at_leaf,
|  | const IDataProvider & | data_provider,
|  | Desk * | d
| ) |  | const
| virtual

Optimizes a classifier for the given data and stores the params.

This method must either set make_to_leaf to true or assure that at least the minimum amount of samples per leaf is contained in each of element_list_left and element_list_right. In the case that make_leaf is true, the list pointers may even be returned uninitialized.

If it is necessary to enforce additional growing constraints for the tree, this is the right place (e.g. have a minimum number of samples per node). The classifier manager can take these constraints into account and may return make_to_leaf accordingly.

Reimplemented in forpy::FastDecider.

## ◆ operator==()

virtual bool forpy::IDecider::operator== | ( | const IDecider & | rhs | ) | const
| virtual

Reimplemented in forpy::FastDecider.

## ◆ serialize()

template<class Archive >

void forpy::IDecider::serialize | ( | Archive & | ,
|  | const uint & |
| ) |  |
| inline private

Definition at line 112 of file idecider.h.

## ◆ set_data_dim()

virtual void forpy::IDecider::set_data_dim | ( | const size_t & | val | ) |
| virtual

Reimplemented in forpy::FastDecider.

## ◆ supports_weights()

virtual bool forpy::IDecider::supports_weights | ( |  | ) | const
| virtual

Whether this classifier manager supports sample weights during training.

Reimplemented in forpy::FastDecider.

## ◆ transfer_or_run_check()

virtual void forpy::IDecider::transfer_or_run_check | ( | const std::shared_ptr< IDecider > & | other,
|  | IDataProvider * | dprov
| ) |  |
| virtual

Reimplemented in forpy::FastDecider.

## Friends And Related Function Documentation

## ◆ cereal::access

friend class cereal::access
| friend

Definition at line 110 of file idecider.h.

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

- /Users/classner/git/forpy/include/forpy/deciders/idecider.h