Question: LAB 1 . 6 . 1 : LAB: Model workflow in scikit - learn The dataset fg _ attempts.csv contains data on field goal distance

LAB
1.6.1: LAB: Model workflow in scikit-learn
The dataset fg_attempts.csv 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 yArray .
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
 LAB 1.6.1: LAB: Model workflow in scikit-learn The dataset fg_attempts.csv contains

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!