diff --git a/README.md b/README.md index dbb42ca..3c6c1d2 100644 Binary files a/README.md and b/README.md differ diff --git a/convert.py b/convert.py deleted file mode 100644 index 43a4981..0000000 --- a/convert.py +++ /dev/null @@ -1,22 +0,0 @@ -import yaml - -# Load the exported environment file -with open('environment.yml', 'r') as file: - env_data = yaml.safe_load(file) - -# Extract the dependencies -dependencies = env_data['dependencies'] - -# Write dependencies to requirements.txt -with open('requirements.txt', 'w') as file: - for dep in dependencies: - if isinstance(dep, str): - # Ignore dependencies from conda-forge and other conda channels - if dep.startswith('pip') or dep.startswith('-c'): - continue - file.write(dep.split('=')[0] + '\n') - elif isinstance(dep, dict): - for key, value in dep.items(): - if key == 'pip': - for pip_dep in value: - file.write(pip_dep + '\n') diff --git a/setup.py b/setup.py index 24bd414..b34a460 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ 'Programming Language :: Python :: 3.12', ], keywords='machine learning, covariate shift, uncertainty, robust models, problematic profiles, AI', - python_requires='>=3.9,<=3.10', - packages=find_packages(exclude=['docs', 'tests']), + python_requires='>=3.9,<=3.12.3', + packages=find_packages(exclude=['docs', 'tests', 'experiments']), install_requires=requirements ) \ No newline at end of file diff --git a/tutorials/datasets_tutorial.ipynb b/tutorials/datasets_tutorial.ipynb index 32aba34..82339c5 100644 --- a/tutorials/datasets_tutorial.ipynb +++ b/tutorials/datasets_tutorial.ipynb @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -141,7 +141,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -192,7 +192,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -240,7 +240,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -256,7 +256,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -294,7 +294,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -334,7 +334,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -351,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -369,7 +369,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -397,7 +397,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -415,7 +415,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -477,7 +477,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -513,7 +513,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -530,7 +530,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 20, "metadata": {}, "outputs": [ { diff --git a/tutorials/detectron_tutorial.ipynb b/tutorials/detectron_tutorial.ipynb index 14b05db..bdeab2e 100644 --- a/tutorials/detectron_tutorial.ipynb +++ b/tutorials/detectron_tutorial.ipynb @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -77,14 +77,14 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:09<00:00, 10.27it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:09<00:00, 10.62it/s]\n" ] }, { @@ -98,7 +98,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:11<00:00, 8.51it/s]" + "running seeds: 100%|██████████| 100/100 [00:11<00:00, 8.60it/s]" ] }, { @@ -133,9 +133,33 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[{'shift_probability': 0.8111111111111111,\n", + " 'test_statistic': 8.466666666666667,\n", + " 'baseline_mean': 7.4,\n", + " 'baseline_std': 1.2631530214330944,\n", + " 'significance_description': {'no shift': 38.34567901234568,\n", + " 'small': 15.592592592592592,\n", + " 'moderate': 16.34567901234568,\n", + " 'large': 29.716049382716047},\n", + " 'Strategy': 'EnhancedDisagreementStrategy'},\n", + " {'p_value': 0.00016360887668277182,\n", + " 'u_statistic': 3545.0,\n", + " 'z-score': 0.4685784328619402,\n", + " 'shift significance': 'Small',\n", + " 'Strategy': 'MannWhitneyStrategy'}]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from MED3pa.detectron.strategies import *\n", "\n", @@ -154,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ diff --git a/tutorials/med3pa_tutorials.ipynb b/tutorials/med3pa_tutorials.ipynb index b04a0f2..f2ec805 100644 --- a/tutorials/med3pa_tutorials.ipynb +++ b/tutorials/med3pa_tutorials.ipynb @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -83,28 +83,63 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Running MED3pa Experiment on the reference set:\n" - ] - }, - { - "ename": "AttributeError", - "evalue": "'IPCModel' object has no attribute 'regressors_mapping'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[1;32mIn[3], line 10\u001b[0m\n\u001b[0;32m 7\u001b[0m med3pa_metrics \u001b[38;5;241m=\u001b[39m [\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAuc\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAccuracy\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mBalancedAccuracy\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m 9\u001b[0m \u001b[38;5;66;03m# Execute the MED3PA experiment\u001b[39;00m\n\u001b[1;32m---> 10\u001b[0m reference_results, test_results \u001b[38;5;241m=\u001b[39m \u001b[43mMed3paExperiment\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 11\u001b[0m \u001b[43m \u001b[49m\u001b[43mdatasets_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdatasets\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 12\u001b[0m \u001b[43m \u001b[49m\u001b[43mbase_model_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbase_model_manager\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 13\u001b[0m \u001b[43m \u001b[49m\u001b[43muncertainty_metric\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mAbsoluteError\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 14\u001b[0m \u001b[43m \u001b[49m\u001b[43mipc_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mRandomForestRegressor\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 15\u001b[0m \u001b[43m \u001b[49m\u001b[43mipc_params\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mipc_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 16\u001b[0m \u001b[43m \u001b[49m\u001b[43mapc_params\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mapc_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 17\u001b[0m \u001b[43m \u001b[49m\u001b[43msamples_ratio_min\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 18\u001b[0m \u001b[43m \u001b[49m\u001b[43msamples_ratio_max\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m50\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 19\u001b[0m \u001b[43m \u001b[49m\u001b[43msamples_ratio_step\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 20\u001b[0m \u001b[43m \u001b[49m\u001b[43mmed3pa_metrics\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmed3pa_metrics\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 21\u001b[0m \u001b[43m \u001b[49m\u001b[43mevaluate_models\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m 22\u001b[0m \u001b[43m \u001b[49m\u001b[43mmodels_metrics\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mMSE\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mRMSE\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[0;32m 23\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[1;32md:\\det3pa\\MED3pa\\med3pa\\experiment.py:181\u001b[0m, in \u001b[0;36mMed3paExperiment.run\u001b[1;34m(datasets_manager, base_model_manager, uncertainty_metric, ipc_type, ipc_params, ipc_grid_params, ipc_cv, apc_params, apc_grid_params, apc_cv, samples_ratio_min, samples_ratio_max, samples_ratio_step, med3pa_metrics, evaluate_models, mode, models_metrics)\u001b[0m\n\u001b[0;32m 157\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Runs the MED3PA experiment on both reference and testing sets.\u001b[39;00m\n\u001b[0;32m 158\u001b[0m \n\u001b[0;32m 159\u001b[0m \u001b[38;5;124;03mArgs:\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 178\u001b[0m \u001b[38;5;124;03m Tuple[Med3paResults, Med3paResults]: the results of the MED3PA experiment on the reference set and testing set.\u001b[39;00m\n\u001b[0;32m 179\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 180\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRunning MED3pa Experiment on the reference set:\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m--> 181\u001b[0m results_reference \u001b[38;5;241m=\u001b[39m \u001b[43mMed3paExperiment\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_run_by_set\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdatasets_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdatasets_manager\u001b[49m\u001b[43m,\u001b[49m\u001b[38;5;28;43mset\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mreference\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mbase_model_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mbase_model_manager\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[0;32m 182\u001b[0m \u001b[43m \u001b[49m\u001b[43muncertainty_metric\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43muncertainty_metric\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mipc_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mipc_type\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mipc_params\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mipc_params\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mipc_grid_params\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mipc_grid_params\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mipc_cv\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mipc_cv\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[0;32m 184\u001b[0m \u001b[43m \u001b[49m\u001b[43mapc_params\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mapc_params\u001b[49m\u001b[43m,\u001b[49m\u001b[43mapc_grid_params\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mapc_grid_params\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mapc_cv\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mapc_cv\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[0;32m 185\u001b[0m \u001b[43m \u001b[49m\u001b[43msamples_ratio_min\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msamples_ratio_min\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msamples_ratio_max\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msamples_ratio_max\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msamples_ratio_step\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msamples_ratio_step\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[0;32m 186\u001b[0m \u001b[43m \u001b[49m\u001b[43mmed3pa_metrics\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmed3pa_metrics\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mevaluate_models\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mevaluate_models\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodels_metrics\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmodels_metrics\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmode\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 187\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRunning MED3pa Experiment on the reference set:\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 188\u001b[0m results_testing \u001b[38;5;241m=\u001b[39m Med3paExperiment\u001b[38;5;241m.\u001b[39m_run_by_set(datasets_manager\u001b[38;5;241m=\u001b[39mdatasets_manager,\u001b[38;5;28mset\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtesting\u001b[39m\u001b[38;5;124m'\u001b[39m,base_model_manager\u001b[38;5;241m=\u001b[39m base_model_manager, \n\u001b[0;32m 189\u001b[0m uncertainty_metric\u001b[38;5;241m=\u001b[39muncertainty_metric,\n\u001b[0;32m 190\u001b[0m ipc_type\u001b[38;5;241m=\u001b[39mipc_type, ipc_params\u001b[38;5;241m=\u001b[39mipc_params, ipc_grid_params\u001b[38;5;241m=\u001b[39mipc_grid_params, ipc_cv\u001b[38;5;241m=\u001b[39mipc_cv, \n\u001b[0;32m 191\u001b[0m apc_params\u001b[38;5;241m=\u001b[39mapc_params,apc_grid_params\u001b[38;5;241m=\u001b[39mapc_grid_params, apc_cv\u001b[38;5;241m=\u001b[39mapc_cv, \n\u001b[0;32m 192\u001b[0m samples_ratio_min\u001b[38;5;241m=\u001b[39msamples_ratio_min, samples_ratio_max\u001b[38;5;241m=\u001b[39msamples_ratio_max, samples_ratio_step\u001b[38;5;241m=\u001b[39msamples_ratio_step, \n\u001b[0;32m 193\u001b[0m med3pa_metrics\u001b[38;5;241m=\u001b[39mmed3pa_metrics, evaluate_models\u001b[38;5;241m=\u001b[39mevaluate_models, models_metrics\u001b[38;5;241m=\u001b[39mmodels_metrics, mode\u001b[38;5;241m=\u001b[39mmode)\n", - "File \u001b[1;32md:\\det3pa\\MED3pa\\med3pa\\experiment.py:294\u001b[0m, in \u001b[0;36mMed3paExperiment._run_by_set\u001b[1;34m(datasets_manager, set, base_model_manager, uncertainty_metric, ipc_type, ipc_params, ipc_grid_params, ipc_cv, apc_params, apc_grid_params, apc_cv, samples_ratio_min, samples_ratio_max, samples_ratio_step, med3pa_metrics, evaluate_models, mode, models_metrics)\u001b[0m\n\u001b[0;32m 291\u001b[0m results \u001b[38;5;241m=\u001b[39m Med3paResults()\n\u001b[0;32m 293\u001b[0m \u001b[38;5;66;03m# Create and train IPCModel\u001b[39;00m\n\u001b[1;32m--> 294\u001b[0m IPC_model \u001b[38;5;241m=\u001b[39m \u001b[43mIPCModel\u001b[49m\u001b[43m(\u001b[49m\u001b[43mipc_type\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mipc_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 295\u001b[0m IPC_model\u001b[38;5;241m.\u001b[39mtrain(x_train, uncertainty_train)\n\u001b[0;32m 296\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIPC Model training completed.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "File \u001b[1;32md:\\det3pa\\MED3pa\\med3pa\\models.py:43\u001b[0m, in \u001b[0;36mIPCModel.__init__\u001b[1;34m(self, model_name, params)\u001b[0m\n\u001b[0;32m 35\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\u001b[38;5;28mself\u001b[39m, model_name: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mRandomForestRegressor\u001b[39m\u001b[38;5;124m'\u001b[39m, params: Optional[Dict[\u001b[38;5;28mstr\u001b[39m, Any]] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 36\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 37\u001b[0m \u001b[38;5;124;03m Initializes the IPCModel with a regression model class name and optional parameters.\u001b[39;00m\n\u001b[0;32m 38\u001b[0m \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 41\u001b[0m \u001b[38;5;124;03m params (Optional[Dict[str, Any]]): Parameters to initialize the regression model, default is None.\u001b[39;00m\n\u001b[0;32m 42\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m---> 43\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m model_name \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mregressors_mapping\u001b[49m:\n\u001b[0;32m 44\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUnsupported model name: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mmodel_name\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m. Supported models are: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msupported_ipc_models()\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 46\u001b[0m model_class \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mregressors_mapping[model_name]\n", - "\u001b[1;31mAttributeError\u001b[0m: 'IPCModel' object has no attribute 'regressors_mapping'" + "Running MED3pa Experiment on the reference set:\n", + "IPC Model training completed.\n", + "APC Model training completed.\n", + "Confidence scores calculated for minimum_samples_ratio = 0\n", + "Results extracted for minimum_samples_ratio = 0\n", + "Confidence scores calculated for minimum_samples_ratio = 5\n", + "Results extracted for minimum_samples_ratio = 5\n", + "Confidence scores calculated for minimum_samples_ratio = 10\n", + "Results extracted for minimum_samples_ratio = 10\n", + "Confidence scores calculated for minimum_samples_ratio = 15\n", + "Results extracted for minimum_samples_ratio = 15\n", + "Confidence scores calculated for minimum_samples_ratio = 20\n", + "Results extracted for minimum_samples_ratio = 20\n", + "Confidence scores calculated for minimum_samples_ratio = 25\n", + "Results extracted for minimum_samples_ratio = 25\n", + "Confidence scores calculated for minimum_samples_ratio = 30\n", + "Results extracted for minimum_samples_ratio = 30\n", + "Confidence scores calculated for minimum_samples_ratio = 35\n", + "Results extracted for minimum_samples_ratio = 35\n", + "Confidence scores calculated for minimum_samples_ratio = 40\n", + "Results extracted for minimum_samples_ratio = 40\n", + "Confidence scores calculated for minimum_samples_ratio = 45\n", + "Results extracted for minimum_samples_ratio = 45\n", + "Confidence scores calculated for minimum_samples_ratio = 50\n", + "Results extracted for minimum_samples_ratio = 50\n", + "Running MED3pa Experiment on the reference set:\n", + "IPC Model training completed.\n", + "APC Model training completed.\n", + "Confidence scores calculated for minimum_samples_ratio = 0\n", + "Results extracted for minimum_samples_ratio = 0\n", + "Confidence scores calculated for minimum_samples_ratio = 5\n", + "Results extracted for minimum_samples_ratio = 5\n", + "Confidence scores calculated for minimum_samples_ratio = 10\n", + "Results extracted for minimum_samples_ratio = 10\n", + "Confidence scores calculated for minimum_samples_ratio = 15\n", + "Results extracted for minimum_samples_ratio = 15\n", + "Confidence scores calculated for minimum_samples_ratio = 20\n", + "Results extracted for minimum_samples_ratio = 20\n", + "Confidence scores calculated for minimum_samples_ratio = 25\n", + "Results extracted for minimum_samples_ratio = 25\n", + "Confidence scores calculated for minimum_samples_ratio = 30\n", + "Results extracted for minimum_samples_ratio = 30\n", + "Confidence scores calculated for minimum_samples_ratio = 35\n", + "Results extracted for minimum_samples_ratio = 35\n", + "Confidence scores calculated for minimum_samples_ratio = 40\n", + "Results extracted for minimum_samples_ratio = 40\n", + "Confidence scores calculated for minimum_samples_ratio = 45\n", + "Results extracted for minimum_samples_ratio = 45\n", + "Confidence scores calculated for minimum_samples_ratio = 50\n", + "Results extracted for minimum_samples_ratio = 50\n" ] } ], @@ -144,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -163,7 +198,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -174,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -190,6 +225,22 @@ "Results extracted for minimum_samples_ratio = 5\n", "Confidence scores calculated for minimum_samples_ratio = 10\n", "Results extracted for minimum_samples_ratio = 10\n", + "Confidence scores calculated for minimum_samples_ratio = 15\n", + "Results extracted for minimum_samples_ratio = 15\n", + "Confidence scores calculated for minimum_samples_ratio = 20\n", + "Results extracted for minimum_samples_ratio = 20\n", + "Confidence scores calculated for minimum_samples_ratio = 25\n", + "Results extracted for minimum_samples_ratio = 25\n", + "Confidence scores calculated for minimum_samples_ratio = 30\n", + "Results extracted for minimum_samples_ratio = 30\n", + "Confidence scores calculated for minimum_samples_ratio = 35\n", + "Results extracted for minimum_samples_ratio = 35\n", + "Confidence scores calculated for minimum_samples_ratio = 40\n", + "Results extracted for minimum_samples_ratio = 40\n", + "Confidence scores calculated for minimum_samples_ratio = 45\n", + "Results extracted for minimum_samples_ratio = 45\n", + "Confidence scores calculated for minimum_samples_ratio = 50\n", + "Results extracted for minimum_samples_ratio = 50\n", "Running MED3pa Experiment on the reference set:\n", "IPC Model training completed.\n", "APC Model training completed.\n", @@ -199,6 +250,22 @@ "Results extracted for minimum_samples_ratio = 5\n", "Confidence scores calculated for minimum_samples_ratio = 10\n", "Results extracted for minimum_samples_ratio = 10\n", + "Confidence scores calculated for minimum_samples_ratio = 15\n", + "Results extracted for minimum_samples_ratio = 15\n", + "Confidence scores calculated for minimum_samples_ratio = 20\n", + "Results extracted for minimum_samples_ratio = 20\n", + "Confidence scores calculated for minimum_samples_ratio = 25\n", + "Results extracted for minimum_samples_ratio = 25\n", + "Confidence scores calculated for minimum_samples_ratio = 30\n", + "Results extracted for minimum_samples_ratio = 30\n", + "Confidence scores calculated for minimum_samples_ratio = 35\n", + "Results extracted for minimum_samples_ratio = 35\n", + "Confidence scores calculated for minimum_samples_ratio = 40\n", + "Results extracted for minimum_samples_ratio = 40\n", + "Confidence scores calculated for minimum_samples_ratio = 45\n", + "Results extracted for minimum_samples_ratio = 45\n", + "Confidence scores calculated for minimum_samples_ratio = 50\n", + "Results extracted for minimum_samples_ratio = 50\n", "Running Global Detectron Experiment:\n" ] }, @@ -206,7 +273,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.52it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.82it/s]\n" ] }, { @@ -220,7 +287,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:11<00:00, 8.76it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:11<00:00, 8.59it/s]\n" ] }, { @@ -236,7 +303,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:07<00:00, 13.26it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:08<00:00, 12.48it/s]\n" ] }, { @@ -250,7 +317,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:03<00:00, 26.26it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:04<00:00, 24.54it/s]\n" ] }, { @@ -266,7 +333,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:04<00:00, 21.26it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:05<00:00, 18.29it/s]\n" ] }, { @@ -282,7 +349,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:07<00:00, 13.02it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:07<00:00, 13.04it/s]\n" ] }, { @@ -298,7 +365,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:07<00:00, 13.26it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:07<00:00, 12.83it/s]\n" ] }, { @@ -314,7 +381,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.37it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.52it/s]\n" ] }, { @@ -330,7 +397,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.11it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:11<00:00, 8.93it/s]\n" ] }, { @@ -346,7 +413,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.66it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.74it/s]\n" ] }, { @@ -362,7 +429,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "running seeds: 100%|██████████| 100/100 [00:10<00:00, 9.81it/s]\n" + "running seeds: 100%|██████████| 100/100 [00:09<00:00, 10.66it/s]\n" ] }, { @@ -402,7 +469,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [