Predictive Modeling & Model Evaluation
Academic Quick Reference & Revision Notes
1. Bayes Theorem
Meaning
Bayes Theorem is a fundamental mathematical theorem used in probability and data science to calculate the
conditional probability of an event, based on prior knowledge or conditions related to the event.
Mathematical Formula
P(A | B) = [ P(B | A) × P(A) ] ÷ P(B)
For intuitive conceptual application during rapid reviews, remember:
New (Posterior) Probability = Baseline (Prior) Probability + New Conditional Evidence
Practical Concept Example
Consider a sample population framework of 100 students:
• 60 students maintain a structured, regular study regimen.
• Out of those regular students, exactly 48 successfully secure a passing grade.
Analytical Question: If we isolate a student who studies regularly, what is their exact statistical probability of
passing? Bayes Theorem solves this by matching the overlapping known distributions.
Real-World Applications
• Banking & Finance: Predicting loan default probabilities and automated risk assessment.
• Healthcare: Calculating disease presence probability given a positive diagnostic test score.
• Email Engineering: Powering Naive Bayes classifiers for automated Spam / Ham filtering.
• Education: Forecasting final student performance outcomes using historic term indicators.
Data Analytics Quick Revision Guide - Part III 1
2. Classification
Meaning
Classification is a supervised learning data mining technique used to predict and allocate data records into
distinct, predefined categorical groups or classes based on patterns learned during training.
Example: Email Categorization
Incoming Email String Payload Predefined Category Output Label
"Special promotional discount offer! Click here now..." Spam
"Project update review meeting scheduled for tomorrow at 10 AM." Not Spam
The Classification Pipeline
Ingest Training Data ➔ Extract & Learn Patterns ➔ Predict Target Categories
Core Application Domains
✓ Fintech: Credit Line Scoring (Outputs: Approved or Rejected).
✓ Diagnostics: Pathology Screening (Outputs: Disease Detected or No Disease).
✓ Academic Monitoring: Automated Grading Pipelines (Outputs: Pass or Fail).
3. Classification vs. Clustering
While both methods organize data into groups, they operate under entirely different machine learning
paradigms regarding target labels.
CLASSIFICATION (SUPERVISED) CLUSTERING (UNSUPERVISED)
Assigns incoming data into strictly predefined, Automatically discovers underlying structures to
pre-known classes. Requires explicit historical create new groups based on data similarities. No
labels to learn the boundaries between groups. prior labels or target classes exist.
Example: Sorting final exam outcomes cleanly into Example: Grouping an e-commerce customer
static buckets like Pass or Fail. base organically by natural spending behavior
similarities.
Data Analytics Quick Revision Guide - Part III 2
Detailed Comparison Matrix
Comparison
Classification Clustering
Dimension
Learning Paradigm Supervised Learning Method Unsupervised Learning Method
Data Labels
Requires explicit training labels Operates on unlabeled raw datasets
availability
Predict correct categorical class for
Primary Objective Discover hidden similarity groupings
records
Class Knowledge Classes are fixed and known beforehand Classes are discovered dynamically
Behavioral Market Customer
Core Use Case Loan Approval (Approved / Denied)
Segmentation
4. Logistic Regression
Meaning
Logistic Regression is a statistical and machine learning model used for categorical classification that
estimates the probability of an input belonging to a specific category. It maps inputs into probabilities bounded
strictly between 0 and 1 via a sigmoid function.
It is predominantly utilized to resolve discrete binary outputs: Yes / No, Pass / Fail, or Spam / Not
Spam.
Example scenario
Study Hours Input (X) Observed Historical Outcome (Y)
2 Hours Fail
6 Hours Pass
Prediction Task: Given a new student data vector with Study Hours = 5, the trained model computes the
target probability threshold and reliably predicts a categorical label output of Pass.
The Logistic Pipeline
Input Feature Data ➔ Compute Probability (0 to 1) ➔ Apply Threshold & Predict Class
Data Analytics Quick Revision Guide - Part III 3
Structural Variations
1. Binary Logistic Regression: Constrained strictly to two mutually exclusive outcomes (e.g., Pass / Fail).
2. Multinomial Logistic Regression: Extends to cover multiple unordered categorical outcomes (e.g.,
predicting grades like A vs. B vs. C).
3. Ordinal Logistic Regression: Deployed when target categories carry an intrinsic, sequential ranking
order (e.g., ranking customer satisfaction as Poor ➔ Average ➔ Excellent).
5. Decision Trees
Meaning
A Decision Tree is a flowchart-like, tree-structured machine learning model where internal nodes represent
tests on attributes, branches represent test outcomes, and leaf nodes contain final classification decisions.
ACADEMIC DECISION FLOWCHART FINTECH CASE STUDY FLOWCHART
Did Student Study? Is Monthly Income > ₹50,000?
├── No ➔ [Fail Leaf] ├── No ➔ [Reject Loan Leaf]
└── Yes ➔ Check Class Attendance └── Yes ➔ Is Credit Score Good?
├── Poor Attendance ➔ [Fail Leaf] ├── No ➔ [Reject Loan Leaf]
└── Good Attendance ➔ [Pass Leaf] └── Yes ➔ [Approve Loan Leaf]
Core Advantages: Exceptionally simple to interpret, matches human visual decision patterns, and requires
minimal underlying data normalization.
6. K-Means Clustering
Meaning
K-Means Clustering is an unsupervised algorithm that partitions a dataset into K distinct, non-overlapping
clusters. It iteratively groups records based on spatial proximity to dynamically calculated cluster centroids.
Numerical Segmentation Example
Given an unsorted continuous marks array: [10, 20, 25, 90, 95, 100]. Setting an initial parameter of
K = 2 forces the algorithm to mathematically segment the numbers into two cohesive neighbor nodes:
• Cluster 1 (Low Range Center): [10, 20, 25]
• Cluster 2 (High Range Center): [90, 95, 100]
Data Analytics Quick Revision Guide - Part III 4
The 5 Iterative Algorithmic Steps
1. Define K Count ➔ 2. Initialize Centroids ➔ 3. Assign Nearest Points ➔
4. Recalculate Centroids ➔ 5. Check Convergence
7. Classification Model Evaluation Formulae
Evaluation metrics are necessary to objectively gauge model performance. All primary formulas are extracted
from the baseline structure of a Confusion Matrix.
The Confusion Matrix Architecture
Actual State / Predicted State Predicted POSITIVE Predicted NEGATIVE
Actual POSITIVE TP (True Positive) FN (False Negative)
Actual NEGATIVE FP (False Positive) TN (True Negative)
Core Mathematical Performance Evaluation Metrics
1. Accuracy
The ratio of correctly predicted observation instances over the entire population set.
Accuracy = (TP + TN) ÷ (TP + TN + FP + FN)
2. Error Rate
The mathematical complement of accuracy, representing the total ratio of misclassified instances.
Error Rate = (FP + FN) ÷ Total Population = 1 - Accuracy
3. Precision
Measures the exact quality of positive predictions, outlining how many predicted positives are truly positive.
Precision = TP ÷ (TP + FP)
4. Recall (Sensitivity)
Measures the model's absolute capability to discover and pull all actual positive instances from the dataset.
Recall = TP ÷ (TP + FN)
Data Analytics Quick Revision Guide - Part III 5
5. Specificity
Measures the model's accuracy at correctly identifying and isolating true negative instances.
Specificity = TN ÷ (TN + FP)
6. F1 Score
The harmonic mean balancing both Precision and Recall metrics into a single representative score value.
F1 Score = 2 × [ (Precision × Recall) ÷ (Precision + Recall) ]
Evaluation Metrics Summary Reference
Target Metric Core Analytical Meaning
Accuracy Measures overall exact correctness of model outputs.
Error Rate Measures overall combined predictive mistake ratios.
Precision Quantifies quality and reliability of generated positive flags.
Recall Quantifies total detection coverage for actual positive cases.
Specificity Quantifies true accuracy in identifying negative classes.
F1 Score Provides a balanced harmonic optimization of Precision and Recall.
Data Analytics Quick Revision Guide - Part III 6
Ultra Short Exam Revision Matrix
Bayes Theorem Predicts conditional probability combining prior knowledge with fresh
evidence.
Classification Supervised strategy assigning data to pre-known categorical groups.
Clustering Unsupervised strategy grouping similar data records automatically.
Logistic Regression Classification algorithm computing categorical membership probabilities.
Decision Tree Flowchart-like hierarchy optimizing decisions via feature tests.
K-Means Iteratively isolates spatial data clusters around K dynamic centroids.
Accuracy Overall percentage of correct hits made by the model.
Precision The truth ratio within instances flagged positive by the system.
Recall The systemic ratio of actual positives successfully trapped by the system.
F1 Score The unified harmonic metric balancing precision with recall coverage.
Data Analytics Quick Revision Guide - Part III 7