Skip to content

Instantly share code, notes, and snippets.

View Thanatoz-1's full-sized avatar

Tushar Dhyani Thanatoz-1

View GitHub Profile
@Thanatoz-1
Thanatoz-1 / Pipeline-guide.md
Created December 3, 2018 10:18 — forked from ecgill/Pipeline-guide.md
Quick tutorial on Sklearn's Pipeline constructor for machine learning

If You've Never Used Sklearn's Pipeline Constructor...You're Doing It Wrong

How To Use sklearn Pipelines, FeatureUnions, and GridSearchCV With Your Own Transformers

By Emily Gill and Amber Rivera

What's a Pipeline and Why Use One?

The Pipeline constructor from sklearn allows you to chain transformers and estimators together into a sequence that functions as one cohesive unit. For example, if your model involves feature selection, standardization, and then regression, those three steps, each as it's own class, could be encapsulated together via Pipeline.

Benefits: readability, reusability and easier experimentation.
@Thanatoz-1
Thanatoz-1 / create_test_db.py
Created December 28, 2018 22:13 — forked from sprin/create_test_db.py
A demo of creating a new database via SQL Alchemy. This module takes the form of a nosetest with three steps: - Set up the new database. - Create a table in the new database. - Teardown the new database.
"""
A demo of creating a new database via SQL Alchemy.
Under MIT License from sprin (https://gist.github.com/sprin/5846464/)
This module takes the form of a nosetest with three steps:
- Set up the new database.
- Create a table in the new database.
- Teardown the new database.
"""
@Thanatoz-1
Thanatoz-1 / Fast.ai install script
Last active January 19, 2019 02:32 — forked from gilrosenthal/Fast.ai install script
Fast.ai Install on Google Colab
!pip install -q "fastai==0.7.0" Pillow==4.1.1 torchtext==0.2.3
!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())
# !apt update -q
!apt install -y libsm6 libxext6
from os import path
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'