-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import fixed: find the last occurence of views_pipeline
- Loading branch information
Borbála Farkas
authored and
Borbála Farkas
committed
Oct 29, 2024
1 parent
b3897d4
commit 8b37ce7
Showing
9 changed files
with
128 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ jobs: | |
else | ||
echo "No new or removed folders detected." | ||
fi | ||
git status | ||
- name: Configure Git | ||
run: | | ||
|
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
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,3 @@ | ||
# Model README | ||
## Model name: caring_fish | ||
## Created on: 2024-10-29 10:51:00.014047 |
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,20 @@ | ||
""" | ||
Deployment Configuration Script | ||
This script defines the deployment configuration settings for the application. | ||
It includes the deployment status and any additional settings specified. | ||
Deployment Status: | ||
- shadow: The deployment is shadowed and not yet active. | ||
- deployed: The deployment is active and in use. | ||
- baseline: The deployment is in a baseline state, for reference or comparison. | ||
- deprecated: The deployment is deprecated and no longer supported. | ||
Additional settings can be included in the configuration dictionary as needed. | ||
""" | ||
|
||
def get_deployment_config(): | ||
# Deployment settings | ||
deployment_config = {'deployment_status': 'shadow'} | ||
return deployment_config |
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,14 @@ | ||
def get_hp_config(): | ||
""" | ||
Contains the hyperparameter configurations for model training. | ||
This configuration is "operational" so modifying these settings will impact the model's behavior during the training. | ||
Returns: | ||
- hyperparameters (dict): A dictionary containing hyperparameters for training the model, which determine the model's behavior during the training phase. | ||
""" | ||
|
||
hyperparameters = { | ||
'model': 'XGBoost', # The model algorithm used. Eg. "LSTM", "CNN", "Transformer" | ||
# Add more hyperparameters as needed | ||
} | ||
return hyperparameters |
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,19 @@ | ||
def get_meta_config(): | ||
""" | ||
Contains the meta data for the model (model algorithm, name, target variable, and level of analysis). | ||
This config is for documentation purposes only, and modifying it will not affect the model, the training, or the evaluation. | ||
Returns: | ||
- meta_config (dict): A dictionary containing model meta configuration. | ||
""" | ||
|
||
meta_config = { | ||
"name": "caring_fish", # Eg. happy_kitten | ||
"algorithm": "XGBoost", # Eg. "LSTM", "CNN", "Transformer" | ||
# Uncomment and modify the following lines as needed for additional metadata: | ||
# "target(S)": ["ln_sb_best", "ln_ns_best", "ln_os_best", "ln_sb_best_binarized", "ln_ns_best_binarized", "ln_os_best_binarized"], | ||
"queryset": "escwa001_cflong" | ||
# "level": "pgm", | ||
# "creator": "Your name here" | ||
} | ||
return meta_config |
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,29 @@ | ||
def get_sweep_config(): | ||
""" | ||
Contains the configuration for hyperparameter sweeps using WandB. | ||
This configuration is "operational" so modifying it will change the search strategy, parameter ranges, and other settings for hyperparameter tuning aimed at optimizing model performance. | ||
Returns: | ||
- sweep_config (dict): A dictionary containing the configuration for hyperparameter sweeps, defining the methods and parameter ranges used to search for optimal hyperparameters. | ||
""" | ||
|
||
sweep_config = { | ||
'method': 'grid', | ||
} | ||
|
||
# Example metric setup: | ||
metric = { | ||
'name': 'MSE', | ||
'goal': 'minimize' | ||
} | ||
sweep_config['metric'] = metric | ||
|
||
# Example parameters setup: | ||
parameters_dict = { | ||
'model': { | ||
'value': 'XGBoost' # Eg. "LSTM", "CNN", "Transformer" | ||
}, | ||
} | ||
sweep_config['parameters'] = parameters_dict | ||
|
||
return sweep_config |
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,39 @@ | ||
import time | ||
import wandb | ||
import sys | ||
import logging | ||
logging.basicConfig(filename='run.log', encoding='utf-8', level=logging.INFO, | ||
format='%(asctime)s - %(levelname)s - %(message)s') | ||
logger = logging.getLogger(__name__) | ||
from pathlib import Path | ||
# Set up the path to include common_utils module | ||
PATH = Path(__file__) | ||
sys.path.insert(0, str(Path( | ||
*[i for i in PATH.parts[:PATH.parts.index("views_pipeline") + 1]]) / "common_utils")) # PATH_COMMON_UTILS | ||
# Import necessary functions for project setup and model execution | ||
from set_path import setup_project_paths | ||
setup_project_paths(PATH) | ||
from utils_cli_parser import parse_args, validate_arguments | ||
from execute_model_runs import execute_sweep_run, execute_single_run | ||
|
||
if __name__ == "__main__": | ||
# Parse command-line arguments | ||
args = parse_args() | ||
|
||
# Validate the arguments to ensure they are correct | ||
validate_arguments(args) | ||
# Log in to Weights & Biases (wandb) | ||
wandb.login() | ||
# Record the start time | ||
start_t = time.time() | ||
# Execute the model run based on the sweep flag | ||
if args.sweep: | ||
execute_sweep_run(args) # Execute sweep run | ||
else: | ||
execute_single_run(args) # Execute single run | ||
# Record the end time | ||
end_t = time.time() | ||
|
||
# Calculate and print the runtime in minutes | ||
minutes = (end_t - start_t) / 60 | ||
logger.info(f'Done. Runtime: {minutes:.3f} minutes') |
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 @@ | ||
# Requirements |