Machine Learning, Python, Programming, Data Science, Technology.
numpy as np from sklearn.linear_model import LinearRegression import pandas as pd X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]]) # Convert the array X into a pandas dataframe train_df = pd.DataFrame(X, columns=['a', 'b']) # Create a new column 'y' with the formula y = 3 + a + 2*b np.random.seed(5)