Skip to content

Commit f21256c

Browse files
committed
adjusted sample data path and results path. added initial results analysis code block.
1 parent 7c38a8c commit f21256c

1 file changed

Lines changed: 38 additions & 5 deletions

File tree

notebooks/unit_test_synthetic_time_series.ipynb

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
"\n",
284284
"from ml_grid.pipeline.data import pipe\n",
285285
"\n",
286-
"base_project_dir_global = 'HFE_ML_experiments/'\n",
286+
"base_project_dir_global = 'HFE_ML_experiments_ts/'\n",
287287
"\n",
288288
"logger = setup_logger(log_folder_path = base_project_dir_global)\n",
289289
"\n",
@@ -309,7 +309,7 @@
309309
"\n",
310310
"pathlib.Path(base_project_dir).mkdir(parents=True, exist_ok=True) \n",
311311
"\n",
312-
"input_csv_path = os.path.join('..', 'gloabl_files', 'ml_binary_classification_gridsearch_hyperOpt', 'notebooks' ,'unit_test_synthetic_time_series_data_large.csv') #large\n",
312+
"input_csv_path = 'unit_test_synthetic_time_series_data_large.csv' #large\n",
313313
"\n",
314314
"#init csv to store each local projects results\n",
315315
"\n",
@@ -423,7 +423,7 @@
423423
"best = fmin(fn=objective,\n",
424424
" space=space,\n",
425425
" algo=tpe.suggest,\n",
426-
" max_evals=100,\n",
426+
" max_evals=2,\n",
427427
" trials = trials,\n",
428428
" verbose=1\n",
429429
" )"
@@ -477,6 +477,39 @@
477477
"feature_encoding_to_feature_names(pd.read_csv('../gloabl_files/ml_grid_ts_project/ml_binary_classification_gridsearch_hyperOpt/ml_grid/tests/unit_test_synthetic_time_series_data_large.csv'), results_df)"
478478
]
479479
},
480+
{
481+
"cell_type": "code",
482+
"execution_count": null,
483+
"metadata": {},
484+
"outputs": [],
485+
"source": [
486+
"# Import the necessary classes\n",
487+
"from ml_grid.results_processing.core import ResultsAggregator\n",
488+
"from ml_grid.results_processing.plot_master import MasterPlotter\n",
489+
"import pandas as pd\n",
490+
"\n",
491+
"# 1. Load your data using the ResultsAggregator\n",
492+
"# Replace with the actual path to your results and feature names file.\n",
493+
"# The feature_names_csv is optional but required for feature-related plots.\n",
494+
"try:\n",
495+
" aggregator = ResultsAggregator(\n",
496+
" root_folder='HFE_ML_experiments_ts',\n",
497+
" feature_names_csv='test_data_hfe_1yr_m_small_multiclass.csv')\n",
498+
" results_df = aggregator.aggregate_all_runs()\n",
499+
"\n",
500+
" # 2. Instantiate the MasterPlotter with your data\n",
501+
" master_plotter = MasterPlotter(results_df)\n",
502+
"\n",
503+
" # 3. Call the plot_all() method to generate all visualizations\n",
504+
" # You can customize the primary metric and other options.\n",
505+
" master_plotter.plot_all(metric='auc', stratify_by_outcome=True)\n",
506+
"\n",
507+
"except (ValueError, FileNotFoundError) as e:\n",
508+
" print(f\"An error occurred: {e}\")\n",
509+
" print(\"Please ensure your results folder path is correct and contains valid run data.\")\n",
510+
"\n"
511+
]
512+
},
480513
{
481514
"cell_type": "code",
482515
"execution_count": null,
@@ -855,7 +888,7 @@
855888
"kernelspec": {
856889
"display_name": "ml_grid_ts_env",
857890
"language": "python",
858-
"name": "ml_grid_ts_env"
891+
"name": "python3"
859892
},
860893
"language_info": {
861894
"codemirror_mode": {
@@ -867,7 +900,7 @@
867900
"name": "python",
868901
"nbconvert_exporter": "python",
869902
"pygments_lexer": "ipython3",
870-
"version": "3.10.9"
903+
"version": "3.10.12"
871904
}
872905
},
873906
"nbformat": 4,

0 commit comments

Comments
 (0)