Answered step by step
Verified Expert Solution
Link Copied!

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 fg_attempts. sv contains data on field goal distance and outcome (whether or not the kick was successful) during the
2012 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 np.ravel ().
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 user-input 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 =25 and ScoreDiffPreKick =8, the program input is:
25
8
and the program output is:
[1]
0.8604651162790697
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analytics Systems Engineering Cybersecurity Project Management

Authors: Christopher Greco

1st Edition

168392648X, 978-1683926481

More Books

Students also viewed these Databases questions