Skip to content

Commit

Permalink
fixed pre commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhal baccouri committed Nov 19, 2021
1 parent 4350cbe commit 69cef07
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 89 deletions.
8 changes: 4 additions & 4 deletions examples/indian-diabetes-example/neural-network.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@


dataset:
type: csv
random_numbers:
generate_reproducible: true
seed: 101

# model definition
model:
type: classification
algorithm: NeuralNetwork

# target you want to predict
# target(s) you want to predict
target:
- sick
29 changes: 15 additions & 14 deletions examples/indian-diabetes-example/random-forest.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@


# dataset operations
dataset:
type: csv
random_numbers:
generate_reproducible: true
seed: 42
split: # split options
test_size: 0.2 # 0.2 means 20% for the test data, so 80% are automatically for training
shuffle: True # whether to shuffle the data before/while splitting
split:
test_size: 0.2
shuffle: True

preprocess: # preprocessing options
missing_values: mean # other possible values: [drop, median, most_frequent, constant] check the docs for more
preprocess:
missing_values: mean
encoding:
type: oneHotEncoding # other possible values: [labelEncoding]
scale: # scaling options
method: standard # standardization will scale values to have a 0 mean and 1 standard deviation | you can also try minmax
target: inputs # scale inputs. | other possible values: [outputs, all] # if you choose all then all values in the dataset will be scaled
type: oneHotEncoding
scale:
method: standard
target: inputs


# model definition
model:
type: classification
algorithm: RandomForest
arguments:
n_estimators: 100
max_depth: 30
hyperparameter_search:
method: random_search
parameter_grid:
max_depth: [6, 10]
n_estimators: [100, 300]
max_features: [auto, sqrt]


# target you want to predict
target:
- sick
2 changes: 1 addition & 1 deletion igel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
try:
__version__ = version(__name__)
except PackageNotFoundError:
__version__ = "0.5.0"
__version__ = "0.7.0"


__author__ = "Nidhal Baccouri"
Expand Down
69 changes: 0 additions & 69 deletions igel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import igel
import pandas as pd
from igel import Igel, metrics_dict
from igel.auto import IgelCNN
from igel.constants import Constants
from igel.servers import fastapi_server
from igel.utils import print_models_overview, show_model_info, tableize
Expand Down Expand Up @@ -73,29 +72,6 @@ def fit(data_path: str, yaml_path: str) -> None:
Igel(cmd="fit", data_path=data_path, yaml_path=yaml_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option(
"--data_path", "-dp", required=True, help="Path to your training dataset"
)
@click.option(
"--task",
"-t",
required=False,
help="task you want to run. This refers to the goal you want to achieve (e.g ImageClassification)",
)
@click.option(
"--yaml_path",
"-yml",
required=False,
help="Path to your igel configuration file (yaml or json file)",
)
def auto_train(data_path: str, task: str, yaml_path: str) -> None:
"""
Automatically search for and train a suitable deep neural network for a task
"""
IgelCNN(cmd="train", data_path=data_path, task=task, yaml_path=yaml_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option(
"--data_path", "-dp", required=True, help="Path to your evaluation dataset"
Expand All @@ -107,17 +83,6 @@ def evaluate(data_path: str) -> None:
Igel(cmd="evaluate", data_path=data_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option(
"--data_path", "-dp", required=True, help="Path to your evaluation dataset"
)
def auto_evaluate(data_path: str) -> None:
"""
Evaluate the performance of an existing machine learning model
"""
IgelCNN(cmd="evaluate", data_path=data_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option("--data_path", "-dp", required=True, help="Path to your dataset")
def predict(data_path: str) -> None:
Expand All @@ -127,15 +92,6 @@ def predict(data_path: str) -> None:
Igel(cmd="predict", data_path=data_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option("--data_path", "-dp", required=True, help="Path to your dataset")
def auto_predict(data_path: str) -> None:
"""
Use an existing machine learning model to generate predictions
"""
IgelCNN(cmd="predict", data_path=data_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option(
"--data_paths",
Expand All @@ -161,31 +117,6 @@ def experiment(data_paths: str, yaml_path: str) -> None:
Igel(cmd="predict", data_path=pred_data_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option(
"--data_paths",
"-DP",
required=True,
help="Path to your datasets as string separated by space",
)
@click.option(
"--yaml_path",
"-yml",
required=True,
help="Path to your igel configuration file (yaml or json file)",
)
def auto_experiment(data_paths: str, yaml_path: str) -> None:
"""
train, evaluate and use pre-trained model for predictions in one command
"""
train_data_path, eval_data_path, pred_data_path = data_paths.strip().split(
" "
)
IgelCNN(cmd="train", data_path=train_data_path, yaml_path=yaml_path)
IgelCNN(cmd="evaluate", data_path=eval_data_path)
IgelCNN(cmd="predict", data_path=pred_data_path)


@cli.command(context_settings=CONTEXT_SETTINGS)
@click.option(
"--model_results_dir",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.1
current_version = 0.7.0

[darglint]
strictness = long
Expand Down

0 comments on commit 69cef07

Please sign in to comment.