Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  Enroll Now

Spam Classifier - Train a LogisticRegression model on the Dataset

Now we will train a LogisticRegression model on the dataset, and see how it performs.

  • Import LogisticRegression and cross_val_score from Scikit-learn's linear_model and model_selection respectively:

    from sklearn.linear_model import << your code goes here >>
    from sklearn.<< your code goes here>> import cross_val_score
  • Next, let's train the LogisticRegression model:

    log_clf = << your code goes here >>(solver="lbfgs", random_state=42)
  • Finally, let us calculate the cross validation score, and the mean score:

    score = << your code goes here >>(log_clf, X_train_transformed, y_train, cv=3, verbose=3)

No hints are availble for this assesment

Answer is not availble for this assesment

Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...