-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vuillaut
committed
Dec 23, 2024
1 parent
b5ceb03
commit 750c972
Showing
2 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
production_configs/20240918_v0.10.12_allsky_nsb_grid/change_nestimators.py
This file contains 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,25 @@ | ||
import json | ||
import os | ||
|
||
# Directory path | ||
directory = '.' | ||
|
||
# Iterate over all directories starting with 'NSB-' | ||
for root, dirs, files in os.walk(directory): | ||
if root.startswith(os.path.join(directory, 'NSB-')): | ||
# Iterate over all JSON files in the directory | ||
for file in files: | ||
if file.endswith('.json'): | ||
file_path = os.path.join(root, file) | ||
|
||
# Open the JSON file | ||
with open(file_path, 'r') as f: | ||
data = json.load(f) | ||
|
||
# Modify the 'n_estimators' values | ||
data['random_forest_energy_regressor_args']['n_estimators'] = 50 | ||
data['random_forest_disp_regressor_args']['n_estimators'] = 50 | ||
|
||
# Write the modified data back to the JSON file | ||
with open(file_path, 'w') as f: | ||
json.dump(data, f, indent=4) |