Skip to content

Commit

Permalink
trying to add plottingcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jun 28, 2016
1 parent 54d51cc commit eb242c1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,22 @@ def main(json_config, exclude_vars):
'''
# -- load in the JSON file
class_files_dict = json.load(open(json_config))
print 'pipeline: opened and loaded'

# -- transform ROOT files into standard ML format (ndarrays)
X_jets, X_photons, X_muons, y, w, varlist = read_in(class_files_dict, exclude_vars)
print 'pipeline: read in'

# -- shuffle, split samples into train and test set, scale features
X_jets_train, X_jets_test, \
X_photons_train, X_photons_test, \
X_muons_train, X_muons_test, \
y_train, y_test, \
w_train, w_test = shuffle_split_scale(X_jets, X_photons, X_muons, y, w)
print 'pipeline: shuffled and split'

# -- save out to pickle
cPickle.dump({
'''cPickle.dump({
'X_jets_train' : X_jets_train,
'X_jets_test' : X_jets_test,
'X_photons_train' : X_photons_train,
Expand All @@ -60,7 +63,8 @@ def main(json_config, exclude_vars):
},
open('processed_data.pkl', 'wb'),
protocol=cPickle.HIGHEST_PROTOCOL)

print 'pipeline: pickles saved'
'''
# -- plot distributions:
# this should produce weighted histograms of the input distributions for all variables
# on each plot, the train and test distributions should be shown for every class
Expand Down Expand Up @@ -100,6 +104,7 @@ def main(json_config, exclude_vars):
parser.add_argument('config', help="JSON file that specifies classes and corresponding ROOT files' paths")
parser.add_argument('--exclude', help="names of branches to exclude from training", nargs="*", default=[])
args = parser.parse_args()
print 'pipeline: main run'

# -- pass arguments to main
sys.exit(main(args.config, args.exclude))

0 comments on commit eb242c1

Please sign in to comment.