Skip to content

Instantly share code, notes, and snippets.

@gchavez2
Created February 21, 2019 01:03
Show Gist options
  • Save gchavez2/366fb3323de925819b3388765146794a to your computer and use it in GitHub Desktop.
Save gchavez2/366fb3323de925819b3388765146794a to your computer and use it in GitHub Desktop.
import numpy as np
from sklearn import linear_model
# Load data
data = np.loadtxt('./heights_weights.csv', delimiter=',', skiprows=1)
X = data[:,0:2]
y = data[:,2]
# Fit (train) the Logistic Regression classifier
clf = linear_model.LogisticRegression(C=1e40, solver='newton-cg')
fitted_model = clf.fit(X, y)
# Predict
prediction_result = clf.predict([(70,180)])
@Navien2
Copy link

Navien2 commented Dec 21, 2019

Hi,
i tried to test the above code , but could not find the csv file ??

@OraculoML
Copy link

OraculoML commented Dec 21, 2019 via email

@Navien2
Copy link

Navien2 commented Dec 21, 2019

heights_weights.csv ?? where is the file ?

@OraculoML
Copy link

OraculoML commented Dec 21, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment