diff --git a/machine_learning/machine_learning.py b/machine_learning/machine_learning.py index f53b8d14a..67f4caf10 100644 --- a/machine_learning/machine_learning.py +++ b/machine_learning/machine_learning.py @@ -1,19 +1,20 @@ -import pandas as pd import numpy as np +import pandas as pd from sklearn.linear_model import LinearRegression + class MachineLearning: def __init__(self): pass def train_model(self, data): - X = data[['feature1', 'feature2']] - y = data['target'] + X = data[["feature1", "feature2"]] + y = data["target"] model = LinearRegression() model.fit(X, y) return model def predict(self, model, data): - X = data[['feature1', 'feature2']] + X = data[["feature1", "feature2"]] y = model.predict(X) return y