import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report, confusion_matrix
x = np.arange(10).reshape(-1, 1)
y = np.array([0, 0, 0, 0, 1, 1, 1, 1, 1, 1])
model = LogisticRegression(solver='liblinear', random_state=0)
model.fit(x, y)
# LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,
# intercept_scaling=1, l1_ratio=None, max_iter=100,
# multi_class='warn', n_jobs=None, penalty='l2',
# random_state=0, solver='liblinear', tol=0.0001, verbose=0,
# warm_start=False)
model = LogisticRegression(solver='liblinear', random_state=0)
model.fit(x, y)
print(model.classes_)
print(model.intercept_)
print(model.coef_)
# In the ma
logistic regression
于 2023-04-03 15:40:11 首次发布