-
Notifications
You must be signed in to change notification settings - Fork 0
Xgb #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Xgb #60
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8e1cf6c
XGB training scripts
GernotMaier 727df8f
observatory
GernotMaier d181e97
XGB analysis
GernotMaier c789454
training
GernotMaier f10076b
root file
GernotMaier 64afe59
minor debug fixes
GernotMaier 481ac6f
fix directories
GernotMaier f4d2302
XGBstereo
GernotMaier 90d07a1
remove az dependence
GernotMaier fec7c0b
more training events
GernotMaier df99d9e
revert 3
GernotMaier 4b3a269
correct training selection
GernotMaier 6beac08
add prepare ana links
GernotMaier ace0a18
Update analysis/CTA.XGBSTEREO.sub_analyse.sh
GernotMaier 979627f
Update analysis/CTA.XGBSTEREO.sub_train.sh
GernotMaier d4555ff
Update analysis/CTA.XGBSTEREO.sub_train.sh
GernotMaier 025cab3
Update analysis/CTA.XGBSTEREO.sub_analyse.sh
GernotMaier a795a79
Update analysis/CTA.XGBSTEREO.sub_analyse.sh
GernotMaier 5129683
Update analysis/CTA.XGBSTEREO.sub_analyse.sh
GernotMaier b4d92bf
review
GernotMaier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/bin/bash | ||
| # | ||
| # train XGB stereo for CTA | ||
| # | ||
|
|
||
| MSCW_FILE="FFILE" | ||
| XGBDIR="DIRXGB" | ||
| XGB="xgb_stereo" | ||
| DSET="DATASET" | ||
| env_name="eventdisplay_ml_cta" | ||
| MAXCORES=48 | ||
|
|
||
| # set environmental variables | ||
| source $EVNDISPSYS/setObservatory.sh CTA | ||
|
|
||
|
|
||
| check_conda_installation() | ||
| { | ||
| if command -v conda &> /dev/null; then | ||
| echo "Found conda installation." | ||
| else | ||
| echo "Error: found no conda installation." | ||
| echo "exiting..." | ||
| exit | ||
| fi | ||
| env_info=$(conda info --envs) | ||
| if [[ "$env_info" == *"$env_name"* ]]; then | ||
| echo "Found conda environment '$env_name'" | ||
| else | ||
| echo "Error: the conda environment '$env_name' does not exist." | ||
| echo "exiting..." | ||
| exit | ||
| fi | ||
| } | ||
|
|
||
| check_conda_installation | ||
|
|
||
| source activate base | ||
| conda activate $env_name | ||
|
|
||
| PREFIX="${XGBDIR}/dispdir_bdt" | ||
|
|
||
| if [[ $DSET == *"LaPalma"* ]]; then | ||
| site="CTAO-NORTH" | ||
| else | ||
| site="CTAO-SOUTH" | ||
| fi | ||
|
|
||
| OFIL=$(basename $MSCW_FILE .root) | ||
| ODIR=$(dirname $MSCW_FILE) | ||
| OFIL="${ODIR}/${OFIL}.${XGB}" | ||
| LOGFILE="${OFIL}.log" | ||
| rm -f "$LOGFILE" | ||
|
|
||
| echo "LOG FILE: $LOGFILE" | ||
|
|
||
| eventdisplay-ml-apply-xgb-stereo \ | ||
| --input_file "$MSCW_FILE" \ | ||
| --model_prefix "${PREFIX}" \ | ||
| --output_file "${OFIL}.root" \ | ||
| --max_cores $MAXCORES \ | ||
| --observatory $site >| "${LOGFILE}" 2>&1 | ||
|
|
||
| python --version >> "${LOGFILE}" | ||
| conda list -n $env_name >> "${LOGFILE}" | ||
|
|
||
| conda deactivate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/bin/bash | ||
| # | ||
| # train XGB stereo for CTA | ||
| # | ||
|
|
||
| ODIR=OUTPUTDIR | ||
| LLIST=MSCWLIST | ||
| DSET="DATASET" | ||
| env_name="eventdisplay_ml_cta" | ||
| P="0.90" | ||
| N="500000000" | ||
| MAXCORES=48 | ||
|
|
||
| # set environmental variables | ||
| source $EVNDISPSYS/setObservatory.sh CTA | ||
|
|
||
| # output data files are written to this directory | ||
| mkdir -p "${ODIR}" | ||
| echo -e "Output files will be written to:\n ${ODIR}" | ||
|
|
||
| check_conda_installation() | ||
| { | ||
| if command -v conda &> /dev/null; then | ||
| echo "Found conda installation." | ||
| else | ||
| echo "Error: found no conda installation." | ||
| echo "exiting..." | ||
| exit | ||
| fi | ||
| env_info=$(conda info --envs) | ||
| if [[ "$env_info" == *"$env_name"* ]]; then | ||
| echo "Found conda environment '$env_name'" | ||
| else | ||
| echo "Error: the conda environment '$env_name' does not exist." | ||
| echo "exiting..." | ||
| exit | ||
| fi | ||
| } | ||
|
|
||
| check_conda_installation | ||
|
|
||
| source activate base | ||
| conda activate $env_name | ||
|
|
||
| PREFIX="${ODIR}/dispdir_bdt" | ||
| LOGFILE="${PREFIX}.log" | ||
| rm -f "$LOGFILE" | ||
|
|
||
| if [[ $DSET == *"LaPalma"* ]]; then | ||
| site="CTAO-NORTH" | ||
| else | ||
| site="CTAO-SOUTH" | ||
| fi | ||
|
|
||
| eventdisplay-ml-train-xgb-stereo \ | ||
| --input_file_list "$LLIST" \ | ||
| --model_prefix "${PREFIX}" \ | ||
| --max_cores $MAXCORES \ | ||
| --observatory $site \ | ||
| --train_test_fraction $P --max_events $N >| "${LOGFILE}" 2>&1 | ||
|
|
||
| python --version >> "${LOGFILE}" | ||
| conda list -n $env_name >> "${LOGFILE}" | ||
|
|
||
| conda deactivate |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.