Inquiry regarding a linear regression model using Python and pandas

32 views Asked by At

I have a dataset with nfl historical data from 2003-2023. I wanted to use linear regression to predict the number of wins for the upcoming nfl season.

X = nfl.drop('wins', axis=1).values
y = nfl['wins'].values
print(X.shape)
print(y.shape)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42,         shuffle=True)


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

predictions = model.predict(X_test)

The predictions variable outputs an array with 128 different values. What should I do to only get 32 values that will correspond to the 32 nfl teams?

0

There are 0 answers