Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started