-
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.
Added the only one entrypoint --- commands.py. Corrected imports.
- Loading branch information
1 parent
ec4148b
commit ecbe8a0
Showing
4 changed files
with
43 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import fire | ||
|
||
from mlopscourse.infer import infer | ||
from mlopscourse.train import train | ||
|
||
|
||
def outer_train(model_type: str) -> None: | ||
""" | ||
Trains the chosen model on the train split of the dataset and saves the checkpoint. | ||
Parameters | ||
---------- | ||
model_type : str | ||
The type of model for training. Should be "rf" for RandomForest and "cb" | ||
for CatBoost. | ||
""" | ||
train(model_type) | ||
|
||
|
||
def outer_infer(model_type: str, ckpt: str) -> None: | ||
""" | ||
Runs the chosen model on the test set of the dataset and calculates the R^2 metric. | ||
Parameters | ||
---------- | ||
model_type : str | ||
The type of model that was used for training. Should be "rf" for RandomForest | ||
and "cb" for CatBoost. | ||
ckpt : str | ||
The filename inside 'checkpoint/' to load the model from. Should also contain the | ||
the filename extension. | ||
""" | ||
infer(model_type, ckpt) | ||
|
||
|
||
if __name__ == "__main__": | ||
fire.Fire() |
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