#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 46 of file Forest.cc.
References setTrainingEvents().
Forest::~Forest | ( | ) |
Forest::Forest | ( | const Forest & | forest | ) |
Definition at line 64 of file Forest.cc.
References HcalDetIdTransform::transform(), compare::tree, and trees.
|
default |
void Forest::appendCorrection | ( | std::vector< Event *> & | eventsp, |
int | treenum | ||
) |
Definition at line 426 of file Forest.cc.
References trees, and updateEvents().
Referenced by predictEvent(), and predictEvents().
void Forest::appendCorrection | ( | Event * | e, |
int | treenum | ||
) |
Definition at line 463 of file Forest.cc.
References MillePedeFileConverter_cfg::e, L1TowerCalibrationProducer_cfi::fit, emtf::Node::getFitValue(), and trees.
void Forest::doRegression | ( | int | nodeLimit, |
int | treeLimit, | ||
double | learningRate, | ||
LossFunction * | l, | ||
const char * | savetreesdirectory, | ||
bool | saveTrees | ||
) |
Definition at line 355 of file Forest.cc.
References c, events, mps_fire::i, MainPageGenerator::l, alignCSCRings::s, sortEventVectors(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, trees, and updateRegTargets().
void Forest::doStochasticRegression | ( | int | nodeLimit, |
int | treeLimit, | ||
double | learningRate, | ||
double | fraction, | ||
LossFunction * | l | ||
) |
Definition at line 548 of file Forest.cc.
References c, events, HLT_2022v12_cff::fraction, mps_fire::i, MainPageGenerator::l, prepareRandomSubsample(), alignCSCRings::s, sortEventVectors(), contentValuesCheck::ss, 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 114 of file Forest.cc.
References mps_fire::i, and trees.
Referenced by L1TMuonEndCapForestESProducer::produce().
void Forest::listEvents | ( | std::vector< std::vector< Event *> > & | e | ) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition at line 142 of file Forest.cc.
References gather_cfg::cout, MillePedeFileConverter_cfg::e, mps_fire::i, and dqmiolumiharvest::j.
void Forest::loadForestFromXML | ( | const char * | directory, |
unsigned int | numTrees | ||
) |
Definition at line 477 of file Forest.cc.
References createBeamHaloJobs::directory, contentValuesFiles::fullPath, mps_fire::i, contentValuesCheck::ss, and trees.
void Forest::loadFromCondPayload | ( | const L1TMuonEndCapForest::DForest & | payload | ) |
Definition at line 70 of file Forest.cc.
References mps_fire::i, HcalDetIdTransform::transform(), compare::tree, and trees.
void Forest::predictEvent | ( | Event * | e, |
unsigned int | trees | ||
) |
Definition at line 440 of file Forest.cc.
References appendCorrection(), MillePedeFileConverter_cfg::e, mps_fire::i, 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 406 of file Forest.cc.
References appendCorrection(), mps_fire::i, and trees.
void Forest::prepareRandomSubsample | ( | double | fraction | ) |
Definition at line 521 of file Forest.cc.
References mps_fire::end, events, HLT_2022v12_cff::fraction, mps_fire::i, emtf::shuffle(), sortEventVectors(), subSample, and findQualityFiles::v.
Referenced by doStochasticRegression().
void Forest::rankVariables | ( | std::vector< int > & | rank | ) |
Definition at line 195 of file Forest.cc.
References events, mps_fire::i, dqmiolumiharvest::j, SiStripPI::max, edm::second(), jetUpdater_cfi::sort, trees, findQualityFiles::v, and w().
void Forest::saveSplitValues | ( | const char * | savefilename | ) |
Definition at line 245 of file Forest.cc.
References mps_fire::end, events, mps_fire::i, dqmiolumiharvest::j, jetUpdater_cfi::sort, contentValuesCheck::ss, trees, tier0::unique(), and findQualityFiles::v.
void Forest::setTrainingEvents | ( | std::vector< Event *> & | trainingEvents | ) |
Definition at line 87 of file Forest.cc.
References MillePedeFileConverter_cfg::e, events, and mps_fire::i.
Referenced by Forest().
unsigned int Forest::size | ( | void | ) |
Definition at line 127 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 181 of file Forest.cc.
References compareEvents(), MillePedeFileConverter_cfg::e, mps_fire::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 328 of file Forest.cc.
References MillePedeFileConverter_cfg::e, L1TowerCalibrationProducer_cfi::fit, dqmiolumiharvest::j, and findQualityFiles::v.
Referenced by appendCorrection().
void Forest::updateRegTargets | ( | Tree * | tree, |
double | learningRate, | ||
LossFunction * | l | ||
) |
Definition at line 289 of file Forest.cc.
References MillePedeFileConverter_cfg::e, L1TowerCalibrationProducer_cfi::fit, dqmiolumiharvest::j, MainPageGenerator::l, and findQualityFiles::v.
Referenced by doRegression(), and doStochasticRegression().
|
private |
Definition at line 66 of file Forest.h.
Referenced by eventsfwlite.Events::__getattr__(), eventsfwlite.Events::__getitem__(), eventsfwlite.Events::__len__(), 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().