Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Davide Di Croce
athena
Commits
91f5affa
Commit
91f5affa
authored
10 months ago
by
Frank Winklmeier
Browse files
Options
Downloads
Patches
Plain Diff
MVAUtils: fix flake8 v7 warnings
parent
715e7d20
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Reconstruction/MVAUtils/util/convertXGBoostToRootTree.py
+4
-4
4 additions, 4 deletions
Reconstruction/MVAUtils/util/convertXGBoostToRootTree.py
with
4 additions
and
4 deletions
Reconstruction/MVAUtils/util/convertXGBoostToRootTree.py
+
4
−
4
View file @
91f5affa
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2002-202
0
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-202
4
CERN for the benefit of the ATLAS collaboration
__doc__
=
"
Convert XGBoost model to TTree to be used with MVAUtils.
"
__author__
=
"
Yuan-Tang Chou
"
...
...
@@ -49,9 +49,9 @@ class XBGoostTextNode(dict):
else
:
# XGBoost "NO" is right branch in MVAUtils
return
XBGoostTextNode
(
self
[
'
children
'
][
self
.
get_nodeid
(
'
no
'
)])
def
get_nodeid
(
self
,
type
):
def
get_nodeid
(
self
,
node_
type
):
for
idx
,
children
in
enumerate
(
self
[
'
children
'
]):
if
children
[
'
nodeid
'
]
==
self
[
type
]:
if
children
[
'
nodeid
'
]
==
self
[
node_
type
]:
return
idx
def
get_default_left
(
self
):
...
...
@@ -283,7 +283,7 @@ def check_file(fn):
logging
.
info
(
"
file %s is empty
"
,
fn
)
return
False
tree
=
f
.
Get
(
keys
[
0
].
GetName
())
if
type
(
tree
)
!=
ROOT
.
TTree
:
if
type
(
tree
)
is
not
ROOT
.
TTree
:
logging
.
info
(
"
cannot find TTree in file %s
"
,
fn
)
return
False
if
not
tree
.
GetEntries
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment