Question: PLEASE HELP ME how do I fix NameError: name 'logreg' is not defined ctivity 6: Model Prediction and Evaluation - Test Set Predict the values
ctivity 6: Model Prediction and Evaluation - Test Set Predict the values for the test set by calling the predict () function on the Logistic Regression object. Print the unique labels predicted using Logistic Regression on test features. Print the distribution of the labels predicted in the predicted target series for the test features. \# Predict the values of 'target' by the logistic regression model on the test set. \# Predict the target for the test features data y.pred test = logreg predict (x test ) * Convert the predicted array lnto series y_pred_test = pd. Series ( y _pred_test) \# Print the unique labels in the predicted series for test features print( "Unique labels in the predicted series for test features:", y_pred_test. unique()) * Print the distribution labels in the predicted series for test features print( "Distribution of the labels in the predicted series for test features: ") print(y_pred_test.value_counts()) NameError Traceback (most recent call last) in 2 3 \# Predict the target for the test features data 4 y pred_test =logregpredict(x test) 6 \# Convert the predicted array into series NameError: name 'logreg' is not defined SEARCH STACK OVERFLOW
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
