By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
A Data‑Science portfolio is the curated collection of public work that shows you can take a raw problem (e.g., “predict which telecom customers will churn”) through the full data‑science pipeline—data wrangling, modeling, evaluation, and communication. Recruiters and hiring managers look at Kaggle notebooks, GitHub repos, and blog posts to gauge your technical chops, coding style, and ability to tell a story with data.
pytest
FROM python:3.11
RUN pip install -r requirements.txt
k‑fold CV
[ \text{CV_score} = \frac{1}{k}\sum_{i=1}^{k} \text{metric}_i ]
model
[ I_j = \frac{1}{T}\sum_{t=1}^{T} \frac{\Delta \text{impurity}{t,j}}{\text{samples} ] }
yfinance
Example: Predict churn from a telecom CSV (customer_id, tenure, monthly_charges, churn).
customer_id, tenure, monthly_charges, churn
Set Up a Reproducible Repo bash mkdir churn-prediction && cd churn-prediction git init echo "# Churn Prediction" > README.md touch requirements.txt # list pandas, scikit-learn, matplotlib, mlflow
bash mkdir churn-prediction && cd churn-prediction git init echo "# Churn Prediction" > README.md touch requirements.txt # list pandas, scikit-learn, matplotlib, mlflow
Exploratory Data Analysis (EDA) Notebook
pandas.read_csv
seaborn
Commit the notebook (git add eda.ipynb && git commit -m "EDA").
git add eda.ipynb && git commit -m "EDA"
Modeling Pipeline (train/validation) ```python from sklearn.model_selection import train_test_split, cross_val_score from sklearn.preprocessing import OneHotEncoder, StandardScaler from sklearn.compose import ColumnTransformer from sklearn.pipeline import Pipeline from sklearn.ensemble import GradientBoostingClassifier
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, stratify=y, random_state=42)
preproc = ColumnTransformer([ ('num', StandardScaler(), numeric_cols), ('cat', OneHotEncoder(handle_unknown='ignore'), categorical_cols) ])
model = Pipeline([ ('prep', preproc), ('clf', GradientBoostingClassifier(random_state=42)) ])
cv_scores = cross_val_score(model, X_train, y_train, cv=5, scoring='f1') ```
sklearn.metrics.roc_curve
python import mlflow mlflow.log_metric('f1_cv', cv_scores.mean()) mlflow.sklearn.log_model(model, 'model')
python -m venv venv && pip install -r requirements.txt
src/eda.py
src/model.py
.gitignore
data/
*.png
__pycache__
LICENSE
requirements.txt
Scenario: Your validation F1‑score is 0.55 but training F1‑score is 0.95. Answer: The model is over‑fitting; apply stronger regularization (e.g., increase learning_rate decay, add max_depth=3, or use L2 penalty).
learning_rate
max_depth=3
L2
Scenario: You publish a Kaggle notebook but the leaderboard score is lower than the public baseline. Answer: Check data leakage (e.g., using the test set in feature engineering) and ensure proper cross‑validation; fix leakage and re‑train.
Scenario: A hiring manager asks why you kept the notebook “clean” and moved code to .py files. Answer: Modular code is testable, reusable, and easier for collaborators to read; it also demonstrates software‑engineering best practices.
.py
StandardScaler
MinMaxScaler
mlflow.log_param()
mlflow.log_metric()
mlflow.log_artifact()
k=5
docker build -t churn-app .
docker run -p 5000:5000 churn-app
mkdocs
Jekyll
docs/
GitHub Actions
flake8
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.