2. Agenda
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
• Batch vs Online ML
• ML Lifecycle
• Model Deployment with FastAPI
• Tensors
• Framing ML Problems
• Data Collection Techniques
• Exploratory Data Analysis
• Customer Churn Prediction Use Case
• Principal Component Analysis (PCA)
• Summary
3. Supervised Learning
• Labeled data used for training
• Common algorithms: Linear Regression, Decision Trees, SVM
• Example: Email spam detection, House price prediction
4. Unsupervised Learning
• No labeled data
• Find hidden patterns or intrinsic structures
• Applications: Customer segmentation, Anomaly detection
5. Reinforcement Learning
• Agent learns via trial and error in an environment
• Feedback via rewards or penalties
• Used in robotics, gaming (e.g., AlphaGo), recommendation systems
6. Batch vs Online ML
• Batch: Trains on entire dataset at once
• Online: Trains incrementally on data streams
• Batch preferred for stable data; Online for dynamic environments
7. ML Lifecycle
• Problem Definition
• Data Collection
• Data Preprocessing
• Model Building
• Evaluation
• Deployment
• Monitoring & Maintenance
8. Model Deployment with FastAPI
• FastAPI: Fast, modern web framework for APIs
• Useful for serving ML models via REST endpoints
• Enables real-time predictions and integration with applications
9. Tensors – Basics
• Core data structure in ML (used in PyTorch, TensorFlow)
• Generalization of scalars, vectors, matrices
• Efficient for multidimensional data computations
10. Framing ML Problems
• Convert real-world tasks into predictive problems
• Define inputs, outputs, and evaluation metrics
• Example: Predict customer churn from behavior data
11. Data Collection Techniques
• APIs (e.g., Twitter API, financial data APIs)
• Web Scraping (BeautifulSoup, Scrapy)
• Ensure compliance with terms of service
12. Exploratory Data Analysis
• Univariate: Analyze one variable (e.g., histograms)
• Multivariate: Analyze relationships between variables (e.g., heatmaps, pair
plots)
• Helps understand patterns, detect outliers, inform preprocessing
13. Customer Churn Prediction Use
Case
• Goal: Predict if a customer will stop using a service
• Steps: Data collection, preprocessing, modeling, deployment
• Algorithms: Logistic Regression, Random Forest
• Impact: Improve retention by identifying at-risk customers
14. Principal Component Analysis
(PCA)
• Dimensionality reduction technique
• Transforms data to new coordinates (principal components)
• Helps visualize and speed up ML models by removing redundancy
15. Summary
• ML types: Supervised, Unsupervised, Reinforcement
• Lifecycle spans from data to deployment
• Real-world applications like churn prediction are impactful
• Tensors, FastAPI, EDA, PCA are foundational tools