Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hyperparameter tuning with keras-tuning and RandomSearch #6

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ cython_debug/

# tensorflow
**/logs/*
**/tuner/*

#vscode
*.code-workspace

# plot_model
*.png
draft.py

18 changes: 18 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import logging
from dataclasses import dataclass

# logging
LOGGING_FORMAT = "%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s"
Expand All @@ -25,3 +26,20 @@ def get_logger(name):
# SizeManager config
SIZING_DIR_NAME = "sizing_systems"
SIZING_SYSTEM_DIR_PATH = os.path.join(DATA_DIR_PATH, SIZING_DIR_NAME)


@dataclass
class ModelConfig:
test_size: float = 0.3
embedding_dim: int = 4
learning_rate: float = 0.005
batch_size: int = 256
checkpoint_path: str = os.path.join(os.getcwd(), "model_checkpoints")
validation_split: float = 0.2
epochs: int = 2_000
fit_verbose: int = 0
asym_loss_gamma: float = 0.5
classification_loss: str = "categorical_crossentropy"
embedding_func: str = "subtract"
early_stopping__patience: int = 50
early_stopping__restore_best_weights: bool = True
7 changes: 0 additions & 7 deletions pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,4 @@
]
)

USED_COLUMNS = (
EMBEDDING_COLUMNS
+ USER_CATEGORICAL_COLUMNS
+ SKU_NUMERICAL_COLUMNS
+ [TARGET_COLUMN]
)

target_pipe = LabelBinarizer()
Loading