forpy
2
|
Optimize split thresholds to optimize regression results (MSE). More...
#include <regression_opt.h>
Public Member Functions | |
RegressionOpt (const size_t &n_thresholds=0, const float &gain_threshold=1E-7f) | |
bool | operator== (const IThreshOpt &rhs) const |
virtual std::shared_ptr< IThreshOpt > | create_duplicate (const uint &) const |
Interface implementation. More... | |
void | check_annotations (IDataProvider *dprov) |
Interface implementation. More... | |
void | transfer_or_run_check (IThreshOpt *other, IDataProvider *dprov) |
Interface implementation. More... | |
void | full_entropy (const IDataProvider &dprov, Desk *) const |
Interface implementation. More... | |
void | optimize (Desk *) const |
Interface implementation. More... | |
float | get_gain_threshold_for (const size_t &) |
Interface implementation. More... | |
![]() | |
virtual | ~IThreshOpt () |
virtual bool | supports_weights () const |
Whether this threshold optimizer can take into account weights during the optimization. More... | |
Private Member Functions | |
SplitOptRes< float > & | optimize__setup (DeciderDesk &d) const |
void | optimize__sort (DeciderDesk &d) const |
std::unique_ptr< std::vector< float > > | optimize__thresholds (Desk *d) const |
template<class Archive > | |
void | serialize (Archive &ar, const uint &) |
DISALLOW_COPY_AND_ASSIGN (RegressionOpt) | |
Private Attributes | |
size_t | n_thresholds |
float | gain_threshold |
Friends | |
class | cereal::access |
std::ostream & | operator<< (std::ostream &stream, const RegressionOpt &) |
Additional Inherited Members | |
![]() | |
IThreshOpt () | |
Optimize split thresholds to optimize regression results (MSE).
This threshold optimizer draws n_thresholds
random values between the minimum and maximum observed feature value and returns the best one, or finds the perfect split if n_thresholds == 0
. Multiple annotations (and therefore multiple output regression) are allowed.
The optimizer is robust w.r.t. scaling of the features up to a certain extent. It is important that the least noticable difference is larger than 1E-7 (forpy::REGOPT_EPS).
Definition at line 54 of file regression_opt.h.
forpy::RegressionOpt::RegressionOpt | ( | const size_t & | n_thresholds = 0 , |
const float & | gain_threshold = 1E-7f |
||
) |
n_thresholds | size_t>=0 Number of randomly drawn threshold values that are assessed. If set to 0, the perfect split is determined. Default: 0. |
gain_threshold | float >=0.f The minimum information gain a split has to achieve. Default: 1E-7f. |
|
virtual |
Interface implementation.
Reimplemented from forpy::IThreshOpt.
|
inlinevirtual |
Interface implementation.
Reimplemented from forpy::IThreshOpt.
Definition at line 68 of file regression_opt.h.
|
private |
|
virtual |
Interface implementation.
Reimplemented from forpy::IThreshOpt.
|
inlinevirtual |
Interface implementation.
Reimplemented from forpy::IThreshOpt.
Definition at line 79 of file regression_opt.h.
|
virtual |
Reimplemented from forpy::IThreshOpt.
|
virtual |
Interface implementation.
Reimplemented from forpy::IThreshOpt.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Definition at line 98 of file regression_opt.h.
|
inlinevirtual |
Interface implementation.
Reimplemented from forpy::IThreshOpt.
Definition at line 73 of file regression_opt.h.
|
friend |
Definition at line 96 of file regression_opt.h.
|
friend |
Definition at line 84 of file regression_opt.h.
|
private |
Definition at line 104 of file regression_opt.h.
|
private |
Definition at line 103 of file regression_opt.h.