Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go_server/jsonParam.txt

Large diffs are not rendered by default.

861 changes: 861 additions & 0 deletions go_server/json_params_dict.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pythonCode/med_libs/GoExecutionScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def __init__(self, json_params: dict, _id: str = "default_id", debug: bool = Fal
self._progress = {"now": 0, "currentLabel": ""}
self._id = _id
self._debug = debug
if self._debug:
# save json_params_dict to a file
with open('json_params_dict.json', 'w') as f:
json.dump(json_params, f, indent=4)

def start(self):
"""
Expand Down
19 changes: 16 additions & 3 deletions pythonCode/med_libs/MEDml/MEDexperiment_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ def setup_dataset(self, node: Node):
elif kwargs['use_gpu'] == "False":
kwargs['use_gpu'] = False

if 'index' in kwargs:
if kwargs['index'] == "True":
kwargs['index'] = True
elif kwargs['index'] == "False":
kwargs['index'] = False


# add the imports
node.CodeHandler.add_import("import numpy as np")
node.CodeHandler.add_import("import pandas as pd")
Expand All @@ -137,9 +144,15 @@ def setup_dataset(self, node: Node):
medml_logger = MEDml_logger()

# setup the experiment
pycaret_exp.setup(temp_df, log_experiment=medml_logger, **kwargs)
node.CodeHandler.add_line(
"code", f"pycaret_exp.setup(temp_df, {node.CodeHandler.convert_dict_to_params(kwargs)})")
if 'test_data' in kwargs:
test_data_df = pd.read_csv(kwargs['test_data']['path'])
node.CodeHandler.add_line("code", f"test_data_df = pd.read_csv('{kwargs['test_data']}'")
node.CodeHandler.add_line("code", f"pycaret_exp.setup(temp_df, test_data=test_data_df, {node.CodeHandler.convert_dict_to_params(kwargs)})")
del kwargs['test_data']
pycaret_exp.setup(temp_df, test_data=test_data_df, log_experiment=medml_logger, **kwargs)
else:
pycaret_exp.setup(temp_df, log_experiment=medml_logger, **kwargs)
node.CodeHandler.add_line("code", f"pycaret_exp.setup(temp_df, {node.CodeHandler.convert_dict_to_params(kwargs)})")
node.CodeHandler.add_line(
"code", f"dataset = pycaret_exp.get_config('X').join(pycaret_exp.get_config('y'))")
dataset_metaData = {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
import dpath.util as dp
from collections.abc import MutableMapping

# EXAMPLE USAGE
# cd pythonCode/med_libs/MEDml/utils/settings_generator
# python settings_generator.py --ml_type classification

# python scripts arguments
import argparse
parser = argparse.ArgumentParser(description='Script so useful.')
Expand Down Expand Up @@ -360,6 +364,39 @@ def specific_case(dict_settings: dict) -> dict:
del dict_settings['analyze']['interpret_model']['options']['save']
del dict_settings['load_model']['options']['model_name']

# NOT SUPPORTED
del dict_settings['dataset']['options']['data_func']
del dict_settings['dataset']['options']['ordinal_features']
del dict_settings['dataset']['options']['encoding_method']
del dict_settings['dataset']['options']['group_features']
del dict_settings['dataset']['options']['custom_pipeline']
del dict_settings['dataset']['options']['experiment_custom_tags']
del dict_settings['dataset']['options']['engine']
del dict_settings['dataset']['options']['memory']
del dict_settings['dataset']['options']['profile']
del dict_settings['dataset']['options']['profile_kwargs']
del dict_settings['compare_models']['options']['engine']
del dict_settings['compare_models']['options']['fit_kwargs']
del dict_settings['create_model']['options']['engine']
del dict_settings['create_model']['options']['fit_kwargs']
del dict_settings['create_model']['options']['experiment_custom_tags']
del dict_settings['analyze']['plot_model']['options']['fit_kwargs']
del dict_settings['analyze']['plot_model']['options']['plot_kwargs']
del dict_settings['analyze']['dashboard']['options']['dashboard_kwargs']
del dict_settings['analyze']['dashboard']['options']['run_kwargs']
del dict_settings['finalize']['options']['fit_kwargs']
del dict_settings['finalize']['options']['experiment_custom_tags']
del dict_settings['load_model']['options']['platform']
del dict_settings['load_model']['options']['authentication']
del dict_settings['tune_model']['options']['custom_grid']
del dict_settings['tune_model']['options']['custom_scorer']
del dict_settings['tune_model']['options']['fit_kwargs']
del dict_settings['ensemble_model']['options']['fit_kwargs']
del dict_settings['blend_models']['options']['fit_kwargs']
del dict_settings['stack_models']['options']['fit_kwargs']
if ml_type == "classification":
del dict_settings['calibrate_model']['options']['fit_kwargs']

return dict_settings


Expand Down
Loading