Skip to content

Instantly share code, notes, and snippets.

@tonglu
Last active January 12, 2017 23:19
Show Gist options
  • Save tonglu/e1991163b2f0ff74a839a6b80dc28a07 to your computer and use it in GitHub Desktop.
Save tonglu/e1991163b2f0ff74a839a6b80dc28a07 to your computer and use it in GitHub Desktop.
from sklearn.datasets import make_classification
from sklearn.linear_model import RandomizedLogisticRegression
import pandas as pd
clf = RandomizedLogisticRegression(sample_fraction = .75, n_resampling = 3, normalize = False)
X, y = make_classification(n_samples=10,
n_features=3,
n_informative=2,
n_redundant=0,
n_repeated=0,
n_classes=2,
random_state=123,
shuffle=False)
clf.fit(X,y)
data = pd.read_csv("~/dev/tmp/demo_model_data.csv")
y = data['dep_var']
X = data.ix[:, 2:]
clf.fit(X,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment