Preface
You finished the introductory course. You can wrangle data, make visualizations, run basic statistics, and build simple models. You got an A, or you shipped your first analysis at work, or you survived a bootcamp. Congratulations.
Now what?
The gap between "I can do a data analysis" and "I can build a machine learning system" is wider than most curricula admit. It is not just more algorithms. It is a different way of thinking about problems, a different relationship with your data, and an entirely new set of skills that introductory courses never mention: feature engineering that requires domain expertise, model evaluation that goes beyond accuracy, deployment that survives contact with the real world, and monitoring that catches failures before your users do.
This book exists to bridge that gap.
Why This Book
Most intermediate data science resources fall into one of two traps. The first is the algorithm encyclopedia: exhaustive coverage of every classifier and regressor, with clean datasets and no mention of how any of it works in production. The second is the industry cookbook: "just use XGBoost" recipes with no understanding of why, when, or what happens when it fails.
This book is neither. It is built on a simple premise: the hard part of data science is not the algorithms. The hard part is everything around the algorithms — framing the right problem, engineering the right features, evaluating honestly, deploying reliably, and communicating effectively. The algorithms are important, and we cover them thoroughly. But they are tools, not the craft.
How This Book Is Different
Practitioner tone. You are past the encouragement phase. This book talks to you like a senior data scientist mentoring a promising junior: direct, opinionated, grounded in real-world experience. When there is a common mistake, we name it. When there is a better way, we show it. When the textbook answer diverges from the production answer, we tell you both.
One progressive project. From Chapter 1 to Chapter 35, you build a complete customer churn prediction system for StreamFlow, a subscription streaming analytics platform. By the end, you have a deployed REST API with SHAP explanations, fairness auditing, monitoring, and an ROI analysis. This is not a toy example. It is a portfolio project that demonstrates the full data science lifecycle.
Four anchor examples. Beyond the progressive project, four recurring scenarios ground every concept in reality: a hospital predicting patient readmission with fairness constraints, an e-commerce company running A/B tests under business pressure, and a manufacturer predicting equipment failure from sensor data. You will see these examples evolve as your skills grow.
Production-grade code. Every code example uses scikit-learn pipelines, proper train/test discipline, cross-validation, and random seeds. No model.fit(X, y) on the full dataset. No accuracy scores on training data. No code that would get you pulled into a code review.
SQL as a first-class citizen. Data scientists who cannot write SQL are data scientists who cannot get data. Chapter 5 covers window functions, CTEs, and query optimization — the SQL that the job actually requires.
Math with purpose. Medium math intensity: every formula gets three presentations — the intuition, the notation, and the numpy code. You will understand gradient descent, loss functions, and regularization. You will not prove theorems.
Who Should Read This Book
- Aspiring data scientists who completed an introductory course and want to become job-ready
- Junior data analysts ready to level up from dashboards and SQL to machine learning
- Graduate students in quantitative fields who need practical ML skills
- Career changers with basic Python and pandas skills who want to break into data science
You should be comfortable with Python (functions, loops, list comprehensions, basic OOP), pandas (DataFrames, groupby, merge), basic visualization (matplotlib, seaborn), descriptive statistics, and basic SQL. If you completed the DataField.Dev Introduction to Data Science textbook or an equivalent course, you are ready.
What You Will Build
By the final chapter, you will have:
- Extracted customer features from a relational database using advanced SQL
- Engineered 25+ predictive features from raw subscription data
- Built and compared 5+ classification models with proper cross-validation
- Addressed class imbalance with SMOTE and threshold tuning
- Generated SHAP explanations for individual predictions
- Deployed a REST API with FastAPI and Docker
- Built a monitoring system with drift detection
- Audited the model for fairness across demographics
- Calculated the ROI and presented to a simulated stakeholder
This is the project that hiring managers look for.
Acknowledgments
This textbook is open source, licensed under CC-BY-SA-4.0. It was built on the shoulders of the open-source data science community: scikit-learn, pandas, XGBoost, SHAP, MLflow, FastAPI, and the countless contributors who make production-grade data science accessible to everyone.
Special thanks to the instructors, students, and practitioners who reviewed early drafts and pushed for more war stories, more production wisdom, and fewer toy examples.
This is Book 2 in the DataField.Dev Data Science Series. It assumes completion of Book 1 (Introduction to Data Science) or equivalent preparation.