import numpy as np 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 = pd.read_csv('aviator_data.csv')
data['Result'] = data['Result'].map({'Win': 1, 'Loss': 0})
X = data[['PlayerID', 'BetAmount']] y = data['Result']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
model = LinearRegression() model.fit(X_train, y_train)
y_pred = model.predict(X_test) mse = mean_squared_error(y_test, y_pred) print(f"Mean Squared Error: {mse}")
new_player = pd.DataFrame({'PlayerID': [1234], 'BetAmount': [100]}) prediction = model.predict(new_player) print(f"Predicted probability of winning: {prediction[0]:.2f}")