Patsy: The Lingua Franca to and from R
summary
Shows how Patsy + scikit-learn reproduces R formula convenience by building design matrices, handling categorical variables and fitting three flavors of logistic regression on 1000 simulated migrants to predict Canada versus US. Walks R -> Python -> Patsy code, computes train/test splits, cross‑val and AUC scores, draws a separation plot, and produces example predictions (one case shows 99.8% probability of migrating to Canada). Demonstrates integration with pints pie mc3 for Bayesian extensions and a runnable notebook that actually works.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:58Excel/R to Python workflow
- 7:12Canadian migration dataset
- 9:01Logistic regression in R
- 11:53Moving regression to Python
- 14:42Patsy as R-Python bridge
- 16:49Visualizing model results
- 18:35Predicting with Patsy
- 21:03Patsy in advanced stats
- 23:07Summary
- 24:57Q&A
related talks
20mTranslating from {tidymodels} and scikit-learn: Lessons from a 'bilingual' course
45mPython useRs
01h 10mLies damned lies and statistics in Python
59mEmbracing multi-lingual data science
22mUsing Python & R in Harmony
31mUsing Simpson’s Paradox to Discover Interesting Patterns in...
22mVisualizing uncertainty with hypothetical outcomes plots
39mThe Duct Tape of Heroes: Bayes Rule
