Question: The dataset fg _ attempts. sv contains data on field goal distance and outcome ( whether or not the kick was successful ) during the
The dataset fgattempts. sv contains data on field goal distance and outcome whether or not the kick was successful during the
NFL seasons.
Create a dataframe X with input features Distance and ScoreDiffPreKick.
Create a dataframe y with output feature outcome.
Flatten y into an array called yArray using npravel
Initialize a logistic regression model using LogisticRegression
Fit the model to the input and flattened output features in X and y Array.
Create a new dataframe XNew with userinput values for Distance and ScoreDiffPreKick.
Use the fitted logistic regression model to predict the outcome from the new data.
Determine the accuracy of a fitted logistic regression classification model.
Ex: If the new dataframe contains Distance and ScoreDiffPreKick the program input is:
and the program output is:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
