Skip to content

Instantly share code, notes, and snippets.

View treycausey's full-sized avatar

Trey Causey treycausey

View GitHub Profile
@astrojuanlu
astrojuanlu / pep8magic.py
Last active April 27, 2017 11:00
IPython cell magic to check for PEP8 using https://pypi.python.org/pypi/pep8
# IPython magic to check for PEP8 compliance.
# Author: Juan Luis Cano <juanlu001@gmail.com>
"""IPython magic to check for PEP8 compliance.
To use it, type
```%load_ext pep8magic```
and then
@pprett
pprett / grid_search.py
Created October 31, 2012 19:42
Parallel grid search for sklearn Gradient Boosting
"""Parallel grid search for sklearn's GradientBoosting.
This script uses IPython.parallel to run cross-validated
grid search on an IPython cluster. Each cell on the parameter grid
will be evaluated ``K`` times - results are stored in MongoDB.
The procedure tunes the number of trees ``n_estimators`` by averaging
the staged scores of the GBRT model averaged over all K folds.
You need an IPython ipcluster to connect to - for local use simply