代码:
from sklearn import model_selection
from sklearn.linear_model import LogisticRegression
# Initialize our algorithm
alg = LogisticRegression(random_state=1)
# Change to alg = LogisticRegression(random_state=1, solver='liblinear')
# Compute the accuracy score for all the cross validation folds. (much simpler than what we did before!)
scores = model_selection.cross