2. Introduction to Scikit-Learn and Model Evaluation
Activity 2.01: Performing Logistic Regression with a New Feature and Creating a Precision-Recall Curve
Solution:
- Use scikit-learn's
train_test_split
to make a new set of training and test data. This time, instead ofEDUCATION
, useLIMIT_BAL
, the account's credit limit, as the feature.Execute the following code to do this:
X_train_2, X_test_2, y_train_2, y_test_2 = train_test_split\ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (df['LIMIT_BAL']\ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ...