In my dataset, there are statistics of every match played by a basketball team during a season (points scored, three-point...). what I want is to predict whether it will win (i.e. 1 or 0) with statistics such as how many points and threes in the next game it will play.
I have defined my variable y as the game result in my dataset (0 or 1),
The variable I define as x_data
is the directory where the team's statistics are kept.
y = data.Result.values
x_data = data.drop(["Result"],axis='columns')
I first normalize the data and split it as train/test.
# Normalization
x = (x_data - np.min(x_data))/(np.max(x_data) - np.min(x_data)).values
# train test split
x_train, x_test, y_train, y_test = train_test_split(x,y, test_size = 0.2, random_state=42)
x_train = x_train.T
x_test = x_test.T
y_train = y_train.T
y_test = y_test.T
and then I try to guess
mlr = LinearRegression()
mlr.fit(x_train.T,y_train.T)
mlr.predict(x_test.T)
print("mlr test accuracy: {}".format(mlr.score(x_test.T,y_test.T)))
The result I get is just probability. What I want to achieve is to find an answer to the question of whether the team will win or not in the next match.
What should I do in this situation?