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 | __doc__ = "Convert XGBoost model to TTree to be used with MVAUtils." |
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 278 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 132 of file convertXGBoostToRootTree.py.
def util.convertXGBoostToRootTree.dump2ROOT | ( | model, | |
output_filename, | |||
output_treename = 'xgboost' |
|||
) |
Definition at line 92 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 66 of file convertXGBoostToRootTree.py.
def util.convertXGBoostToRootTree.test | ( | model_file, | |
tree_file, | |||
objective, | |||
tree_name = 'xgboost' , |
|||
ntests = 10000 , |
|||
test_file = None |
|||
) |
Definition at line 146 of file convertXGBoostToRootTree.py.
def util.convertXGBoostToRootTree.test_binary | ( | booster, | |
mva_utils, | |||
objective, | |||
ntests = 10000 , |
|||
test_file = None |
|||
) |
Definition at line 205 of file convertXGBoostToRootTree.py.
def util.convertXGBoostToRootTree.test_multiclass | ( | booster, | |
mva_utils, | |||
objective, | |||
ntests = 10000 , |
|||
test_file = None |
|||
) |
Definition at line 239 of file convertXGBoostToRootTree.py.
def util.convertXGBoostToRootTree.test_regression | ( | booster, | |
mva_utils, | |||
objective, | |||
ntests = 10000 , |
|||
test_file = None |
|||
) |
Definition at line 169 of file convertXGBoostToRootTree.py.
|
private |
Definition at line 6 of file convertXGBoostToRootTree.py.
|
private |
Definition at line 5 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.action |
Definition at line 302 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.args = parser.parse_args() |
Definition at line 307 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.data = np.load(args.test_file) |
Definition at line 345 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.default |
Definition at line 300 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.help |
Definition at line 299 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.int |
Definition at line 303 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.level |
Definition at line 19 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.objective = args.objective |
Definition at line 343 of file convertXGBoostToRootTree.py.
def util.convertXGBoostToRootTree.output_treename = convertXGBoostToRootTree(args.input, args.output, args.tree_name) |
Definition at line 328 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.parser = argparse.ArgumentParser(description=__doc__) |
Definition at line 298 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 338 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.str |
Definition at line 300 of file convertXGBoostToRootTree.py.
list util.convertXGBoostToRootTree.supported_objective = ['binary:logistic', 'reg:linear', 'reg:squarederror','multi:softprob'] |
Definition at line 311 of file convertXGBoostToRootTree.py.
util.convertXGBoostToRootTree.type |
Definition at line 300 of file convertXGBoostToRootTree.py.