| Line | |
|---|
| 1 | void trainseparation()
|
|---|
| 2 | {
|
|---|
| 3 | MDataSet settrn;
|
|---|
| 4 | MDataSet settst;
|
|---|
| 5 | settrn.SetNumAnalysis(1);
|
|---|
| 6 | settst.SetNumAnalysis(2);
|
|---|
| 7 |
|
|---|
| 8 | MJTrainSeparation opt;
|
|---|
| 9 | //opt.SetDebug();
|
|---|
| 10 |
|
|---|
| 11 | // ------- Parameters to train Random Forest --------
|
|---|
| 12 | opt.AddParameter("MHillas.fSize");
|
|---|
| 13 | opt.AddParameter("MHillas.fWidth");
|
|---|
| 14 | opt.AddParameter("MHillas.fLength");
|
|---|
| 15 | opt.AddParameter("TMath::Abs(MHillasExt.fM3Long)");
|
|---|
| 16 | opt.AddParameter("MNewImagePar.fConc");
|
|---|
| 17 | opt.AddParameter("MNewImagePar.fConc1");
|
|---|
| 18 |
|
|---|
| 19 | // -------------------- Run ----------------------------
|
|---|
| 20 | MStatusDisplay *d = new MStatusDisplay;
|
|---|
| 21 | opt.SetDisplay(d);
|
|---|
| 22 |
|
|---|
| 23 | /*
|
|---|
| 24 | -------------------- Energy Slope --------------------
|
|---|
| 25 | MFEnergySlope slope(-2.8);
|
|---|
| 26 | opt.AddPreCut(&slope);
|
|---|
| 27 |
|
|---|
| 28 | -------------------- Other cuts ----------------------
|
|---|
| 29 | opt.AddPreCut("MHillas.fSize>200");
|
|---|
| 30 | opt.AddPreCut("MHillasSrc.fDCA*MGeomCam.fConvMm2Deg<0.3");
|
|---|
| 31 | */
|
|---|
| 32 |
|
|---|
| 33 | opt.SetDataSetTrain(settrn, 10000, 10000);
|
|---|
| 34 | //opt.SetDataSetTest(settst);
|
|---|
| 35 |
|
|---|
| 36 | opt.Train("rf-separation.root");
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | /*
|
|---|
| 40 | // SequencesOn: Monte Carlo sequences (gammas)
|
|---|
| 41 | // SequencesOff: Data sequences (background)
|
|---|
| 42 |
|
|---|
| 43 | // Use:
|
|---|
| 44 | // opt.AddPreCut to use cut for test and training
|
|---|
| 45 | // opt.AddTestCut to use cut for test only
|
|---|
| 46 | // opt.AddTrainCut to use cut for train only
|
|---|
| 47 | */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.