![]() |
ATLAS Offline Software
|
Classes | |
| class | XBGoostTextNode |
Functions | |
| def | dump_tree (tree_structure) |
| def | dump2ROOT (model, output_filename, output_treename='xgboost') |
| def | convertXGBoostToRootTree (model, output_filename, tree_name='xgboost') |
| def | test (model_file, tree_file, objective, tree_name='xgboost', ntests=10000, test_file=None) |
| def | test_regression (booster, mva_utils, objective, ntests=10000, test_file=None) |
| def | test_binary (booster, mva_utils, objective, ntests=10000, test_file=None) |
| def | test_multiclass (booster, mva_utils, objective, ntests=10000, test_file=None) |
| def | check_file (fn) |
Variables | |
| string | __author__ = "Yuan-Tang Chou" |
| level | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| help | |
| type | |
| str | |
| default | |
| action | |
| int | |
| args = parser.parse_args() | |
| list | supported_objective = ['binary:logistic', 'reg:linear', 'reg:squarederror','multi:softprob'] |
| def | output_treename = convertXGBoostToRootTree(args.input, args.output, args.tree_name) |
| def | result = test(args.input, args.output, args.objective, args.tree_name, args.ntests, args.test_file) |
| objective = args.objective | |
| data = np.load(args.test_file) | |
| def util.convertXGBoostToRootTree.check_file | ( | fn | ) |
Definition at line 279 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.convertXGBoostToRootTree | ( | model, | |
| output_filename, | |||
tree_name = 'xgboost' |
|||
| ) |
Model: - a string, in this case, it is the name of the input file containing the xgboost model
you can get this model with xgboost with `bst.save_model('my_model.model')
- directly a xgboost booster object
Definition at line 133 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.dump2ROOT | ( | model, | |
| output_filename, | |||
output_treename = 'xgboost' |
|||
| ) |
Definition at line 93 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.dump_tree | ( | tree_structure | ) |
dump a single decision tree to arrays to be written into the TTree
Definition at line 67 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.test | ( | model_file, | |
| tree_file, | |||
| objective, | |||
tree_name = 'xgboost', |
|||
ntests = 10000, |
|||
test_file = None |
|||
| ) |
Definition at line 147 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.test_binary | ( | booster, | |
| mva_utils, | |||
| objective, | |||
ntests = 10000, |
|||
test_file = None |
|||
| ) |
Definition at line 206 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.test_multiclass | ( | booster, | |
| mva_utils, | |||
| objective, | |||
ntests = 10000, |
|||
test_file = None |
|||
| ) |
Definition at line 240 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.test_regression | ( | booster, | |
| mva_utils, | |||
| objective, | |||
ntests = 10000, |
|||
test_file = None |
|||
| ) |
Definition at line 170 of file convertXGBoostToRootTree.py.
|
private |
Definition at line 7 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.action |
Definition at line 303 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.args = parser.parse_args() |
Definition at line 308 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.data = np.load(args.test_file) |
Definition at line 346 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.default |
Definition at line 301 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.help |
Definition at line 300 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.int |
Definition at line 304 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.level |
Definition at line 20 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.objective = args.objective |
Definition at line 344 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.output_treename = convertXGBoostToRootTree(args.input, args.output, args.tree_name) |
Definition at line 329 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.parser = argparse.ArgumentParser(description=__doc__) |
Definition at line 299 of file convertXGBoostToRootTree.py.
| def util.convertXGBoostToRootTree.result = test(args.input, args.output, args.objective, args.tree_name, args.ntests, args.test_file) |
Definition at line 339 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.str |
Definition at line 301 of file convertXGBoostToRootTree.py.
| list util.convertXGBoostToRootTree.supported_objective = ['binary:logistic', 'reg:linear', 'reg:squarederror','multi:softprob'] |
Definition at line 312 of file convertXGBoostToRootTree.py.
| util.convertXGBoostToRootTree.type |
Definition at line 301 of file convertXGBoostToRootTree.py.
1.8.18