npm install -g markdown-toc
Insert the following snippet into your markdown file:
<!-- toc -->
This is where the table will be!
# machine learning | |
scikit-learn | |
statsmodels | |
xgboost | |
lightgbm | |
catboost | |
# natural language processing | |
gensim |
from sklearn.metrics import roc_auc_score | |
def auc(X, y, classifier): | |
y_score = classifier.predict_proba(X)[:, 1] | |
return roc_auc_score(y, y_score) |
def pop_diff(popA, popB, bin_boundaries=None, num_bins=10): | |
""" | |
Compute difference between two populations using the PSI / IV formula | |
$$\Sigma_{i} (p_i^B - p_i^a)*\ln(\frac{p_i^B}{p_i^A})$$ | |
Note: | |
Counts missing values in a separate bin to test for information and shift. | |
Raises ValueError if popA has no nans but popB does. | |