Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions QUICK_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ML Debugging Notebooks - Quick Reference Guide

> **New!** Looking to start a new ML project? Check out the [templates/](templates/) directory for ready-to-use project templates covering various ML tasks.

## 🎯 Quick Problem Finder

**My model has high training accuracy but low test accuracy** β†’ [Notebook 1: Overfitting/Underfitting](notebooks/1_overfitting_underfitting.ipynb)
Expand Down Expand Up @@ -144,6 +146,22 @@ If you encounter issues:
3. Open an issue on GitHub
4. Search Stack Overflow with specific error messages

## 🎨 ML Project Templates

Ready to start a new ML project? The `templates/` directory contains ready-to-use Jupyter notebook templates:

- **Machine Learning Preset** - General classification tasks
- **Neural Network Model** - Deep learning with TensorFlow/Keras
- **Language Model** - Text generation and NLP
- **Sentiment Analysis** - Text classification
- **Clustering Models** - Unsupervised learning
- **Reinforcement Learning** - Q-Learning and DQN
- **Anomaly Detection** - Outlier identification
- **Time Series Analysis** - Forecasting with ARIMA and LSTM
- **Computer Vision** - Image classification with CNNs

See [templates/README.md](templates/README.md) for detailed information about each template.

---

**Remember:** Debugging is a skill that improves with practice. Don't get discouraged! πŸš€
73 changes: 72 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,75 @@ Master feature scaling for better model performance:
- Common scaling mistakes
- **Key Techniques:** StandardScaler, MinMaxScaler, RobustScaler, proper pipeline usage

## 🎨 ML Project Templates

The `templates/` directory contains starter templates for various machine learning projects. These templates provide ready-to-use Jupyter notebooks with complete workflows for different ML tasks:

### [1. Machine Learning Preset](templates/machine_learning_preset.ipynb)
General-purpose ML template for classification tasks:
- Data loading and exploration
- Preprocessing and feature engineering
- Model training and comparison
- Hyperparameter tuning
- Model evaluation and saving

### [2. Neural Network Model](templates/neural_network_model.ipynb)
Deep learning template using TensorFlow/Keras:
- Neural network architecture design
- Training with callbacks (early stopping, learning rate reduction)
- Batch normalization and dropout
- Performance visualization

### [3. Language Model](templates/language_model.ipynb)
NLP template for language modeling:
- Text preprocessing and tokenization
- LSTM-based language model
- Text generation
- Word embeddings

### [4. Sentiment Analysis Model](templates/sentiment_analysis_model.ipynb)
Template for sentiment classification:
- Text cleaning and preprocessing
- TF-IDF feature extraction
- Traditional ML and deep learning approaches
- Model comparison and evaluation

### [5. Clustering Models](templates/clustering_models.ipynb)
Unsupervised learning template:
- Multiple clustering algorithms (K-Means, DBSCAN, Hierarchical)
- Optimal cluster determination (elbow method, silhouette score)
- Cluster visualization
- PCA for dimensionality reduction

### [6. Reinforcement Learning](templates/reinforcement_learning.ipynb)
RL template with Q-Learning and DQN:
- Environment setup
- Q-Learning implementation
- Deep Q-Network (DQN)
- Training and evaluation

### [7. Anomaly Detection](templates/anomaly_detection.ipynb)
Template for outlier detection:
- Multiple anomaly detection algorithms
- Isolation Forest, One-Class SVM, LOF
- Anomaly score visualization
- Model comparison

### [8. Time Series Analysis](templates/time_series_analysis.ipynb)
Time series forecasting template:
- Time series decomposition (trend, seasonality, residuals)
- Stationarity testing
- ARIMA modeling
- LSTM for time series
- Forecast visualization

### [9. Computer Vision Models](templates/computer_vision_models.ipynb)
Image classification template:
- CNN architecture from scratch
- Data augmentation
- Transfer learning with pre-trained models
- Model evaluation and visualization

## πŸš€ Getting Started

### Prerequisites
Expand All @@ -73,7 +142,9 @@ pip install -r requirements.txt
jupyter notebook
```

4. Open any notebook from the `notebooks/` directory and start learning!
4. Explore the notebooks:
- **Debugging Notebooks**: Open any notebook from the `notebooks/` directory to learn about debugging ML problems
- **Project Templates**: Browse the `templates/` directory for ready-to-use project starter templates

## πŸ“‹ Requirements

Expand Down
179 changes: 179 additions & 0 deletions templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# ML Project Templates

This directory contains ready-to-use Jupyter notebook templates for various machine learning projects. Each template provides a complete workflow from data loading to model evaluation, designed to help you quickly start your ML projects.

## πŸ“‹ Available Templates

### 1. Machine Learning Preset (`machine_learning_preset.ipynb`)
**Use Case:** General classification tasks, scikit-learn projects

**What's Included:**
- Data loading and exploration
- Train-test splitting
- Feature scaling
- Multiple model comparison (Logistic Regression, Decision Tree, Random Forest, Gradient Boosting, SVM)
- Hyperparameter tuning with GridSearchCV
- Model evaluation and visualization

**Best For:** Tabular data, classification problems, beginners learning ML

---

### 2. Neural Network Model (`neural_network_model.ipynb`)
**Use Case:** Deep learning classification tasks

**What's Included:**
- Feedforward neural network with TensorFlow/Keras
- Batch normalization and dropout
- Training with callbacks (early stopping, learning rate reduction)
- Training history visualization
- Model saving and loading

**Best For:** Complex classification problems, deep learning enthusiasts

---

### 3. Language Model (`language_model.ipynb`)
**Use Case:** Text generation, language modeling

**What's Included:**
- Text tokenization and preprocessing
- LSTM-based language model
- Word embeddings
- Text generation function
- Training and evaluation

**Best For:** NLP projects, text generation tasks

---

### 4. Sentiment Analysis Model (`sentiment_analysis_model.ipynb`)
**Use Case:** Text classification, sentiment analysis

**What's Included:**
- Text preprocessing and cleaning
- TF-IDF feature extraction
- Traditional ML models (Logistic Regression, Naive Bayes, SVM)
- LSTM-based deep learning approach
- Model comparison and evaluation

**Best For:** Product reviews, social media sentiment, customer feedback analysis

---

### 5. Clustering Models (`clustering_models.ipynb`)
**Use Case:** Unsupervised learning, customer segmentation

**What's Included:**
- Multiple clustering algorithms (K-Means, DBSCAN, Hierarchical, Gaussian Mixture)
- Elbow method for optimal K
- Silhouette score analysis
- Cluster visualization
- PCA for dimensionality reduction

**Best For:** Customer segmentation, pattern discovery, exploratory data analysis

---

### 6. Reinforcement Learning (`reinforcement_learning.ipynb`)
**Use Case:** Sequential decision making, game AI

**What's Included:**
- Simple grid world environment
- Q-Learning implementation
- Deep Q-Network (DQN)
- Training and evaluation
- Performance visualization

**Best For:** Game AI, robotics, optimization problems

---

### 7. Anomaly Detection (`anomaly_detection.ipynb`)
**Use Case:** Fraud detection, outlier identification

**What's Included:**
- Multiple anomaly detection algorithms (Isolation Forest, One-Class SVM, LOF, Elliptic Envelope)
- Anomaly score visualization
- Model comparison
- Confusion matrix analysis

**Best For:** Fraud detection, network intrusion detection, quality control

---

### 8. Time Series Analysis (`time_series_analysis.ipynb`)
**Use Case:** Forecasting, trend analysis

**What's Included:**
- Time series decomposition
- Stationarity testing
- ARIMA modeling
- LSTM for time series
- Forecast visualization and evaluation

**Best For:** Stock price prediction, demand forecasting, weather prediction

---

### 9. Computer Vision Models (`computer_vision_models.ipynb`)
**Use Case:** Image classification, object recognition

**What's Included:**
- CNN architecture from scratch
- Data augmentation
- Transfer learning setup (VGG16, ResNet50, MobileNetV2)
- Model training and evaluation
- Prediction visualization

**Best For:** Image classification, object detection, visual recognition tasks

---

## πŸš€ Quick Start

1. **Choose a template** that matches your project needs
2. **Copy the template** to your working directory
3. **Customize** the data loading section for your dataset
4. **Run the cells** to build and train your model
5. **Adapt** the architecture and parameters to your specific requirements

## πŸ’‘ Tips for Using Templates

- **Start Simple**: Begin with the basic template structure before adding complexity
- **Customize**: Modify hyperparameters, architectures, and preprocessing steps for your data
- **Experiment**: Try different models and configurations to find what works best
- **Save Your Work**: Use the model saving sections to preserve your trained models
- **Iterate**: Use these templates as starting points and improve based on your results

## πŸ“š Integration with Debugging Notebooks

These templates work great in conjunction with the debugging notebooks in the `notebooks/` directory:

- Build your model using a **template**
- Debug issues using the **debugging notebooks**
- Apply fixes back to your **template-based project**

## 🀝 Contributing

Have a new template idea? Found improvements? Contributions are welcome!

1. Create a new template following the existing structure
2. Document the use case and included features
3. Submit a pull request

## πŸ“ Template Structure

Each template follows a consistent structure:

1. **Import Libraries** - All necessary packages
2. **Load Data** - Example data loading with placeholders for your data
3. **Preprocessing** - Data cleaning and preparation
4. **Model Building** - Architecture definition
5. **Training** - Model training with best practices
6. **Evaluation** - Performance metrics and visualization
7. **Saving** - Model persistence (optional)

---

**Ready to start your ML project? Choose a template and begin building!** πŸš€
Loading