import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error

data = {
    'feature_1': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    'feature_2': [10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
    'feature_3': [2, 4, 6, 8, 10, 12, 14, 16, 18, 20],
    'target_column': [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]  # Target variable
}

df = pd.DataFrame(data)

X = df.drop('target_column', axis=1)  
y = df['target_column'] 

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)

model = LinearRegression()
model.fit(X_train, y_train)

y_pred = model.predict(X_test)

print("Predicted values:")
print(y_pred)

mse = mean_squared_error(y_test, y_pred)
print(f'Mean Squared Error: {mse}')

r2_score = model.score(X_test, y_test)
print(f"Model R-squared Score (R^2): {r2_score}")
