ML Concepts
✕Machine Learning
- Branch of AI where computer learns from data without explicit rules.
- Instead of rules, we provide examples and let model find patterns.
- Rule based: If age < 18 give discount.
- ML based: Here are 1000 examples of customers with age and discount given. Predict discount for new customers on providing age.
- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning
Example
Types of ML
Supervised Learning
- Model learns from labeled data to predict outcomes.
- We provide features(X) and output(y) to the model.
- Model finds patterns to predict y from X.
- Predicting house prices using features like
size,location,number of rooms. - Classifying emails as spam or not spam using
email content,metadata. - K-Nearest Neighbors (KNN)
- Support Vector Machines (SVM)
- Linear Regression
- Logistic Regression
- Decision Trees
Example
Common Algorithms
Regression Concept
- Predicting a continuous output variable based on input features.
- Output is a real number, e.g.,
price,temperature, etc.
Regression Example:
| Academic Qualification | Experience Years | Company | Position | Salary |
|---|---|---|---|---|
| Bachelors | 5 | Developer | 100000 | |
| Masters | 8 | Microsoft | Data Engineer | 150000 |
| Masters | 2 | Developer | 80000 | |
| Bachelors | 1 | Developer | ????? |
Regression task: Predicting Salary based on features
Classification Concept
- Predicting a categorical output variable based on input features.
- Output is a class label, e.g.,
spam/not spam,disease/no disease.
Classification Example:
| Age | Blood Pressure | Cholesterol Level | Diabetes |
|---|---|---|---|
| 25 | 120 | 200 | No |
| 45 | 140 | 250 | Yes |
| 30 | 130 | 220 | No |
| 50 | 150 | 300 | ????? |
Classification task: Predicting Diabetes based on health metrics
Unsupervised Learning
- Model learns from unlabeled data to find hidden patterns.
- We provide only features(X) to the model.
- Model finds structure, clusters, or associations in data.
- Example: Grouping customers into segments based on purchasing behavior without predefined labels.
- K-means Clustering
- Principal Component Analysis (PCA)
- Hierarchical Clustering
- Association Rule Learning
Common Algorithms
Reinforcement Learning
- Model learns to make decisions by interacting with an environment.
- Model receives feedback in the form of rewards or penalties.
- Goal is to learn a policy that maximizes cumulative reward.
- Training a robot to navigate a maze by rewarding for reaching exit & penalizing for collisions.
- Teaching an AI agent to play a game by rewarding for winning & penalizing for losing.
Examples
ML Terms to Know
- Feature:
Inputindependentvariable in ML model used for predicting output. - Label:
Outputresponsevariable in ML model that we want to predict. - Model: Mathematical representation of the relationship between features and label.
- Training: Process of generating a mathematical model from data.
- Evaluation: Process of assessing the performance of a trained model.
- Prediction: Output from trained model when given new input data.
- Under Fitting (Bias): Model too simple to capture underlying patterns in data, leading to poor performance on both training and test data.
- Over Fitting (Variance): Model too complex and captures noise in training data, leading to poor generalization on unseen data.
- Bias-Variance Tradeoff: Balance between underfitting and overfitting to achieve optimal model performance on unseen data.

Steps for Solving ML Problems
- Define the problem. Determine type of machine learning task.
- Collect data and preprocess it for
duplicates,missing,outlieretc. - Implement feature Scaling and Encoding.
- Split data into training and testing sets.
- Choose appropriate model and train it on training data.
- Evaluate the model's performance.
- Deploy the model and monitor its performance.
