-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hydra was added. Dataclasses weren't added because they seem to make …
…things more messier
- Loading branch information
1 parent
f0dd799
commit d92cbc7
Showing
12 changed files
with
141 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
model: | ||
name: cb | ||
hyperparams: | ||
depth: 6 | ||
n_estimators: 1000 | ||
eval_metric: R2 | ||
task_type: CPU | ||
random_seed: 0 | ||
learning_rate: 0.3 | ||
l2_leaf_reg: 3 | ||
loss_function: RMSE | ||
metric_period: 100 | ||
|
||
training: | ||
checkpoint_name: cb_model.p | ||
|
||
inference: | ||
checkpoint_name: cb_model.p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
model: | ||
name: rf | ||
hyperparams: | ||
n_estimators: 500 | ||
random_state: 0 | ||
|
||
training: | ||
checkpoint_name: rf_model.p | ||
|
||
inference: | ||
checkpoint_name: rf_model.p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
from typing import List | ||
|
||
from omegaconf import DictConfig | ||
|
||
from .base import BaseModel | ||
from .catboost import CatboostModel | ||
from .random_forest import RandomForest | ||
|
||
|
||
def prepare_model( | ||
model_type: str, | ||
cfg: DictConfig, | ||
numerical_features: List[str], | ||
categorical_features: List[str], | ||
) -> BaseModel: | ||
if model_type == "rf": | ||
return RandomForest(numerical_features, categorical_features) | ||
elif model_type == "cb": | ||
return CatboostModel(numerical_features, categorical_features) | ||
if cfg.model.name == "rf": | ||
return RandomForest(cfg, numerical_features, categorical_features) | ||
elif cfg.model.name == "cb": | ||
return CatboostModel(cfg, numerical_features, categorical_features) | ||
else: | ||
raise AssertionError(f"Unknown model name: {model_type}") | ||
raise AssertionError(f"Unknown model name: {cfg.model.name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.