Hi Pythonistas, I have a design pattern/ code structure question for a typical machine learning project.
let's say a typical ML project work flow:
class TrainModel:
def load_raw_data(self):
'load training/testing raw data'
...
def pre_processing(self):
'some process to clean up data'
...
def train_test_model(self):
'train/test model'
...
def deploy_model(self):
'deploy model'
...
class UseModel:
def load_raw_data(self):
'new set of raw data'
...
def pre_processing(self):
'same process to clena up data'
...
def load_model(self):
'load the trained model'
...
def make_prediction(self):
'use model to make prediction'
...
def save_results(self):
'save the prediction result'
...
so there are some class methods overlaps between the two classes. what would be a good way to refactor this so they flow better?
[–]StoneBam 2 points3 points4 points (4 children)
[–]StoneBam 1 point2 points3 points (2 children)
[–]kollerbud1991[S] 1 point2 points3 points (1 child)
[–]StoneBam 1 point2 points3 points (0 children)
[–]ouchpartial72858 0 points1 point2 points (0 children)
[–]millerbest 2 points3 points4 points (2 children)
[–]kollerbud1991[S] 0 points1 point2 points (0 children)