I hereby claim:
- I am alejio on github.
- I am alex_sp (https://keybase.io/alex_sp) on keybase.
- I have a public key ASBvurBYR5vP4COZTzP5Ef6536AguENaIq-TwcHUBBS2Ugo
To claim this, I am signing this object:
def lift_report(filename, septr='|', jitter_on=False): | |
## Import necessary packages | |
import sys | |
import pandas as pd | |
import numpy as np | |
import pandas.core.algorithms as algos | |
from pandas import Series | |
from sklearn.metrics import roc_auc_score |
import pandas as pd | |
import numpy as np | |
def split_train_test(df_in, test_ratio): | |
# Reserve an out-of-place sample for final evaluation | |
# Could have used train_test_split from sklearn | |
df = df_in.copy(deep=True) | |
np.random.seed(42) | |
shuffled_indices = np.random.permutation(len(df)) | |
test_set_size = int(len(df) * test_ratio) |
from sklearn.metrics import confusion_matrix | |
from matplotlib import pyplot as plt | |
# Plot confusion matrix | |
def plot_confusion_matrix(cm, classes, | |
normalize=False, | |
title='Confusion matrix', | |
cmap=plt.cm.Blues): | |
""" | |
This function prints and plots the confusion matrix. |
name: dsg | |
channels: | |
- conda-forge | |
- defaults | |
dependencies: | |
- bleach=3.0.2=py_0 | |
- click=7.0=py_0 | |
- entrypoints=0.2.3=py37_1002 | |
- gmp=6.1.2=hfc679d8_0 | |
- ipywidgets=7.4.2=py_0 |
def dump_keys(d, lvl=0): | |
for k, v in d.items(): | |
print('%s%s' % (lvl * ' ', k)) | |
if type(v) == dict: | |
dump_keys(v, lvl+1) |
I hereby claim:
To claim this, I am signing this object:
git clone https://github.com/hakimel/reveal.js.git | |
jupyter-nbconvert --to slides Myslides.ipynb --reveal-prefix=reveal.js | |
Make sure widgets work | |
conda install -c conda-forge ipywidgets | |
jupyter nbextension install --py widgetsnbextension --sys-prefix | |
jupyter nbextension enable widgetsnbextension --py --sys-prefix | |
from ipywidgets import * | |
IntSlider() | |
https://github.com/jupyter-widgets/ipywidgets/issues/1411 |
# added by Anaconda3 4.4.0 installer | |
export PATH="/Users/alexi/anaconda/bin:$PATH" | |
# Make python run in anaconda | |
# alias anacondainit='export PATH="/Library/Python/anaconda/bin:$PATH"; export PATH="/Applications/anaconda/bin:$PATH"' | |
# MISC SHORTCUTS I LIKE |
# Show channel URLs when displaying what is going to be downloaded | |
# and in 'conda list'. The default is False. | |
show_channel_urls: True | |
ssl_verify: true | |
create_default_packages: | |
- pip | |
- ipython | |
- scipy |
from IPython.display import display_html | |
def display_side_by_side(*args): | |
html_str='' | |
for df in args: | |
html_str+=df.to_html() | |
display_html(html_str.replace('table','table style="display:inline"'),raw=True) | |
#https://stackoverflow.com/questions/38783027/jupyter-notebook-display-two-pandas-tables-side-by-side |