Day 6 Introduction To Machine Learning
Day 6 Introduction To Machine Learning
Definition:
Types of ML:
ML Pipeline Stages:
Example ML Pipeline:
1. Data Collection:
- Gather customer demographic data from a database.
- Collect transaction history from online sales.
2. Data Preprocessing:
- Handle missing values.
- Normalize numerical features.
- Encode categorical variables.
3. Model Building:
- Choose a classification algorithm like Logistic Regression.
- Train the model on the preprocessed data.
4. Model Evaluation:
- Evaluate the model's accuracy, precision, recall, and F1 score.
- Validate the model's performance using cross-validation.
Introduction to Scikit-Learn
Scikit-Learn:
Installing Scikit-Learn:
bash
Copy code
pip install scikit-learn
Example Usage:
python
Copy code
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
What is Machine Learning? Types of ML: Machine Learning (ML) is a subset of artificial
intelligence (AI) that focuses on the development of algorithms and statistical models to
enable computers to perform tasks without explicit instructions. There are three main types of
ML:
1. Data Collection: Gathering relevant data from various sources, ensuring data quality,
and understanding the problem domain.
2. Data Preprocessing: Cleaning the data by handling missing values, encoding
categorical variables, scaling features, and splitting the data into training and testing
sets.
3. Model Building: Selecting an appropriate machine learning algorithm based on the
problem type and dataset, training the model on the training data, and tuning
hyperparameters to optimize performance.
4. Evaluation: Assessing the model's performance on unseen data using evaluation
metrics such as accuracy, precision, recall, F1-score, etc. It involves comparing the
model's predictions with the actual labels to measure its effectiveness.