Canopy  1.0
The header-only random forests library
Public Member Functions | List of all members
canopy::defaultParameterGenerator< TNumParams > Class Template Reference

A simple parameter generator functor for training forest models. More...

#include <defaultParameterGenerator.hpp>

Public Member Functions

 defaultParameterGenerator (const int limit)
 Constructor where one limit is applied to all parameters. More...
 
 defaultParameterGenerator (const std::array< int, TNumParams > &limits)
 Constructor where different limits are used for each parameter. More...
 
void operator() (std::array< int, TNumParams > &params)
 Function to generate random parameter combinations. More...
 

Detailed Description

template<unsigned TNumParams>
class canopy::defaultParameterGenerator< TNumParams >

A simple parameter generator functor for training forest models.

Generates random combinations of parameters where all parameters are drawn independently from a uniform distribution between zero and some user-specified upper limit.

Template Parameters
TNumParamsThe number of parameters. This must match the corresponding template parameter of the forest model.

Constructor & Destructor Documentation

template<unsigned TNumParams>
canopy::defaultParameterGenerator< TNumParams >::defaultParameterGenerator ( const int  limit)
inline

Constructor where one limit is applied to all parameters.

Parameters
limitThe upper limit for all variables. All parameter values are generated from a uniform distribution over the integers between 0 and limit inclusive.
template<unsigned TNumParams>
canopy::defaultParameterGenerator< TNumParams >::defaultParameterGenerator ( const std::array< int, TNumParams > &  limits)
inline

Constructor where different limits are used for each parameter.

Parameters
limitsArray of upper limits. The upper limit for all variables. All parameter values for parameter with index p are generated from a uniform distribution over the integers between 0 and limits[p] inclusive.

Member Function Documentation

template<unsigned TNumParams>
void canopy::defaultParameterGenerator< TNumParams >::operator() ( std::array< int, TNumParams > &  params)
inline

Function to generate random parameter combinations.

This is called automatically by the randomForestBase::train() method.


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