Customer churn - #3
Conversation
ayush714
left a comment
There was a problem hiding this comment.
Good work, I listed out some comments below and now one of the major comment which I want to list is formatting and styling, we recommend you to use black and isort in vs code to format your code to be consistent. You can check this blog for reference.
| @@ -0,0 +1,42 @@ | |||
| import pandas as pd | |||
|
|
|||
| class DataPreprocessing: | |||
There was a problem hiding this comment.
Please give a good doc string for this, It should be informative and professional.
|
|
||
| class DataPreprocessing: | ||
|
|
||
| def __init__(self, train_data, transaction_data, user_logs_data, members_data) -> None: |
There was a problem hiding this comment.
Add docstring with parameter information, like (below is just an example) :-
def train_model(
x_train: pd.DataFrame,
x_test: pd.DataFrame,
y_train: pd.Series,
y_test: pd.Series,
config: ModelNameConfig,
) -> RegressorMixin:
"""It trains all the regression models and outputs the best model.
Args:
x_train: pd.DataFrame
x_test: pd.DataFrame
y_train: pd.Series
y_test: pd.Series
Returns:
model: RegressorMixin
"""| self.user_logs_data = user_logs_data | ||
| self.members_data = members_data | ||
|
|
||
| def drop_duplicates(self): |
There was a problem hiding this comment.
Add the same param information and doc string to every method and add error handling blocks as well and use rich print for that. https://rich.readthedocs.io/en/stable/introduction.html
There was a problem hiding this comment.
(rich print)so basically you want to print params of every class or method in CLI
| @@ -0,0 +1,15 @@ | |||
| # https://www.technologiesinindustry4.com/2021/07/how-to-use-kaggle-api-in-python.html | |||
|
|
|||
| import py7zr | |||
There was a problem hiding this comment.
same like above comments, wrap this in function or class.
| raise e | ||
|
|
||
|
|
||
| if __name__ == "__main__": |
There was a problem hiding this comment.
should i remove the 20th line.
or everything below it? what exactly?
There was a problem hiding this comment.
remove the if name == "main" and all things after it.
created raw/raw_data_ingestion.py and and interim/interm_data_process.py
Added code in existing file of src/data/make_dataset.py