ageron / ageron/handson-ml

Chapter 3 (Page 82): Getting error during Fitting the SGD Classifier with Training data

Đang mở
#678 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
25.6k
Fork
12.7k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

**I getting errors for these lines of codes:**

from sklearn.linear_model import SGDClassifier
y_train_5 = (y_train == 5)
y_test_5 = (y_test == 5)
sgd_clf = SGDClassifier(max_iter=5, tol=1e-3, random_state=42)
sgd_clf.fit(X_train, y_train_5)

****ValueError:** The number of classes has to be greater than one; got 1 class**

How can I solve this issue? Please guide me. Thank you so much.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.