Skip to content

Instantly share code, notes, and snippets.

View susanli2016's full-sized avatar
💃
<script>Nice meet you here</script>

Susan Li susanli2016

💃
<script>Nice meet you here</script>
View GitHub Profile
@susanli2016
susanli2016 / Bay_Area_Bike Share_Analysis.ipynb
Created December 3, 2016 00:13
Bay Area Bike Share Analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / Toronto-Weather.ipynb
Created December 9, 2016 07:03
Toronto Weather
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / Vancouver_Auto_Crime.ipynb
Created December 9, 2016 07:40
Auto Crime in Vancouver
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / Baby_names_alberta.ipynb
Created December 14, 2016 07:43
Baby Names in Alberta
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / Referee_data.ipynb
Created December 24, 2016 18:38
Referee Data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / Immigration_to_us.ipynb
Created December 29, 2016 09:06
33 Years of U.S. Immigration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / Edmonton_crime.ipynb
Created December 29, 2016 09:51
Edmonton Crime Data Analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@susanli2016
susanli2016 / OpenStreetMap.ipynb
Created February 9, 2017 10:19
Wrangle OpenStreetMap Data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from sklearn.linear_model import SGDClassifier
sgd = Pipeline([('vect', CountVectorizer()),
('tfidf', TfidfTransformer()),
('clf', SGDClassifier(loss='hinge', penalty='l2',alpha=1e-3, random_state=42, max_iter=5, tol=None)),
])
sgd.fit(X_train, y_train)
%%time
from sklearn.linear_model import LogisticRegression
logreg = Pipeline([('vect', CountVectorizer()),
('tfidf', TfidfTransformer()),
('clf', LogisticRegression(n_jobs=1, C=1e5)),
])
logreg.fit(X_train, y_train)
%%time