Tennis Ace Challenge Project (Python)

So i’ve tryed to get ranking score from different featrures. Maybe there is too many cycles, but i fell like that will do.

For anyone interested, here’s an easy fuction you can use to create a pipeline for running different MLR models:

def multiple_reg_model(y_col, *args):
X_list =
for i in args:
X = df[X_list]

y = df[y_col]
y = y.values.reshape(-1,1)

x_train, x_test, y_train, y_test = train_test_split(X, y, train_size = 0.8, test_size = 0.2, random_state = 1)

line_fitter = LinearRegression(), y_train)

y_line_prediction = line_fitter.predict(x_test)

plt.scatter(y_test, y_line_prediction, alpha = 0.4)

print(line_fitter.score(x_train, y_train),
line_fitter.score(x_test, y_test))

#e.g function call:

multiple_reg_model(‘Winnings’, ‘Wins’, ‘ReturnGamesPlayed’, ‘ServiceGamesPlayed’, ‘BreakPointsOpportunities’, ‘BreakPointsFaced’)

Hello, here is my code, a little messy:

tennis exercice

Hi there! I suppose my solution is rather eccentric. I also wouldn’t suggest to compute this at home, but make sure to take a look at it and please tell me your thoughts! Thanks :grimacing: :sweat_smile: