#include <Forest.h>
Public Member Functions | |
void | appendCorrection (std::vector< Event * > &eventsp, int treenum) |
void | appendCorrection (Event *e, int treenum) |
void | doRegression (int nodeLimit, int treeLimit, double learningRate, LossFunction *l, const char *savetreesdirectory, bool saveTrees) |
void | doStochasticRegression (int nodeLimit, int treeLimit, double learningRate, double fraction, LossFunction *l) |
Forest () | |
Forest (std::vector< Event * > &trainingEvents) | |
Forest (const Forest &forest) | |
Forest (Forest &&forest)=default | |
void | generate (int numTrainEvents, int numTestEvents, double sigma) |
std::vector< Event * > | getTrainingEvents () |
Tree * | getTree (unsigned int i) |
void | listEvents (std::vector< std::vector< Event * > > &e) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! More... | |
void | loadForestFromXML (const char *directory, unsigned int numTrees) |
void | loadFromCondPayload (const L1TMuonEndCapForest::DForest &payload) |
Forest & | operator= (const Forest &forest) |
void | predictEvent (Event *e, unsigned int trees) |
void | predictEvents (std::vector< Event * > &eventsp, unsigned int trees) |
void | prepareRandomSubsample (double fraction) |
void | rankVariables (std::vector< int > &rank) |
void | saveSplitValues (const char *savefilename) |
void | setTrainingEvents (std::vector< Event * > &trainingEvents) |
unsigned int | size () |
void | sortEventVectors (std::vector< std::vector< Event * > > &e) |
void | updateEvents (Tree *tree) |
void | updateRegTargets (Tree *tree, double learningRate, LossFunction *l) |
~Forest () | |
Private Attributes | |
std::vector< std::vector< Event * > > | events |
std::vector< std::vector< Event * > > | subSample |
std::vector< Tree * > | trees |
Forest::Forest | ( | std::vector< Event * > & | trainingEvents | ) |
Definition at line 49 of file Forest.cc.
References setTrainingEvents().
Forest::~Forest | ( | ) |
Forest::Forest | ( | const Forest & | forest | ) |
Definition at line 71 of file Forest.cc.
References create_public_lumi_plots::transform, compare::tree, and trees.
|
default |
void Forest::appendCorrection | ( | std::vector< Event * > & | eventsp, |
int | treenum | ||
) |
Definition at line 464 of file Forest.cc.
References emtf::Tree::filterEvents(), trees, and updateEvents().
Referenced by predictEvent(), and predictEvents().
void Forest::appendCorrection | ( | Event * | e, |
int | treenum | ||
) |
Definition at line 505 of file Forest.cc.
References emtf::Tree::filterEvent(), trackingPlots::fit, emtf::Node::getFitValue(), emtf::Event::predictedValue, and trees.
void Forest::doRegression | ( | int | nodeLimit, |
int | treeLimit, | ||
double | learningRate, | ||
LossFunction * | l, | ||
const char * | savetreesdirectory, | ||
bool | saveTrees | ||
) |
Definition at line 394 of file Forest.cc.
References emtf::Tree::buildTree(), EnergyCorrector::c, events, mps_fire::i, alignCSCRings::s, emtf::Tree::saveToXML(), sortEventVectors(), AlCaHLTBitMon_QueryRunRegistry::string, trees, and updateRegTargets().
void Forest::doStochasticRegression | ( | int | nodeLimit, |
int | treeLimit, | ||
double | learningRate, | ||
double | fraction, | ||
LossFunction * | l | ||
) |
Definition at line 597 of file Forest.cc.
References EnergyCorrector::c, events, mps_fire::i, prepareRandomSubsample(), alignCSCRings::s, sortEventVectors(), AlCaHLTBitMon_QueryRunRegistry::string, subSample, trees, and updateRegTargets().
void emtf::Forest::generate | ( | int | numTrainEvents, |
int | numTestEvents, | ||
double | sigma | ||
) |
std::vector< Event * > Forest::getTrainingEvents | ( | ) |
Tree * Forest::getTree | ( | unsigned int | i | ) |
Definition at line 129 of file Forest.cc.
References trees.
Referenced by L1TMuonEndCapForestESProducer::produce().
void Forest::listEvents | ( | std::vector< std::vector< Event * > > & | e | ) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition at line 159 of file Forest.cc.
References gather_cfg::cout, MillePedeFileConverter_cfg::e, mps_fire::i, and emtf::Event::sortingIndex.
void Forest::loadForestFromXML | ( | const char * | directory, |
unsigned int | numTrees | ||
) |
Definition at line 520 of file Forest.cc.
References mps_fire::i, and trees.
void Forest::loadFromCondPayload | ( | const L1TMuonEndCapForest::DForest & | payload | ) |
Definition at line 80 of file Forest.cc.
References mps_fire::i, create_public_lumi_plots::transform, compare::tree, and trees.
void Forest::predictEvent | ( | Event * | e, |
unsigned int | trees | ||
) |
Definition at line 479 of file Forest.cc.
References appendCorrection(), mps_fire::i, emtf::Event::predictedValue, and trees.
Referenced by PtAssignmentEngine2016::calculate_pt_xml(), and PtAssignmentEngine2017::calculate_pt_xml().
void Forest::predictEvents | ( | std::vector< Event * > & | eventsp, |
unsigned int | trees | ||
) |
Definition at line 441 of file Forest.cc.
References appendCorrection(), mps_fire::i, and trees.
void Forest::prepareRandomSubsample | ( | double | fraction | ) |
Definition at line 568 of file Forest.cc.
References begin, end, events, mps_fire::i, emtf::shuffle(), sortEventVectors(), subSample, and findQualityFiles::v.
Referenced by doStochasticRegression().
void Forest::rankVariables | ( | std::vector< int > & | rank | ) |
Definition at line 219 of file Forest.cc.
References events, mps_fire::i, SiStripPI::max, edm::second(), jetUpdater_cfi::sort, trees, findQualityFiles::v, and w.
void Forest::saveSplitValues | ( | const char * | savefilename | ) |
Definition at line 274 of file Forest.cc.
References begin, end, events, mps_fire::i, jetUpdater_cfi::sort, trees, tier0::unique(), and findQualityFiles::v.
void Forest::setTrainingEvents | ( | std::vector< Event * > & | trainingEvents | ) |
Definition at line 100 of file Forest.cc.
References emtf::Event::data, MillePedeFileConverter_cfg::e, events, and mps_fire::i.
Referenced by Forest().
unsigned int Forest::size | ( | void | ) |
Definition at line 143 of file Forest.cc.
References trees.
Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and L1TMuonEndCapForestESProducer::produce().
void Forest::sortEventVectors | ( | std::vector< std::vector< Event * > > & | e | ) |
Definition at line 203 of file Forest.cc.
References begin, compareEvents(), MillePedeFileConverter_cfg::e, end, mps_fire::i, jetUpdater_cfi::sort, and emtf::Event::sortingIndex.
Referenced by doRegression(), doStochasticRegression(), and prepareRandomSubsample().
void Forest::updateEvents | ( | Tree * | tree | ) |
Definition at line 364 of file Forest.cc.
References MillePedeFileConverter_cfg::e, trackingPlots::fit, emtf::Tree::getTerminalNodes(), emtf::Event::predictedValue, and findQualityFiles::v.
Referenced by appendCorrection().
void Forest::updateRegTargets | ( | Tree * | tree, |
double | learningRate, | ||
LossFunction * | l | ||
) |
Definition at line 322 of file Forest.cc.
References emtf::Event::data, MillePedeFileConverter_cfg::e, emtf::LossFunction::fit(), trackingPlots::fit, emtf::Tree::getTerminalNodes(), emtf::Event::predictedValue, emtf::LossFunction::target(), and findQualityFiles::v.
Referenced by doRegression(), and doStochasticRegression().
|
private |
Definition at line 66 of file Forest.h.
Referenced by eventsfwlite.Events::__getattr__(), doRegression(), doStochasticRegression(), Forest(), getTrainingEvents(), looper.Looper::loop(), prepareRandomSubsample(), looper.Looper::process(), rankVariables(), saveSplitValues(), and setTrainingEvents().
|
private |
Definition at line 67 of file Forest.h.
Referenced by doStochasticRegression(), and prepareRandomSubsample().
|
private |
Definition at line 68 of file Forest.h.
Referenced by appendCorrection(), doRegression(), doStochasticRegression(), Forest(), getTree(), loadForestFromXML(), loadFromCondPayload(), operator=(), predictEvent(), predictEvents(), rankVariables(), saveSplitValues(), size(), and ~Forest().