# Session 22 11 2025 Summary Slides course: Module 1 — Foundations of AI & ML module: Module-1-Foundations-AI-ML type: pdf source_url: https://personal-learn.armco.dev/files/Module-1-Foundations-AI-ML/General/PPT_Slides_22-11-2025_and_23-11-2025/Session_22_11_2025_Summary_Slides.pdf pages: 26 --- [page 1] IIT Roorkee – Futurense PG Certification GenAI and Agentic AI for Engineers Data Pre-Processing and Curation – III and EDA Dr Durga Toshniwal Professor (HAG) Department of Computer Science & Engg. Indian Institute of Technology Roorkee durga.toshniwal@cs.iitr.ac.in, durgatoshniwal@gmail.com www.durgatoshniwal.in [page 2] Major Tasks in Data Pre-processing • Data cleaning – Fill in missing values, smooth noisy data, and resolve inconsistencies • Data integration – Integration of multiple databases, or files • Data transformation – Normalization and aggregation • Data reduction – Obtain reduced representation in volume with same or similar analytical results • Data discretization – Part of data reduced by binning GenAI and Agentic AI - Prof Durga Toshniwal [page 3] • Given N data vectors from k-dimensions, find c <= k orthogonal vectors that can be best used to represent data – The original data set is reduced to one consisting of N data vectors on c principal components (reduced new or alternate set of dimensions) • Each data vector is a linear combination of the c principal component vectors • Works for numeric data only • Used when the number of dimensions is large Data Reduction by Dimensionality Reduction – Principal Component Analysis (PCA) GenAI and Agentic AI - Prof Durga Toshniwal [page 4] X1 X2 Y1 Y2 Data Reduction by Dimensionality Reduction – Principal Component Analysis GenAI and Agentic AI - Prof Durga Toshniwal [page 5] What is Data? • Collection of data objects and their attributes • An attribute is a property or characteristic of an object – Examples: eye color of a person, temperature, etc. – Attribute is also known as variable, field, characteristic, dimension, or feature • A collection of attributes describe an object – Object is also known as record, point, case, sample, entity, or instance Tid Refund Marital Status Taxable Income Cheat 1 Yes Single 125K No 2 No Married 100K No 3 No Single 70K No 4 Yes Married 120K No 5 No Divorced 95K Yes 6 No Married 60K No 7 Yes Divorced 220K No 8 No Single 85K Yes 9 No Married 75K No 10 No Single 90K Yes 10 Attributes Objects GenAI and Agentic AI - Prof Durga Toshniwal [page 6] Discrete and Continuous Attributes • Discrete Attribute – Has only a finite set of values – Examples: zip codes, counts, or the set of words in a collection of documents – Often represented as integer variables. – Note: binary attributes are a special case of discrete attributes • Continuous Attribute – Has real numbers as attribute values – Examples: temperature, height, or weight. – Continuous attributes are typically represented as floating- point variables. GenAI and Agentic AI - Prof Durga Toshniwal [page 7] Similarity and Dissimilarity • Similarity – Numerical measure of how alike two data objects are. – Is higher when objects are more alike. – Often falls in the range [0,1] • Dissimilarity – Numerical measure of how different two data objects are – Lower when objects are more alike – Minimum dissimilarity is often 0 – Upper limit varies • Proximity refers to a similarity or dissimilarity GenAI and Agentic AI - Prof Durga Toshniwal [page 8] Euclidean Distance • Euclidean Distance = −= n k kk qpdist 1 2)( D(Q,C) GenAI and Agentic AI - Prof Durga Toshniwal Where n is the number of dimensions (attributes) and pk and qk are, respectively, the kth attributes (components) or data objects p and q. [page 9] Euclidean Distance 0 1 2 3 0 1 2 3 4 5 6 p1 p2 p3 p4 point x y p1 0 2 p2 2 0 p3 3 1 p4 5 1 Distance Matrix p1 p2 p3 p4 p1 0 2.828 3.162 5.099 p2 2.828 0 1.414 3.162 p3 3.162 1.414 0 2 p4 5.099 3.162 2 0 GenAI and Agentic AI - Prof Durga Toshniwal [page 10] Generalization : Minkowski Distance • Minkowski Distance is a generalization of Euclidean Distance rn k r kk qpdist 1 1 )||( = −= GenAI and Agentic AI - Prof Durga Toshniwal Where r is a parameter, n is the number of dimensions (attributes) and pk and qk are, respectively, the kth attributes (components) or data objects p and q. [page 11] Minkowski Distance: Examples • r = 1. – L 1 Norm, A common example of this is the Manhattan, Hamming distance, which is just the number of bits that are different between two binary vectors • r = 2. Euclidean distance, L2 norm GenAI and Agentic AI - Prof Durga Toshniwal [page 12] Minkowski Distance Distance Matrix point x y p1 0 2 p2 2 0 p3 3 1 p4 5 1 L1 p1 p2 p3 p4 p1 0 4 4 6 p2 4 0 2 4 p3 4 2 0 2 p4 6 4 2 0 L2 p1 p2 p3 p4 p1 0 2.828 3.162 5.099 p2 2.828 0 1.414 3.162 p3 3.162 1.414 0 2 p4 5.099 3.162 2 0 GenAI and Agentic AI - Prof Durga Toshniwal [page 13] Common Properties of a Distance • Distances, such as the Euclidean distance, have some well-known properties. 1. d(p, q) 0 for all p and q and d(p, q) = 0 only if p = q. (Positivity) 2. d(p, q) = d(q, p) for all p and q. (Symmetry) 3. d(p, r) d(p, q) + d(q, r) for all points p, q, and r. (Triangle Inequality) • A measure that satisfies these properties is a metric GenAI and Agentic AI - Prof Durga Toshniwal [page 14] Pearson Correlation Coefficient • Correlation measures the linear relationship between data objects, range is -1 to 1 • Where ꝩ = Correlation Coefficient • Xi = Value of x-variable in a sample • X-Bar = Mean of values of x-variable • Yi = Value of y-variable in a sample • Y-Bar = Mean of values of y-variable GenAI and Agentic AI - Prof Durga Toshniwal [page 15] Visually Evaluating Correlation Scatter plots showing the similarity from –1 to 1.GenAI and Agentic AI - Prof Durga Toshniwal [page 16] Box Plots A box plot (or box-and-whisker plot) is a statistical chart used to display the distribution, central tendency, and spread of data. It highlights key summary statistics visually. Key Components : • Lower Quartile (Q1): 25% of the data lies below this value. • Median (Q2): The middle value of the dataset. • Upper Quartile (Q3): 75% of the data lies below this value. • Box: Shows the interquartile range (IQR = Q3 - Q1), where the middle 50% of the data lies. • Whiskers: Extend from Q1 to the minimum value and Q3 to the maximum value (excluding outliers). • Outliers: Points that lie outside 1.5 × IQR from Q1 or Q3, shown as small circles. GenAI and Agentic AI - Prof Durga Toshniwal [page 17] Box Plots A shorter box = tighter clustering of values. A taller box = greater variability in the middle 50%. GenAI and Agentic AI - Prof Durga Toshniwal [page 18] Kernel Density Estimate (KDE) Plots • A KDE plot smooths a histogram using a kernel to produce a continuous curve. • A kernel is a mathematical function used to smooth data points • It shows where data values are concentrated and helps identify modes (peaks) in the distribution. GenAI and Agentic AI - Prof Durga Toshniwal [page 19] Kernel Density Estimate (KDE) Plots Key Features: • Sky blue curve: The estimated distribution of the data. • Shaded area: Represents density under the curve. • Red dashed line: Marks the mean of the data. • Most common is Gaussian Kernel gives Bell shaped curve GenAI and Agentic AI - Prof Durga Toshniwal [page 20] Violin Plots Violin plot is a combination of a box plot and a kernel density plot. Components: Vertical shape: The width of the "violin" at any point represents the density of the data at that value. Thicker = more data points there. • White line (median): Shows the median (Q2) of the data. • Box lines inside the violin: • Q1 (25%): Lower quartile. • Q3 (75%): Upper quartile. • Whiskers: Indicate the data range excluding outliers (similar to box plots). Benefits: • Violin plots show distribution shape and density, which box plots do not. • Useful for comparing multiple distributions side-by-side. . GenAI and Agentic AI - Prof Durga Toshniwal [page 21] Violin Plots Vertical shape: The width of the "violin" at any point represents the density of the data at that value. Thicker = more data points there. • White line (median): Shows the median (Q2) of the data. • Box lines inside the violin: • Q1 (25%): Lower quartile. • Q3 (75%): Upper quartile. • Whiskers: Indicate the data range excluding outliers (similar to box plots). . GenAI and Agentic AI - Prof Durga Toshniwal [page 22] Heatmaps Heatmap is a data visualization technique that uses color to represent values in a matrix-like format. • It allows to easily identify patterns, correlations, and outliers in data. • Rows and columns usually represent variables • Cell color intensity reflects the magnitude of the corresponding value. Correlations can also show how strongly each variable is related to every other variable. GenAI and Agentic AI - Prof Durga Toshniwal [page 23] Heatmaps GenAI and Agentic AI - Prof Durga Toshniwal [page 24] Heatmaps Row/Column Anomalies • If an entire row or column stands out from the others either much lighter or darker, the corresponding observation (row) or variable (column) might have outlier values. GenAI and Agentic AI - Prof Durga Toshniwal [page 25] Books Foundational / Introductory 1. "Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow" by Aurélien Géron o Practical, code-heavy introduction to ML and DL using Python. 2. "Pattern Recognition and Machine Learning" by Christopher M. Bishop o Theoretical foundation of ML 3. "Machine Learning: A Probabilistic Perspective" by Kevin P . Murphy o Deep and rigorous, focuses on probabilistic models. GenAI and Agentic AI - Prof Durga Toshniwal [page 26] Books Deep Learning 4. "Deep Learning" by Ian Goodfellow, Yoshua Bengio, and Aaron Courville o The covers theory in depth with math-heavy content. 5. "Deep Learning with Python" by François Chollet o It's hands-on 6. "Neural Networks and Deep Learning" by Michael Nielsen o Theory GenAI and Agentic AI - Prof Durga Toshniwal