A curated collection of production-quality Jupyter Notebooks covering Exploratory Data Analysis, Classical ML, and Deep Learning with PyTorch and Scikit-Learn.
- About
- Notebook Catalog
- Datasets
- Model Architectures
- Results & Benchmarks
- Quick Start
- Project Structure
- Tech Stack
- Contributing
- License
This repository is a hands-on resource for anyone learning Machine Learning, Deep Learning, and Data Science. Each notebook is self-contained, heavily commented, and follows best practices for reproducible research. Whether you are a student exploring neural networks for the first time or a practitioner looking for clean reference implementations, these notebooks provide clear, end-to-end workflows from data loading to model evaluation.
| # | Notebook | Topic | Difficulty | Framework |
|---|---|---|---|---|
| 01 | 01_Exploratory_Data_Analysis.ipynb |
EDA, feature engineering, missing value imputation, distribution analysis | 🟢 Beginner | Pandas, Seaborn, Matplotlib |
| 02 | 02_Random_Forest_Classifier.ipynb |
Classification pipeline with cross-validation, hyperparameter tuning (GridSearchCV), feature importance | 🟡 Intermediate | Scikit-Learn |
| 03 | 03_PyTorch_CNN_MNIST.ipynb |
Convolutional Neural Network from scratch, training loop, GPU acceleration, confusion matrix | 🔴 Advanced | PyTorch |
Tip: Each notebook includes inline explanations, mathematical intuition, and visualization of intermediate results.
| Dataset | Source | Size | Task | Notebook |
|---|---|---|---|---|
| Titanic Survival | Kaggle | 891 rows, 12 features | Binary Classification / EDA | 01, 02 |
| MNIST Handwritten Digits | Yann LeCun | 70,000 images (28x28) | Multi-class Classification | 03 |
- Ensemble Method: Bagging with 200 decision trees
- Tuning: GridSearchCV over
max_depth,n_estimators,min_samples_split - Evaluation: 5-fold stratified cross-validation, ROC-AUC, precision-recall curves
Input (1x28x28)
→ Conv2d(1, 32, 3x3) → BatchNorm → ReLU → MaxPool(2x2)
→ Conv2d(32, 64, 3x3) → BatchNorm → ReLU → MaxPool(2x2)
→ Flatten
→ Linear(1600, 128) → ReLU → Dropout(0.5)
→ Linear(128, 10) → Softmax
- Optimizer: Adam (lr=0.001)
- Loss: CrossEntropyLoss
- Epochs: 15
- Batch Size: 64
| Model | Dataset | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|---|
| Random Forest (tuned) | Titanic | 84.2% | 82.1% | 79.5% | 80.8% |
| PyTorch CNN | MNIST Test Set | 99.1% | 99.0% | 99.1% | 99.0% |
Results are reproducible with the seeds set in each notebook. Your results may vary slightly depending on hardware.
- Python 3.10 or higher
- pip or conda package manager
- (Optional) NVIDIA GPU with CUDA for accelerated training
# Clone the repository
git clone https://github.com/razinahmed/machine-learning-notebooks.git
cd machine-learning-notebooks
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # macOS/Linux
# venv\Scripts\activate # Windows
# Install all dependencies
pip install -r requirements.txt
# Launch Jupyter Notebook
jupyter notebookDon't have a local GPU? Open any notebook directly in Google Colab:
| Notebook | Colab Link |
|---|---|
| 01 - EDA | |
| 02 - Random Forest | |
| 03 - PyTorch CNN |
conda create -n ml-notebooks python=3.10
conda activate ml-notebooks
pip install -r requirements.txt
jupyter notebookmachine-learning-notebooks/
├── 01_Exploratory_Data_Analysis.ipynb # EDA with Pandas & Seaborn
├── 02_Random_Forest_Classifier.ipynb # Scikit-Learn ML pipeline
├── 03_PyTorch_CNN_MNIST.ipynb # Deep Learning with PyTorch
├── data/ # Raw and processed datasets
│ ├── titanic_train.csv
│ └── titanic_test.csv
├── models/ # Saved model checkpoints
├── figures/ # Generated plots and charts
├── requirements.txt # Python dependencies
├── LICENSE
└── README.md
| Category | Technologies |
|---|---|
| Languages | Python 3.10+ |
| Data Analysis | Pandas, NumPy, Matplotlib, Seaborn |
| Machine Learning | Scikit-Learn, XGBoost |
| Deep Learning | PyTorch, torchvision |
| Environment | Jupyter Notebook, Google Colab |
| Utilities | tqdm, joblib, pickle |
Contributions are welcome! If you have a notebook that demonstrates a useful ML technique:
- Fork this repository
- Create a feature branch (
git checkout -b add-new-notebook) - Add your notebook following the naming convention
XX_Notebook_Name.ipynb - Ensure all cells run top-to-bottom without errors
- Submit a Pull Request with a description of the notebook and results
Please make sure your notebooks include:
- Clear markdown explanations between code cells
- Reproducible results with random seeds
- Properly labeled visualizations
This project is licensed under the MIT License — see the LICENSE file for details.
Built with passion for Data Science by Razin Ahmed
If these notebooks helped you learn, please consider giving the repo a ⭐