Amburoute

October 27, 2023 (1y ago)

This project involves several Python scripts, each serving a unique purpose:

Training the Model

The training process involves reading city data, transforming it into a suitable format, and fitting a logistic regression model. Here’s a breakdown of the train.py script:

Example Code for Training

from sklearn.externals import joblib
from sklearn.linear_model import LogisticRegression
 
class Trainer(object):
    def __init__(self, map, binary):
        self.map = map
        self.binary = binary
 
    def train(self, data):
        x, y = self.__transform(data)
        model = LogisticRegression(multi_class='multinomial', solver='saga')
        model.fit(x, y)
        return model