0% found this document useful (0 votes)
1 views53 pages

LECTURE-5a - Machine Learning

This document is a lecture on Machine Learning covering various topics including types of learning (supervised, unsupervised, reinforcement), ensemble models, steps in machine learning, model selection, and practical examples. It explains the importance of machine learning in adapting to new situations and provides a case study on predicting house prices using regression techniques. Additionally, it discusses evaluation metrics and Python libraries relevant to machine learning.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views53 pages

LECTURE-5a - Machine Learning

This document is a lecture on Machine Learning covering various topics including types of learning (supervised, unsupervised, reinforcement), ensemble models, steps in machine learning, model selection, and practical examples. It explains the importance of machine learning in adapting to new situations and provides a case study on predicting house prices using regression techniques. Additionally, it discusses evaluation metrics and Python libraries relevant to machine learning.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lecture Seven

Machine Learning
The CSC415 Team
Lecture Outline
 Introduction
 Types of Learning
 Ensemble Models
 Steps in Machine Learning
 Model Selection
 Underfitting Vs Overfitting
 Classification Vs Regression
 Practical Examples
Reference Textbooks for this Topic
Introduction
 An Agent is learning if it improves its performance after making
observations about the world.
 Learning: trivial, such as jotting down a note, to the profound, as when Albert Einstein
inferred a new theory of the universe.
 When the agent is a computer, we call it Machine Learning:
 Computer observes some data, builds a model based on the data,
 Uses the model as both a Hypothesis about the world and a piece of software that can
solve problems.
4
Why would we want a Machine to Learn?

 Can’t we just program it? there are no idea how to program a solution
two main reasons. themselves.
 Facial Recognition: human do it
 First, the designers cannot anticipate all
subconsciously,
possible future situations.
 Best programmers don’t know how to
 E.g: Predicting stock market prices program a computer to accomplish
must learn to adapt when conditions that task
change from boom to bust.
 Second, sometimes the designers have

5
Machine Learning
Machine learning is a branch of artificial
intelligence (AI) that enables agents/systems to
automatically learn and improve from
experience without being explicitly
programmed.
 It focuses on the development of algorithms
that allow computers to learn from and make
predictions or decisions based on data.
 It is applied across various domains such as
health, finance, retail, technology, etc.
Types of Learning

 There are three types of feedback that can accompany the inputs, and that
determine the three main types of learning
 Supervised Learning
 Unsupervised Learning
 Reinforcement Learning

7
Types of Learning
Supervised Learning

 Supervised learning trains models on labeled data to predict or classify


outputs based on input-output mappings.
 The model learns patterns from labeled examples to predict appropriate
labels for new, unseen data.
 An example is email spam detection, where the model classifies emails as "spam" or
"not spam" by recognizing patterns in labeled training data.

8
Types of Learning
Unsupervised Learning
 Unsupervised learning is a type of machine learning where the algorithm is
trained on unlabeled data to identify patterns, relationships, or structures.
 The most common unsupervised learning task is clustering: detecting
potentially useful clusters of input examples.
 An example is in Customer Segmentation. Unsupervised learning, such as K-Means
clustering, groups e-commerce customers based on patterns like purchase frequency,
spending, and preferences.
 For example, it identifies high spenders on electronics, moderate spenders on fashion, and
occasional grocery buyers.

9
Types of Learning
Reinforcement Learning
 Reinforcement learning is a machine learning approach where an agent learns to
make decisions by interacting with an environment and using rewards or
punishments as feedback to improve its behaviour.
 The agent uses a policy to optimize decision-making over time by acting on its
current state, receiving rewards, and adapting based on the feedback.
 E.g. at the end of a chess game the agent is told that it has won (a reward) or lost (a
punishment).
 Agent can decide which of the actions prior to the reinforcement were most responsible for
it, and to alter its actions to aim towards more rewards in the future

10
Models under Each Type of Learning
 Supervised Learning
 Classification: Logistic Regression, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Decision Trees,
Random Forest, Naive Bayes, Neural Networks, etc.
 Regression: Linear Regression, Ridge Regression, Lasso Regression, Support Vector Regression (SVR), Decision
Trees for Regression, Random Forest Regression, Neural Networks for Regression, etc.
 Unsupervised learning
 Clustering: K-Means Clustering, Hierarchical Clustering, DBSCAN, Gaussian Mixture Model (GMM), etc.
 Dimensionality Reduction: Principal Component Analysis (PCA), t-Distributed Stochastic Neighbor Embedding
(t-SNE), Linear Discriminant Analysis (LDA), Autoencoders , etc.
 Association Rule Learning Models: Apriori Algorithm, Eclat Algorithm, etc.
 Reinforcement Learning
 Q-Learning, Deep Q-Networks (DQN), Policy Gradient Methods, Monte Carlo Tree Search (MCTS), Proximal
Policy Optimization (PPO) , etc.
Ensemble Models

 Ensemble models are Machine Learning methods that combine the predictions of
multiple base models to improve performance, accuracy, and robustness.
 The idea is that a group of weak or diverse learners can produce a stronger predictive model
when combined effectively.
 Some ways of creating Ensembles:
 Bagging
 Stacking
 Boosting
Creating Ensemble Models
Bagging
 Bagging (Bootstrap Aggregating) replacement.
combines multiple instances of a model  Predictions of all the instances are then
to improve the prediction accuracy and aggregated by averaging or the majority
vote
reduce the variance of the
 Bagging is particularly useful for reducing
predictions.
the Variance of the predictions from
 Key Idea: Train multiple instances of overfitting when using a single model.
a model on different subsets of the  Example of algorithms:
data, also known as bootstrap samples.  Random Forest, Bagged Decision Trees,
 Each bootstrap sample is created by Extra Trees, Bagging Classifier/Regressor.
randomly sampling the original data with

13
Creating Ensemble Models
Boosting
 Boosting also combines multiple vote
instances of a model to improve the  Boosting is particularly useful for reducing
prediction accuracy and reduce bias the Bias of the predictions from
underfitting when using a single model.
 Key idea: Train multiple instances of a
model Sequentially  It can also be used to improve models
with high bias such as linear regression.
 Each instance is trained to correct the
mistakes made by the previous instances.  Examples algorithms
 Predictions of all the instances are then  AdaBoost, Gradient Boosting Machine
aggregated to make the final prediction by (GBM) and XGBoost
Weighted Averaging or Majority
14
Creating Ensemble Models
Stacking
 Stacked generalization (or stacking)  Usefulness:
combines multiple base models from  To improve the performance of a single model
Different Model classes trained on the leveraging complementary strengths
same data  It can be computationally expensive as it
 Key Idea: Use a set of base models, which requires training multiple base models and a
are trained independently on the same data, to meta-model.
make predictions.  Example of algorithms:
 These predictions are then used as input for  Base Learners: Random Forest, Gradient
the meta-model, which is trained to make the Boosting, Support Vector Machine, K-Nearest
final prediction. Neighbors.
 Meta-Learner: Logistic Regression, Linear
Regression, or another simple algorithm.

15
Steps in Machine Learning
Feature Exploratory
Problem Data Data
Selection/En Data
Definition Collection Preprocessing
gineering Analysis

Model Hyperparameter Model Model Model


Deployment Tuning Evaluation Training Selection

Monitoring
and
Maintenance
Steps in Machine Learning
 Problem Definition: Identify the problem to be solved and define the objective clearly.
 Data Collection: Gather the data needed for training and testing the model.
 Data Preprocessing: Clean and preprocess the data by handling missing values,
normalizing or scaling features, encoding categorical variables, and splitting the dataset into
training and testing sets.
 Feature Selection/Engineering: Choose relevant features or create new ones that will
improve model performance.
 Exploratory Data Analysis (EDA): involves analyzing and summarizing data to uncover
patterns and insights through visualization, without assuming any underlying distribution,
using tools like histograms, scatter plots, and box plots.
Steps in Machine Learning
 Model Selection: Choose an appropriate machine learning algorithm (e.g., decision trees,
support vector machines, neural networks).
 ModelTraining:Train the model on the training dataset by applying the selected algorithm.
 Model Evaluation: Assess the model’s performance using appropriate metrics (e.g.,
accuracy, precision, recall, F1 score, RMSE) on the testing dataset.
 Hyperparameter Tuning: Fine-tune the model’s hyperparameters to optimize its
performance.
 Model Deployment: Deploy the model into a real-world environment or integrate it into
an application.
 Monitoring and Maintenance: Continuously monitor the model's performance in
production and update it as necessary based on new data or changing conditions.
Model Selection
Some key considerations when selecting a machine learning model:
 Data Size & Quality: Choose models that can handle the amount and quality of your data.
 Task Type: Consider whether the task is classification, regression, clustering, etc.
 Model Complexity: Match model complexity to the problem—avoid underfitting or
overfitting.
 Interpretability: Consider how important it is to explain model decisions.
 Training Time & Resources: Factor in computational efficiency and time constraints.
 Performance Metrics: Choose models that align with your evaluation criteria (e.g., accuracy,
F1 score).
 Scalability: Ensure the model can scale with growing data.
Underfitting Vs Overfitting
Underfitting Overfitting
 Definition: Model is too simple to  Definition: Model captures noise in
capture data patterns. training data, not just patterns.
 Signs: Poor performance on both  Signs: Excellent training performance,
training and test data. poor test performance.
 Causes: Too simple model, insufficient  Causes: Too complex model, too little
features, or excessive regularization. data, or noisy data.
 Fix: Use a more complex model, add  Fix: Simplify model, use regularization,
features, reduce regularization. gather more data.

20
Classification Vs Regression Problems

 Classification Problems  Regression Problems


 When the output is one of a finite set  When the output is a number
of values (such as sunny/cloudy/rainy  E.g. tomorrow’s temperature,
or true/false) measured either as an integer or a real
 Learning a function with a small number
number of possible output  Learning a function whose output is a
categories continuous or ordered value (like
weight)

21
Classification Vs Regression Problems
 Examples of some Machine Learning tasks
Task Description Type
Estimating the price of a rental property Regression
Determining the likelihood of a disease Classification
Calculating the mileage a car can achieve Regression
Identifying fraudulent transactions Classification
Assessing a person's risk score for credit Regression
Determining email as spam or not Classification
Calculating energy consumption of appliances Regression
Identifying risky areas for wildfires Classification
Analyzing temperature trends over time Regression
Assigning a pass/fail grade to a project Classification

22
Python Libraries for Machine Learning
 Some important python libraries needed for machine learning.
 NumPy - For numerical operations and handling arrays.
 Pandas - For data manipulation and analysis (e.g., working with DataFrames).
 Matplotlib - For data visualization (creating plots and charts).
 Seaborn - For statistical data visualization (based on Matplotlib).
 Scikit-learn - For implementing machine learning algorithms, preprocessing,
model selection, and evaluation.
 SciPy - For scientific and technical computing (e.g., optimization, integration).
PRACTICAL EXAMPLES
REGRESSION TASK
Case Study: Predicting House Prices

 Task: The task is to predict house prices based on various features like the size of
the house, number of bedrooms, and location, using a machine learning
algorithm.
 Objectives:
 Understand how machine learning algorithms can be applied to predict continuous values
(regression problem).
 Implement a Linear Regression model to predict house prices.
 Evaluate the model's performance using evaluation metrics such as Mean Absolute Error
(MAE), Mean Squared Error (MSE), and R-squared (R²).
Dataset Description
 The "House Prices: Advanced Regression Techniques" dataset consists of various
attributes related to homes, which help predict their sale price.
 Some key features in the dataset include:SalePrice, OverallQual, GrLivArea, GarageCars,
GarageArea, TotalBsmtSF, 1stFlrSF, YearBuilt, YearRemodAdd, ExterCond, MasVnrArea,
BsmtQual, BsmtExposure, FireplaceQu, PoolQC, LotFrontage, LotArea, OverallCond,
and Condition1.
 Total number of records: 1,460
 Total number of features: 80
 Numerical features: 38
 Categorical features: 43
Regression Task: Implementation
 Step 1: Install the required libraries (skip if already installed)
pip install numpy pandas scikit-learn matplotlib seaborn
 Step 2: Import Libraries
import numpy as np
import pandas as pd
import [Link] as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from [Link] import mean_absolute_error, mean_squared_error, r2_score
 Step 3: Load the Dataset
# Load the dataset (either using the URL or local file path)
data = pd.read_csv('path_to_dataset.csv'’)

# Preview the first few rows of the dataset


[Link]()
 Step 4: Data Preprocessing
# Drop columns that are not useful for prediction
columns_to_drop = ['Id', 'Alley', 'PoolQC', 'Fence', 'MiscFeature']
data = [Link](columns=columns_to_drop, axis=1)

# Convert categorical variables into dummy variables


data = pd.get_dummies(data, drop_first=True)

# Fill missing numerical values with the median of the respective columns
data = [Link]([Link]())

# Split the data into features (X) and target variable (y)
X = [Link]('SalePrice', axis=1)
y = data['SalePrice']
 Step 5: Split the Dataset into Training and Testing Sets
# Use an 80-20 train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y,
test_size=0.2, random_state=42)

 Step 6: Train the Linear Regression Model


# Initialize the Linear Regression model
model = LinearRegression()

# Fit the model to the training data


[Link](X_train, y_train)

 Step 7: Make Predictions


# Predict on the test set
y_pred = [Link](X_test)
 Step 8: Evaluate the Model's Performance
# Calculate evaluation metrics
mae = mean_absolute_error(y_test, y_pred)
mse = mean_squared_error(y_test, y_pred)
r2 = r2_score(y_test, y_pred)
# Print the evaluation results
print(f'Mean Absolute Error (MAE): {mae}')
print(f'Mean Squared Error (MSE): {mse}')
print(f'R-squared (R²): {r2}')
 STEP 9: VISUALIZE THE RESULTS
# Plot actual vs predicted house prices
[Link](figsize=(8, 6))
[Link](y_test, y_pred, alpha=0.6, color='blue')
[Link]([min(y_test), max(y_test)], [min(y_pred), max(y_pred)],
color='red', linewidth=2)
[Link]('Actual vs Predicted House Prices')
[Link]('Actual Prices’)
[Link]('Predicted Prices')
[Link]()
Explanation of Evaluation Metrics Results:
 Mean Absolute Error (MAE): Measures the average difference between actual and predicted
values.
 MAE = 20,584 indicates that on average, the predictions are off by about $20,584, which is
relatively high for house price prediction.

 Mean Squared Error (MSE): Measures the average squared difference between actual and
predicted values, penalizing larger errors.
 MSE = 2729610891.25088 indicates significant variance in the errors, meaning the model
struggles with large deviations.

 R-squared (R²): Indicates the proportion of variance in the target explained by the model (ranges
from 0 to 1).
 R² = 0.644 means the model explains 64.4% of the variation in house prices, which is
moderate but leaves substantial room for improvement.
 Implications: The linear regression model is not ideal due to high errors and limited ability to
capture the complexity of the dataset.

 Plot Analysis:
 The plot shows actual vs. predicted house prices. The red line represents perfect predictions.
Points deviate significantly from this line, indicating inconsistent predictions.
 Fit: The model is underfitted, as it fails to capture the dataset's complexity, evidenced by
systematic errors and poor alignment of predictions.
 Using another regression model: Random Forest Regressor
Step 6: Train the Random Forest Regression Model
# Initialize the Random Forest Regressor
model = RandomForestRegressor(random_state=42)
# Fit the model to the training data
[Link](X_train, y_train)
Note: Every other step remains the same
Random Forest Regressor Performance Explanation:

 MAE (17,543): On average, the Random Forest model's predictions are off by around $17,543
from the actual house prices. This is much better than Linear Regression, which had
significantly larger errors.

 MSE (838,260,221): The model's squared errors are smaller compared to Linear Regression,
meaning fewer extreme errors in predictions.

 R² (0.89): The model explains 89% of the variation in house prices, showing it fits the data
well. Linear Regression had a negative R², indicating a poor fit.

 Plot Explanation:
 The scatter plot compares actual vs predicted prices. The points closely align with the red
diagonal line, showing good prediction accuracy, though some deviations occur for high-
priced houses.
Summary of the House Price Prediction Task

 Linear Regression assumes a linear relationship between features and the target
variable. It struggles with:
 Non-linear patterns,
 Multicollinearity,
 Complex interactions among features.
 Random Forest Regressor excels because:
 It captures non-linear relationships,
 Handles high-dimensional data,
 Is robust to outliers and multicollinearity,
 Uses ensemble learning to improve accuracy and reduce overfitting.
 Thus, Random Forest is better suited for complex datasets like house price prediction.
CLASSIFICATION TASK
Case Study: Predicting Whether a Passenger Survived the Titanic Disaster

 Task: The task is to predict whether a passenger survived the Titanic disaster
based on various features such as age, gender, class, and other attributes. This is a
classification task where we will predict the binary outcome: survived (1) or not
survived (0).
 Objectives:
 Understand how machine learning can be applied to a classification problem.
 Implement a simple classification model (Logistic Regression) to predict survival.
 Evaluate the model's performance using metrics such as accuracy, precision, recall, and F1-
score
Dataset Description
 The “Titanic: Machine Learning from Disaster dataset” on Kaggle is a classic dataset
used for binary classification tasks, where the goal is to predict passenger survival based on
various features.
 Some key features in the dataset include: PassengerId, Pclass, Name, Sex, Age, SibSp,
Parch,Ticket, Fare, Cabin, Embarked, Survived.
 Total Number of Records: 891 passengers.
 Total Number of Features: 11 features (excluding the target variable 'Survived’).
 Numerical Features: 4 (Age, SibSp, Parch, Fare)
 Categorical Features: 5 (Pclass, Sex, Embarked, Name, Cabin)
Classification Task: Implementation
 Step 1: Import Libraries
import numpy as np
import pandas as pd
import [Link] as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from [Link] import accuracy_score, precision_score,
recall_score, f1_score, confusion_matrix
from [Link] import roc_curve, auc
 Step 2: Load the Dataset
# Load the dataset (either using the URL or local file path)
data = pd.read_csv('path_to_dataset.csv'’)

# Preview the first few rows of the dataset


[Link]()
 Step 3: Data Preprocessing
# Drop columns that are not useful for prediction
data = [Link](['Name', 'Ticket', 'Cabin'], axis=1)

# Convert categorical variables into dummy variables


data = pd.get_dummies(data, columns=['Sex', 'Embarked'],
drop_first=True)

# Handle missing values


# Fill missing age values with median
data['Age'] = data['Age'].fillna(data['Age'].median())
#Fill missing Embarked with mode
if 'Embarked' in [Link]:
mode_value = data['Embarked'].mode()[0] # Get the mode value
data['Embarked'].fillna(mode_value, inplace=True)
else:
print("'Embarked' column not found.")
# Split the data into features (X) and target variable (y)
X = [Link]('Survived', axis=1)
y = data['Survived’]

 Step 5: Split the Dataset into Training and Testing Sets


# Use an 80-20 train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y,
test_size=0.2, random_state=42)

 Step 6: Train the Logistic Regression Model


# Initialize the Logistic Regression Model
model = LogisticRegression(max_iter=1000)
# Train the model on the training data
[Link](X_train, y_train)
 Step 7: Make Predictions
# Use the trained model to make predictions on the test set
y_pred = [Link](X_test)

 Step 8: Evaluate the Model's Performance


# Evaluate the model using various metrics
accuracy = accuracy_score(y_test, y_pred)
precision = precision_score(y_test, y_pred)
recall = recall_score(y_test, y_pred)
f1 = f1_score(y_test, y_pred)

# Print the evaluation metrics


print(f'Accuracy: {accuracy}')
print(f'Precision: {precision}')
print(f'Recall: {recall}')
print(f'F1 Score: {f1}')
# Display the confusion matrix
cm = confusion_matrix(y_test, y_pred)
[Link](cm, annot=True, fmt='d', cmap='Blues', xticklabels=['Not
Survived', 'Survived'], yticklabels=['Not Survived', 'Survived'])
[Link]('Predicted')
[Link]('True')
[Link]('Confusion Matrix')
[Link]()
 STEP 9: VISUALIZE THE RESULTS
# plotting the ROC curve to visualize the classification performance.
# Calculate the ROC curve
fpr, tpr, thresholds = roc_curve(y_test,
model.predict_proba(X_test)[:,1])
roc_auc = auc(fpr, tpr)

# Plot the ROC curve


[Link](figsize=(8,6))
[Link](fpr, tpr, color='blue', label=f'ROC curve (area =
{roc_auc:.2f})')
[Link]([0, 1], [0, 1], color='gray', linestyle='--')
[Link]('Receiver Operating Characteristic (ROC) Curve')
[Link]('False Positive Rate')
[Link]('True Positive Rate')
[Link](loc='lower right')
[Link]()
The ROC curve to visualize the classification performance
Confusion Matrix Explanation:
 A confusion matrix is a table used to evaluate the performance of a classification model, showing
the counts of true positive, true negative, false positive, and false negative predictions. It helps in
understanding how well the model is performing and where it is making errors.

Predicted: Not Survived (0) Predicted: Survived (1)


True: Not Survived (0) 89 (True Negative) 16 (False Positive)
True: Survived (1) 19 (False Negative) 55 (True Positive)

 True Negatives (TN = 89): The model correctly predicted 89 passengers as "Not Survived" when
they actually did not survive.
 False Positives (FP = 16): The model incorrectly predicted 16 passengers as "Survived" when they
actually did not survive.
 False Negatives (FN = 19): The model incorrectly predicted 19 passengers as "Not Survived"
when they actually survived.
 True Positives (TP = 55): The model correctly predicted 55 passengers as "Survived" when they
actually survived.
Explanation of Evaluation Metrics Results:
 Accuracy: The proportion of correct predictions (both true positives and true
negatives) out of all predictions.
(𝑇𝑃 + 𝑇𝑁)
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 =
(𝑇𝑃 + 𝑇𝑁 + 𝐹𝑃 + 𝐹𝑁)
 An accuracy of 80.45% suggests that the model is correctly predicting the survival status of
passengers most of the time. However, if the dataset is imbalanced (more non-survivors), accuracy
alone might not reflect model performance effectively.

 Precision: The proportion of true positives (correctly predicted survivors) out of all
predicted positives (both true positives and false positives).
𝑇𝑃
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 =
(𝑇𝑃+𝐹𝑃)
 A precision of 77.46% means that when the model predicts a passenger survived, about 77% of the
time, this is correct. High precision is important when false positives (predicting survival when the
passenger did not survive) have serious consequences.
 Recall: The proportion of true positives out of all actual positives (both true positives and false
negatives).
𝑇𝑃
𝑅𝑒𝑐𝑎𝑙𝑙 =
(𝑇𝑃+𝐹𝑁)
 A recall of 74.32% means that the model correctly identifies 74% of all actual survivors. It is
important when it's crucial to catch as many true survivors as possible, even at the cost of some
false positives.

 F1 Score: The harmonic mean of precision and recall, providing a balance between the two.
2 × (𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑅𝑒𝑐𝑎𝑙𝑙)
𝐹1 𝑆𝑐𝑜𝑟𝑒 =
(𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑅𝑒𝑐𝑎𝑙𝑙)
 An F1 score of 75.86% indicates a good balance between precision and recall, suggesting the model
is both accurate in predicting survivors and competent at identifying them. It’s a useful metric
when both false positives and false negatives are important.

 The model performs well with 80.45% accuracy, but it may be missing some survivors (false
negatives) and over-predicting non-survivors (false positives).
 Explanation of ROC Curve:

 The ROC curve evaluates the trade-off between the True Positive Rate and False Positive
Rate across different thresholds.

 The curve shows how well the model distinguishes between classes (survived vs. not survived).
 A sharp rise towards the top-left indicates good model performance (the model achieves a high
true positive rate with a relatively low false positive rate).

 The Area Under the Curve (AUC) value of 0.88 signifies strong discriminatory power (88%
probability of correctly distinguishing classes).
 Higher AUC indicates better model performance.

 The diagonal line (AUC = 0.50) represents random guessing. Since the model's curve being above
the diagonal indicates better-than-random performance.
Top Tools/Environments for Running Machine Learning
Codes
 Jupyter Notebook - An interactive environment for running Python code, especially for data
analysis and machine learning tasks. It allows for mixing code, output, and markdown text.
 Google Colab - A cloud-based version of Jupyter Notebook that provides free access to GPUs,
making it great for machine learning tasks requiring heavy computation.
 VS Code (Visual Studio Code) - A powerful code editor with support for Python, integrated
terminal, and extensions for running ML projects. It can be customized with various plugins for
machine learning.
 PyCharm - A Python IDE with features like code completion, debugging, and integration with
libraries for machine learning tasks.
 RStudio - While typically used for R programming, RStudio also supports Python and is useful
for ML when working with data science workflows.
Sources of Datasets
 Some popular sources for machine learning datasets:
 Kaggle – A platform offering numerous datasets for various machine learning tasks, including
competitions and datasets from real-world problems.
 UCI Machine Learning Repository – A collection of classic datasets widely used for
academic and practical purposes in machine learning.
 Google Dataset Search – A search engine for datasets that pulls from various repositories,
including government, academic, and private sources.
 AWS Open Datasets – A collection of public datasets available on Amazon Web Services, useful
for large-scale machine learning projects.
 OpenML – An open platform for sharing datasets, machine learning algorithms, and
experiments, which fosters collaboration among researchers.

You might also like