1#ifndef FSTCRITERIONWRAPPERBIASESTIMATE_H
2#define FSTCRITERIONWRAPPERBIASESTIMATE_H
95template<
class RETURNTYPE,
class SUBSET,
class CLASSIFIER,
class DATAACCESSOR>
96class Criterion_Wrapper_Bias_Estimate :
public Clonable_Impl<Criterion_Wrapper_Bias_Estimate<RETURNTYPE,SUBSET,CLASSIFIER,DATAACCESSOR>,Criterion_Wrapper<RETURNTYPE,SUBSET,CLASSIFIER,DATAACCESSOR> > {
136template<
class RETURNTYPE,
class SUBSET,
class CLASSIFIER,
class DATAACCESSOR>
141 RETURNTYPE val1, val2, bias=0.0;
159 if(cnt==0.0)
return false;
162 result=bias/(RETURNTYPE)cnt;
CRTP mixin implementing the Clonable protocol for a concrete class.
Definition clonable.hpp:184
Wrapper Bias Evaluator - returns bias estimate (difference of classifier accuracy on training and val...
Definition criterion_wrapper_bias_estimate.hpp:96
Criterion_Wrapper< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR > parent
base class: plain accuracy wrapper criterion
Definition criterion_wrapper_bias_estimate.hpp:98
Criterion_Wrapper_Bias_Estimate(const Criterion_Wrapper_Bias_Estimate &cwbe)
Copy-constructor; delegates to parent_impl (clones _classifier, sharing-clones _da) and copies the co...
Definition criterion_wrapper_bias_estimate.hpp:128
RETURNTYPE _collected_bias_estimate
running sum of per-split bias (train-part minus test-part accuracy) since the last resetBiasEstimate(...
Definition criterion_wrapper_bias_estimate.hpp:130
RETURNTYPE getBiasEstimate() const
returns the mean per-split bias over all splits evaluated since the last reset (each evaluate() call ...
Definition criterion_wrapper_bias_estimate.hpp:119
virtual std::ostream & print(std::ostream &os) const override
writes a human-readable identification of the object; base default writes nothing
Definition criterion_wrapper_bias_estimate.hpp:124
std::shared_ptr< SUBSET > PSubset
shared pointer to the feature subset being evaluated
Definition criterion_wrapper_bias_estimate.hpp:102
Clonable_Impl< Criterion_Wrapper_Bias_Estimate, parent > parent_impl
implements clone(); sharing/stateless_clone throw in Criterion
Definition criterion_wrapper_bias_estimate.hpp:99
virtual bool evaluate(RETURNTYPE &result, const PSubset sub) override
Trains on the TRAIN part of each split, tests on both parts, and returns the mean per-split bias: acc...
Definition criterion_wrapper_bias_estimate.hpp:137
std::shared_ptr< DATAACCESSOR > PDataAccessor
shared pointer to the data accessor supplying training/test splits
Definition criterion_wrapper_bias_estimate.hpp:101
RETURNTYPE _collected_bias_count
number of SPLITS accumulated into _collected_bias_estimate since the last reset (one evaluate() call ...
Definition criterion_wrapper_bias_estimate.hpp:131
std::shared_ptr< CLASSIFIER > PClassifier
shared pointer to the wrapped classifier
Definition criterion_wrapper_bias_estimate.hpp:100
void resetBiasEstimate()
clears the accumulated bias estimate and the split count
Definition criterion_wrapper_bias_estimate.hpp:120
Wraps Classifier objects to serve as feature selection criterion.
Definition criterion_wrapper.hpp:95
std::shared_ptr< CLASSIFIER > _classifier
the wrapped classifier trained then tested by evaluate()
Definition criterion_wrapper.hpp:128
std::shared_ptr< DATAACCESSOR > _da
data accessor supplying the train/test splits
Definition criterion_wrapper.hpp:129
Criterion_Wrapper adapts Classifier objects to serve as feature selection criterion.
FST4 specific error passing class.
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition data_accessor.hpp:80
void notify(const std::string msg)
Prints msg followed by a newline via syncout::print(); a no-op unless the preprocessor macro DEBUG is...
Definition global.hpp:112
@ TEST
the split's test part
Definition data_accessor.hpp:86
@ TRAIN
the split's training part
Definition data_accessor.hpp:85