Skip to content

Instantly share code, notes, and snippets.

@gmyrianthous
Created August 20, 2023 08:39
Show Gist options
  • Save gmyrianthous/7c387b16ae8bd447e2c8cedaf6043dbd to your computer and use it in GitHub Desktop.
Save gmyrianthous/7c387b16ae8bd447e2c8cedaf6043dbd to your computer and use it in GitHub Desktop.
from sklearn import preprocessing
from sklearn.linear_model import LogisticRegression
# Label encoding
label_encoder = preprocessing.LabelEncoder()
train_Y = label_encoder.fit_transform(train_Y)
# Model training
clf = LogisticRegression()
clf.fit(train_X, train_Y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment