Skip to content

Instantly share code, notes, and snippets.

@lazuxd
Created February 26, 2020 21:15
Show Gist options
  • Save lazuxd/7c674039f7763d9aba51a6bbdd8e3295 to your computer and use it in GitHub Desktop.
Save lazuxd/7c674039f7763d9aba51a6bbdd8e3295 to your computer and use it in GitHub Desktop.
Maximum Likelihood Classification
import pandas as pd
from sklearn.model_selection import train_test_split
df = pd.read_csv('heart.csv')
(x_train, x_test, y_train, y_test) = train_test_split(
df.iloc[:, 0:13].values, df.iloc[:, 13].values, train_size=0.8)
mlc = MLClassifier()
mlc.fit(x_train, y_train)
score = mlc.score(x_test, y_test)
print('Test score: '+score)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment