-1
X, y = make_classification(n_samples=1000, n_features=10, weights=[0.9, 0.1], random_state=42)

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

model = LogisticRegression()
model.fit(X_train, y_train)

y_pred = model.predict(X_test)

accuracy = accuracy_score(y_test, y_pred)
print("Accuracy:", accuracy)

I'm trying to train a logistic regression model, but I'm encountering a DataConversionWarning.

I understand that this has something to do with the shape of the target labels, but I'm not quite sure how to fix it.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • 1
    Welcome to StackOverflow! To be able to help you with your question in the best possible way, can you please copy the warning and paste it in the question? – DataJanitor Aug 30 '23 at 09:32

0 Answers0