DBSCAN (Density-Based Spatial Clustering of Applications with Noise) là một t...sweetieDL
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) là một thuật toán phân cụm dữ liệu không giám sát được sử dụng nhiều trong lĩnh vực
This document discusses the concept of data in data mining. It defines data as a collection of objects and their attributes. Attributes describe objects and can take on attribute values. Attributes can be nominal, ordinal, interval or ratio depending on their properties. Datasets can consist of records, documents, transactions or graphs. The document also discusses data quality issues like noise, outliers, missing values and duplicates. Finally, it covers preprocessing techniques like aggregation, sampling, dimensionality reduction and discretization.
This document defines key concepts related to data in data mining. It discusses what data is, the different types of attributes and attribute values, different data types including nominal, ordinal, interval and ratio, and examples of different data sets such as records, documents, transactions and graphs. It also covers topics such as data quality issues including noise, outliers, missing values and duplicates.
This document provides an overview of different types of data that can be analyzed using data mining and machine learning techniques. It discusses record data, data matrices, document data, transaction data, graph data, ordered data, and more. It also covers important data quality issues like noise, outliers, missing values, and duplicate data. Common data preprocessing techniques are explained such as aggregation, sampling, dimensionality reduction, feature selection and creation, and attribute transformation. Finally, measures of similarity and dissimilarity between data objects are introduced, including Euclidean distance and Minkowski distance.
Date: September 11, 2017
Course: UiS DAT630 - Web Search and Data Mining (fall 2017) (https://github.com/kbalog/uis-dat630-fall2017)
Presentation based on resources from the 2016 edition of the course (https://github.com/kbalog/uis-dat630-fall2016) and the resources shared by the authors of the book used through the course (https://www-users.cs.umn.edu/~kumar001/dmbook/index.php).
Please cite, link to or credit this presentation when using it or part of it in your work.
This document provides an overview of key concepts related to data and data preprocessing. It defines data as a collection of objects and their attributes. Attributes can be nominal, ordinal, interval, or ratio. Data can take the form of records, graphs, ordered sequences, or other types. The document discusses attribute values, data quality issues like noise, outliers, and missing values. It also covers common preprocessing techniques like aggregation, sampling, dimensionality reduction, feature selection and creation, and discretization. Finally, it introduces concepts of similarity and dissimilarity measures between data objects.
The document provides an overview of data mining, including:
1) It defines data mining as the process of extracting patterns from large datasets that are valid, novel, useful and understandable.
2) It discusses some of the challenges of data mining like dealing with noise and missing data and not overfitting models.
3) It outlines several common data mining tasks like classification, clustering, association rule mining and sequential pattern mining.
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) là một t...sweetieDL
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) là một thuật toán phân cụm dữ liệu không giám sát được sử dụng nhiều trong lĩnh vực
This document discusses the concept of data in data mining. It defines data as a collection of objects and their attributes. Attributes describe objects and can take on attribute values. Attributes can be nominal, ordinal, interval or ratio depending on their properties. Datasets can consist of records, documents, transactions or graphs. The document also discusses data quality issues like noise, outliers, missing values and duplicates. Finally, it covers preprocessing techniques like aggregation, sampling, dimensionality reduction and discretization.
This document defines key concepts related to data in data mining. It discusses what data is, the different types of attributes and attribute values, different data types including nominal, ordinal, interval and ratio, and examples of different data sets such as records, documents, transactions and graphs. It also covers topics such as data quality issues including noise, outliers, missing values and duplicates.
This document provides an overview of different types of data that can be analyzed using data mining and machine learning techniques. It discusses record data, data matrices, document data, transaction data, graph data, ordered data, and more. It also covers important data quality issues like noise, outliers, missing values, and duplicate data. Common data preprocessing techniques are explained such as aggregation, sampling, dimensionality reduction, feature selection and creation, and attribute transformation. Finally, measures of similarity and dissimilarity between data objects are introduced, including Euclidean distance and Minkowski distance.
Date: September 11, 2017
Course: UiS DAT630 - Web Search and Data Mining (fall 2017) (https://github.com/kbalog/uis-dat630-fall2017)
Presentation based on resources from the 2016 edition of the course (https://github.com/kbalog/uis-dat630-fall2016) and the resources shared by the authors of the book used through the course (https://www-users.cs.umn.edu/~kumar001/dmbook/index.php).
Please cite, link to or credit this presentation when using it or part of it in your work.
This document provides an overview of key concepts related to data and data preprocessing. It defines data as a collection of objects and their attributes. Attributes can be nominal, ordinal, interval, or ratio. Data can take the form of records, graphs, ordered sequences, or other types. The document discusses attribute values, data quality issues like noise, outliers, and missing values. It also covers common preprocessing techniques like aggregation, sampling, dimensionality reduction, feature selection and creation, and discretization. Finally, it introduces concepts of similarity and dissimilarity measures between data objects.
The document provides an overview of data mining, including:
1) It defines data mining as the process of extracting patterns from large datasets that are valid, novel, useful and understandable.
2) It discusses some of the challenges of data mining like dealing with noise and missing data and not overfitting models.
3) It outlines several common data mining tasks like classification, clustering, association rule mining and sequential pattern mining.
Data Mining DataLecture Notes for Chapter 2IntroducOllieShoresna
Data Mining: Data
Lecture Notes for Chapter 2
Introduction to Data Mining
by
Tan, Steinbach, Kumar
What is Data?Collection of data objects and their attributes
An attribute is a property or characteristic of an objectExamples: eye color of a person, temperature, etc.Attribute is also known as variable, field, characteristic, or featureA collection of attributes describe an objectObject is also known as record, point, case, sample, entity, or instance
Attributes
Objects
Attribute ValuesAttribute values are numbers or symbols assigned to an attribute
Distinction between attributes and attribute valuesSame attribute can be mapped to different attribute values Example: height can be measured in feet or meters
Different attributes can be mapped to the same set of values Example: Attribute values for ID and age are integers But properties of attribute values can be different
ID has no limit but age has a maximum and minimum value
Types of Attributes There are different types of attributesNominalExamples: ID numbers, eye color, zip codesOrdinalExamples: rankings (e.g., taste of potato chips on a scale from 1-10), grades, height in {tall, medium, short}IntervalExamples: calendar dates, temperatures in Celsius or Fahrenheit.RatioExamples: temperature in Kelvin, length, time, counts
Properties of Attribute Values The type of an attribute depends on which of the following properties it possesses:Distinctness: = Order: < > Addition: + - Multiplication: * /
Nominal attribute: distinctnessOrdinal attribute: distinctness & orderInterval attribute: distinctness, order & additionRatio attribute: all 4 properties
Attribute Type
Description
Examples
Operations
Nominal
The values of a nominal attribute are just different names, i.e., nominal attributes provide only enough information to distinguish one object from another. (=, )
zip codes, employee ID numbers, eye color, sex: {male, female}
mode, entropy, contingency correlation, 2 test
Ordinal
The values of an ordinal attribute provide enough information to order objects. (<, >)
hardness of minerals, {good, better, best},
grades, street numbers
median, percentiles, rank correlation, run tests, sign tests
Interval
For interval attributes, the differences between values are meaningful, i.e., a unit of measurement exists.
(+, - )
calendar dates, temperature in Celsius or Fahrenheit
mean, standard deviation, Pearson's correlation, t and F tests
Ratio
For ratio variables, both differences and ratios are meaningful. (*, /)
temperature in Kelvin, monetary quantities, counts, age, mass, length, electrical current
geometric mean, harmonic mean, percent variation
Attribute Level
Transformation
Comments
Nominal
Any permutation of values
If all employee ID numbers were reassigned, would it make any difference?
Ordinal
An order preserving change of values, i.e.,
new_value = f(old_value)
where f is a monotonic function.
An attribut ...
This document summarizes key concepts about data that were covered in a lecture. It discusses the definition of data as a collection of objects and their attributes. It describes different types of attributes and data, including record data, document data, and transaction data. It also covers important characteristics of data like dimensionality and size. Finally, it discusses various data preprocessing techniques such as sampling, discretization, and feature selection.
Data mining Basics and complete description Sulman Ahmed
This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results
Data Mining DataLecture Notes for Chapter 2Introduc.docxwhittemorelucilla
Data Mining: Data
Lecture Notes for Chapter 2
Introduction to Data Mining
by
Tan, Steinbach, Kumar
What is Data?Collection of data objects and their attributes
An attribute is a property or characteristic of an objectExamples: eye color of a person, temperature, etc.Attribute is also known as variable, field, characteristic, or featureA collection of attributes describe an objectObject is also known as record, point, case, sample, entity, or instance
Attributes
Objects
Attribute ValuesAttribute values are numbers or symbols assigned to an attribute
Distinction between attributes and attribute valuesSame attribute can be mapped to different attribute values Example: height can be measured in feet or meters
Different attributes can be mapped to the same set of values Example: Attribute values for ID and age are integers But properties of attribute values can be different
ID has no limit but age has a maximum and minimum value
Measurement of Length The way you measure an attribute is somewhat may not match the attributes properties.
Types of Attributes There are different types of attributesNominalExamples: ID numbers, eye color, zip codesOrdinalExamples: rankings (e.g., taste of potato chips on a scale from 1-10), grades, height in {tall, medium, short}IntervalExamples: calendar dates, temperatures in Celsius or Fahrenheit.RatioExamples: temperature in Kelvin, length, time, counts
Properties of Attribute Values The type of an attribute depends on which of the following properties it possesses:Distinctness: = Order: < > Addition: + - Multiplication: * /
Nominal attribute: distinctnessOrdinal attribute: distinctness & orderInterval attribute: distinctness, order & additionRatio attribute: all 4 properties
Attribute Type
Description
Examples
Operations
Nominal
The values of a nominal attribute are just different names, i.e., nominal attributes provide only enough information to distinguish one object from another. (=, )
zip codes, employee ID numbers, eye color, sex: {male, female}
mode, entropy, contingency correlation, 2 test
Ordinal
The values of an ordinal attribute provide enough information to order objects. (<, >)
hardness of minerals, {good, better, best},
grades, street numbers
median, percentiles, rank correlation, run tests, sign tests
Interval
For interval attributes, the differences between values are meaningful, i.e., a unit of measurement exists.
(+, - )
calendar dates, temperature in Celsius or Fahrenheit
mean, standard deviation, Pearson's correlation, t and F tests
Ratio
For ratio variables, both differences and ratios are meaningful. (*, /)
temperature in Kelvin, monetary quantities, counts, age, mass, length, electrical current
geometric mean, harmonic mean, percent variation
Attribute Level
Transformation
Comments
Nominal
Any permutation of values
If all employee ID numbers were reassigned, would it make any difference?
Ordinal
An .
The document introduces data preprocessing techniques for data mining. It discusses why data preprocessing is important due to real-world data often being dirty, incomplete, noisy, inconsistent or duplicate. It then describes common data types and quality issues like missing values, noise, outliers and duplicates. The major tasks of data preprocessing are outlined as data cleaning, integration, transformation and reduction. Specific techniques for handling missing values, noise, outliers and duplicates are also summarized.
This document discusses data objects, attributes, and data types. It begins by defining a data object as an entity with attributes that describe its characteristics. Attributes can be nominal, ordinal, interval, ratio, discrete, or continuous. The document then discusses different types of data structures like records, graphs, ordered data, and more. It also covers measuring similarity and dissimilarity between data objects using distances and properties of good distance measures. In summary, the document provides an overview of fundamental concepts in data including objects, attributes, data types, structures, and measuring similarity.
This document provides an introduction to data exploration techniques. It discusses how data exploration helps with tool selection and recognizing patterns. Key techniques covered include summary statistics, visualization, and online analytical processing (OLAP). Visualization techniques like histograms, scatter plots, and parallel coordinates are demonstrated on the Iris dataset. OLAP operations like slicing, dicing, roll-up and drill-down are explained using examples. The overall goal of data exploration is to better understand a dataset's characteristics before applying more advanced analysis.
Data preprocessing involves cleaning, transforming, and reducing raw data to prepare it for modeling and analysis. The document discusses several key aspects of data preprocessing including:
- Why data preprocessing is important to improve data quality and ensure accurate analysis results.
- Common data issues like missing values, noise, inconsistencies that require cleaning. Techniques for cleaning include filling in missing data, identifying and handling outliers, and resolving inconsistencies.
- Methods for reducing data like binning, regression, clustering, sampling to obtain a smaller yet representative version of the data.
- The major tasks in preprocessing like data cleaning, integration, transformation, reduction and discretization which are aimed at handling real-world data issues.
This document discusses data preprocessing techniques. It begins by explaining why preprocessing is important due to real-world data often being dirty, incomplete, noisy, or inconsistent. The main tasks of preprocessing are then outlined as data cleaning, integration, reduction, and transformation. Specific techniques for handling missing data, noisy data, and data integration are then described. Methods for data reduction through dimensionality reduction, numerosity reduction, and discretization are also summarized.
This document discusses different types of data attributes, including nominal, ordinal, interval, and ratio attributes. It also describes structured and unstructured data types, such as records, matrices, documents, transactions, graphs, and web data. Finally, it covers various data preprocessing techniques like aggregation, sampling, dimensionality reduction, feature selection and creation, and data transformation.
This document discusses data and attributes in data mining. It defines data as a collection of objects and their properties or attributes. Attributes can be nominal, ordinal, interval or ratio. The document describes different types of attributes and data sets, as well as important characteristics like dimensionality and sparsity. It also covers data quality issues, preprocessing techniques like aggregation, sampling and feature selection, and measures of similarity and dissimilarity between data objects.
Data modeling involves creating conceptual, logical, and physical data models of how entities are related in a database. The interview questions covered topics like different data modeling schemas (star vs snowflake), dimensions, facts, surrogate keys, normalization forms, and data warehousing concepts. The candidate discussed their experience working on a data model for a healthcare insurance project that used a snowflake schema to allow multi-dimensional analysis across entities like subscribers, providers, claims, and plans. Common data modeling mistakes like over-normalization and lack of purpose were also listed.
Data preprocessing involves several key steps:
1) Data cleaning to fill in missing values, identify and remove outliers, and resolve inconsistencies
2) Data integration to combine multiple data sources and resolve conflicts and redundancies
3) Data reduction techniques like discretization, dimensionality reduction, and aggregation to obtain a reduced representation of the data for mining and analysis.
This document provides an overview of data preprocessing techniques. It discusses why preprocessing is important, including that real-world data is often dirty, incomplete, noisy, and inconsistent. The major tasks of preprocessing are described as data cleaning, integration, transformation, reduction, and discretization. Specific techniques for handling missing data, noisy data, and reducing redundancy are also summarized.
The document discusses different types of data sets and various concepts related to data preprocessing. It describes common data types like records, relational data, and transaction data. It also defines key concepts in data preprocessing like data objects, attributes, handling missing/noisy data, data integration, reduction, transformation and discretization. The goal of these techniques is to clean, integrate and prepare raw data for analysis.
Descriptive statistics and exploratory data analysis (EDA) are used to discover patterns and insights from data without making assumptions about probabilistic models. EDA involves summarizing a dataset's properties through measures of central tendency like mean, median and mode as well as dispersion through range, variance, standard deviation, and quantiles. Visualizing univariate data distributions through histograms, boxplots and scatterplots can reveal outliers and whether data is symmetric or skewed. Correlation analysis examines relationships between variables. Together, these techniques provide an overall understanding of a dataset to inform further analysis and modeling.
This document provides an overview of getting to know data through data mining and data warehousing. It defines key concepts like data objects, attributes, attribute types, data sets, and data quality issues. Data objects are described by a set of attributes, which can be qualitative like nominal or ordinal, or quantitative like interval or ratio scaled. Different types of data sets are discussed including data matrices, documents, transactions, graphs, and ordered data. Common data quality problems addressed are noise, outliers, missing values, and duplicate data. Methods for measuring similarity and dissimilarity between data objects are also introduced.
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...sameer shah
"Join us for STATATHON, a dynamic 2-day event dedicated to exploring statistical knowledge and its real-world applications. From theory to practice, participants engage in intensive learning sessions, workshops, and challenges, fostering a deeper understanding of statistical methodologies and their significance in various fields."
Data Mining DataLecture Notes for Chapter 2IntroducOllieShoresna
Data Mining: Data
Lecture Notes for Chapter 2
Introduction to Data Mining
by
Tan, Steinbach, Kumar
What is Data?Collection of data objects and their attributes
An attribute is a property or characteristic of an objectExamples: eye color of a person, temperature, etc.Attribute is also known as variable, field, characteristic, or featureA collection of attributes describe an objectObject is also known as record, point, case, sample, entity, or instance
Attributes
Objects
Attribute ValuesAttribute values are numbers or symbols assigned to an attribute
Distinction between attributes and attribute valuesSame attribute can be mapped to different attribute values Example: height can be measured in feet or meters
Different attributes can be mapped to the same set of values Example: Attribute values for ID and age are integers But properties of attribute values can be different
ID has no limit but age has a maximum and minimum value
Types of Attributes There are different types of attributesNominalExamples: ID numbers, eye color, zip codesOrdinalExamples: rankings (e.g., taste of potato chips on a scale from 1-10), grades, height in {tall, medium, short}IntervalExamples: calendar dates, temperatures in Celsius or Fahrenheit.RatioExamples: temperature in Kelvin, length, time, counts
Properties of Attribute Values The type of an attribute depends on which of the following properties it possesses:Distinctness: = Order: < > Addition: + - Multiplication: * /
Nominal attribute: distinctnessOrdinal attribute: distinctness & orderInterval attribute: distinctness, order & additionRatio attribute: all 4 properties
Attribute Type
Description
Examples
Operations
Nominal
The values of a nominal attribute are just different names, i.e., nominal attributes provide only enough information to distinguish one object from another. (=, )
zip codes, employee ID numbers, eye color, sex: {male, female}
mode, entropy, contingency correlation, 2 test
Ordinal
The values of an ordinal attribute provide enough information to order objects. (<, >)
hardness of minerals, {good, better, best},
grades, street numbers
median, percentiles, rank correlation, run tests, sign tests
Interval
For interval attributes, the differences between values are meaningful, i.e., a unit of measurement exists.
(+, - )
calendar dates, temperature in Celsius or Fahrenheit
mean, standard deviation, Pearson's correlation, t and F tests
Ratio
For ratio variables, both differences and ratios are meaningful. (*, /)
temperature in Kelvin, monetary quantities, counts, age, mass, length, electrical current
geometric mean, harmonic mean, percent variation
Attribute Level
Transformation
Comments
Nominal
Any permutation of values
If all employee ID numbers were reassigned, would it make any difference?
Ordinal
An order preserving change of values, i.e.,
new_value = f(old_value)
where f is a monotonic function.
An attribut ...
This document summarizes key concepts about data that were covered in a lecture. It discusses the definition of data as a collection of objects and their attributes. It describes different types of attributes and data, including record data, document data, and transaction data. It also covers important characteristics of data like dimensionality and size. Finally, it discusses various data preprocessing techniques such as sampling, discretization, and feature selection.
Data mining Basics and complete description Sulman Ahmed
This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results.This course is all about the data mining techniques and how we mine the data and get optimize results
Data Mining DataLecture Notes for Chapter 2Introduc.docxwhittemorelucilla
Data Mining: Data
Lecture Notes for Chapter 2
Introduction to Data Mining
by
Tan, Steinbach, Kumar
What is Data?Collection of data objects and their attributes
An attribute is a property or characteristic of an objectExamples: eye color of a person, temperature, etc.Attribute is also known as variable, field, characteristic, or featureA collection of attributes describe an objectObject is also known as record, point, case, sample, entity, or instance
Attributes
Objects
Attribute ValuesAttribute values are numbers or symbols assigned to an attribute
Distinction between attributes and attribute valuesSame attribute can be mapped to different attribute values Example: height can be measured in feet or meters
Different attributes can be mapped to the same set of values Example: Attribute values for ID and age are integers But properties of attribute values can be different
ID has no limit but age has a maximum and minimum value
Measurement of Length The way you measure an attribute is somewhat may not match the attributes properties.
Types of Attributes There are different types of attributesNominalExamples: ID numbers, eye color, zip codesOrdinalExamples: rankings (e.g., taste of potato chips on a scale from 1-10), grades, height in {tall, medium, short}IntervalExamples: calendar dates, temperatures in Celsius or Fahrenheit.RatioExamples: temperature in Kelvin, length, time, counts
Properties of Attribute Values The type of an attribute depends on which of the following properties it possesses:Distinctness: = Order: < > Addition: + - Multiplication: * /
Nominal attribute: distinctnessOrdinal attribute: distinctness & orderInterval attribute: distinctness, order & additionRatio attribute: all 4 properties
Attribute Type
Description
Examples
Operations
Nominal
The values of a nominal attribute are just different names, i.e., nominal attributes provide only enough information to distinguish one object from another. (=, )
zip codes, employee ID numbers, eye color, sex: {male, female}
mode, entropy, contingency correlation, 2 test
Ordinal
The values of an ordinal attribute provide enough information to order objects. (<, >)
hardness of minerals, {good, better, best},
grades, street numbers
median, percentiles, rank correlation, run tests, sign tests
Interval
For interval attributes, the differences between values are meaningful, i.e., a unit of measurement exists.
(+, - )
calendar dates, temperature in Celsius or Fahrenheit
mean, standard deviation, Pearson's correlation, t and F tests
Ratio
For ratio variables, both differences and ratios are meaningful. (*, /)
temperature in Kelvin, monetary quantities, counts, age, mass, length, electrical current
geometric mean, harmonic mean, percent variation
Attribute Level
Transformation
Comments
Nominal
Any permutation of values
If all employee ID numbers were reassigned, would it make any difference?
Ordinal
An .
The document introduces data preprocessing techniques for data mining. It discusses why data preprocessing is important due to real-world data often being dirty, incomplete, noisy, inconsistent or duplicate. It then describes common data types and quality issues like missing values, noise, outliers and duplicates. The major tasks of data preprocessing are outlined as data cleaning, integration, transformation and reduction. Specific techniques for handling missing values, noise, outliers and duplicates are also summarized.
This document discusses data objects, attributes, and data types. It begins by defining a data object as an entity with attributes that describe its characteristics. Attributes can be nominal, ordinal, interval, ratio, discrete, or continuous. The document then discusses different types of data structures like records, graphs, ordered data, and more. It also covers measuring similarity and dissimilarity between data objects using distances and properties of good distance measures. In summary, the document provides an overview of fundamental concepts in data including objects, attributes, data types, structures, and measuring similarity.
This document provides an introduction to data exploration techniques. It discusses how data exploration helps with tool selection and recognizing patterns. Key techniques covered include summary statistics, visualization, and online analytical processing (OLAP). Visualization techniques like histograms, scatter plots, and parallel coordinates are demonstrated on the Iris dataset. OLAP operations like slicing, dicing, roll-up and drill-down are explained using examples. The overall goal of data exploration is to better understand a dataset's characteristics before applying more advanced analysis.
Data preprocessing involves cleaning, transforming, and reducing raw data to prepare it for modeling and analysis. The document discusses several key aspects of data preprocessing including:
- Why data preprocessing is important to improve data quality and ensure accurate analysis results.
- Common data issues like missing values, noise, inconsistencies that require cleaning. Techniques for cleaning include filling in missing data, identifying and handling outliers, and resolving inconsistencies.
- Methods for reducing data like binning, regression, clustering, sampling to obtain a smaller yet representative version of the data.
- The major tasks in preprocessing like data cleaning, integration, transformation, reduction and discretization which are aimed at handling real-world data issues.
This document discusses data preprocessing techniques. It begins by explaining why preprocessing is important due to real-world data often being dirty, incomplete, noisy, or inconsistent. The main tasks of preprocessing are then outlined as data cleaning, integration, reduction, and transformation. Specific techniques for handling missing data, noisy data, and data integration are then described. Methods for data reduction through dimensionality reduction, numerosity reduction, and discretization are also summarized.
This document discusses different types of data attributes, including nominal, ordinal, interval, and ratio attributes. It also describes structured and unstructured data types, such as records, matrices, documents, transactions, graphs, and web data. Finally, it covers various data preprocessing techniques like aggregation, sampling, dimensionality reduction, feature selection and creation, and data transformation.
This document discusses data and attributes in data mining. It defines data as a collection of objects and their properties or attributes. Attributes can be nominal, ordinal, interval or ratio. The document describes different types of attributes and data sets, as well as important characteristics like dimensionality and sparsity. It also covers data quality issues, preprocessing techniques like aggregation, sampling and feature selection, and measures of similarity and dissimilarity between data objects.
Data modeling involves creating conceptual, logical, and physical data models of how entities are related in a database. The interview questions covered topics like different data modeling schemas (star vs snowflake), dimensions, facts, surrogate keys, normalization forms, and data warehousing concepts. The candidate discussed their experience working on a data model for a healthcare insurance project that used a snowflake schema to allow multi-dimensional analysis across entities like subscribers, providers, claims, and plans. Common data modeling mistakes like over-normalization and lack of purpose were also listed.
Data preprocessing involves several key steps:
1) Data cleaning to fill in missing values, identify and remove outliers, and resolve inconsistencies
2) Data integration to combine multiple data sources and resolve conflicts and redundancies
3) Data reduction techniques like discretization, dimensionality reduction, and aggregation to obtain a reduced representation of the data for mining and analysis.
This document provides an overview of data preprocessing techniques. It discusses why preprocessing is important, including that real-world data is often dirty, incomplete, noisy, and inconsistent. The major tasks of preprocessing are described as data cleaning, integration, transformation, reduction, and discretization. Specific techniques for handling missing data, noisy data, and reducing redundancy are also summarized.
The document discusses different types of data sets and various concepts related to data preprocessing. It describes common data types like records, relational data, and transaction data. It also defines key concepts in data preprocessing like data objects, attributes, handling missing/noisy data, data integration, reduction, transformation and discretization. The goal of these techniques is to clean, integrate and prepare raw data for analysis.
Descriptive statistics and exploratory data analysis (EDA) are used to discover patterns and insights from data without making assumptions about probabilistic models. EDA involves summarizing a dataset's properties through measures of central tendency like mean, median and mode as well as dispersion through range, variance, standard deviation, and quantiles. Visualizing univariate data distributions through histograms, boxplots and scatterplots can reveal outliers and whether data is symmetric or skewed. Correlation analysis examines relationships between variables. Together, these techniques provide an overall understanding of a dataset to inform further analysis and modeling.
This document provides an overview of getting to know data through data mining and data warehousing. It defines key concepts like data objects, attributes, attribute types, data sets, and data quality issues. Data objects are described by a set of attributes, which can be qualitative like nominal or ordinal, or quantitative like interval or ratio scaled. Different types of data sets are discussed including data matrices, documents, transactions, graphs, and ordered data. Common data quality problems addressed are noise, outliers, missing values, and duplicate data. Methods for measuring similarity and dissimilarity between data objects are also introduced.
Ähnlich wie Preprocessing techniques in data mining with solve examples (20)
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...sameer shah
"Join us for STATATHON, a dynamic 2-day event dedicated to exploring statistical knowledge and its real-world applications. From theory to practice, participants engage in intensive learning sessions, workshops, and challenges, fostering a deeper understanding of statistical methodologies and their significance in various fields."
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeWalaa Eldin Moustafa
Dynamic policy enforcement is becoming an increasingly important topic in today’s world where data privacy and compliance is a top priority for companies, individuals, and regulators alike. In these slides, we discuss how LinkedIn implements a powerful dynamic policy enforcement engine, called ViewShift, and integrates it within its data lake. We show the query engine architecture and how catalog implementations can automatically route table resolutions to compliance-enforcing SQL views. Such views have a set of very interesting properties: (1) They are auto-generated from declarative data annotations. (2) They respect user-level consent and preferences (3) They are context-aware, encoding a different set of transformations for different use cases (4) They are portable; while the SQL logic is only implemented in one SQL dialect, it is accessible in all engines.
#SQL #Views #Privacy #Compliance #DataLake
Codeless Generative AI Pipelines
(GenAI with Milvus)
https://ml.dssconf.pl/user.html#!/lecture/DSSML24-041a/rate
Discover the potential of real-time streaming in the context of GenAI as we delve into the intricacies of Apache NiFi and its capabilities. Learn how this tool can significantly simplify the data engineering workflow for GenAI applications, allowing you to focus on the creative aspects rather than the technical complexities. I will guide you through practical examples and use cases, showing the impact of automation on prompt building. From data ingestion to transformation and delivery, witness how Apache NiFi streamlines the entire pipeline, ensuring a smooth and hassle-free experience.
Timothy Spann
https://www.youtube.com/@FLaNK-Stack
https://medium.com/@tspann
https://www.datainmotion.dev/
milvus, unstructured data, vector database, zilliz, cloud, vectors, python, deep learning, generative ai, genai, nifi, kafka, flink, streaming, iot, edge
Preprocessing techniques in data mining with solve examples
1. 01/27/2021 1
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Data Mining: Data
Lecture Notes for Chapter 2
Introduction to Data Mining , 2nd Edition
by
Tan, Steinbach, Kumar
2. 01/27/2021 2
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Outline
Attributes and Objects
Types of Data
Data Quality
Similarity and Distance
Data Preprocessing
3. 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
Attributes
Objects
4. 01/27/2021 4
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Attribute Values
Attribute values are numbers or symbols
assigned to an attribute for a particular object
Distinction between attributes and attribute values
– Same attribute can be mapped to different attribute
values
Example: height can be measured in feet or meters
– Different attributes can be mapped to the same set of
values
Example: Attribute values for ID and age are integers
– But properties of attribute can be different than the
properties of the values used to represent the
attribute
5. Measurement of Length
The way you measure an attribute may not match the
attributes properties.
This scale
preserves
the ordering
and additvity
properties of
length.
This scale
preserves
only the
ordering
property of
length.
6. 01/27/2021 6
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Types of Attributes
There are different types of attributes
– Nominal
Examples: ID numbers, eye color, zip codes
– Ordinal
Examples: rankings (e.g., taste of potato chips on a
scale from 1-10), grades, height {tall, medium, short}
– Interval
Examples: calendar dates, temperatures in Celsius or
Fahrenheit.
– Ratio
Examples: temperature in Kelvin, length, counts,
elapsed time (e.g., time to run a race)
7. 01/27/2021 7
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Properties of Attribute Values
The type of an attribute depends on which of the
following properties/operations it possesses:
– Distinctness: =
– Order: < >
– Differences are + -
meaningful :
– Ratios are * /
meaningful
– Nominal attribute: distinctness
– Ordinal attribute: distinctness & order
– Interval attribute: distinctness, order & meaningful
differences
– Ratio attribute: all 4 properties/operations
8. 01/27/2021 8
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Difference Between Ratio and Interval
Is it physically meaningful to say that a
temperature of 10 ° is twice that of 5° on
– the Celsius scale?
– the Fahrenheit scale?
– the Kelvin scale?
Consider measuring the height above average
– If Bill’s height is three inches above average and
Bob’s height is six inches above average, then would
we say that Bob is twice as tall as Bill?
– Is this situation analogous to that of temperature?
11. 01/27/2021 11
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Discrete and Continuous Attributes
Discrete Attribute
– Has only a finite or countably infinite 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.
– Practically, real values can only be measured and
represented using a finite number of digits.
– Continuous attributes are typically represented as floating-
point variables.
12. 01/27/2021 12
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Asymmetric Attributes
Only presence (a non-zero attribute value) is regarded as
important
Words present in documents
Items present in customer transactions
If we met a friend in the grocery store would we ever say
the following?
“I see our purchases are very similar since we didn’t buy most
of the same things.”
13. 01/27/2021 13
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Critiques of the attribute categorization
Incomplete
– Asymmetric binary
– Cyclical
– Multivariate
– Partially ordered
– Partial membership
– Relationships between the data
Real data is approximate and noisy
– This can complicate recognition of the proper attribute type
– Treating one attribute type as another may be approximately
correct
14. 01/27/2021 14
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Key Messages for Attribute Types
The types of operations you choose should be
“meaningful” for the type of data you have
– Distinctness, order, meaningful intervals, and meaningful
ratios are only four (among many possible) properties of
data
– The data type you see – often numbers or strings – may not
capture all the properties or may suggest properties that are
not present
– Analysis may depend on these other properties of the data
Many statistical analyses depend only on the distribution
– In the end, what is meaningful can be specific to domain
15. 01/27/2021 15
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Important Characteristics of Data
– Dimensionality (number of attributes)
High dimensional data brings a number of challenges
– Sparsity
Only presence counts
– Resolution
Patterns depend on the scale
– Size
Type of analysis may depend on size of data
16. 01/27/2021 16
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Types of data sets
Record
– Data Matrix
– Document Data
– Transaction Data
Graph
– World Wide Web
– Molecular Structures
Ordered
– Spatial Data
– Temporal Data
– Sequential Data
– Genetic Sequence Data
17. 01/27/2021 17
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Record Data
Data that consists of a collection of records, each
of which consists of a fixed set of attributes
18. 01/27/2021 18
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Data Matrix
If data objects have the same fixed set of numeric
attributes, then the data objects can be thought of as
points in a multi-dimensional space, where each
dimension represents a distinct attribute
Such a data set can be represented by an m by n matrix,
where there are m rows, one for each object, and n
columns, one for each attribute
19. 01/27/2021 19
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Document Data
Each document becomes a ‘term’ vector
– Each term is a component (attribute) of the vector
– The value of each component is the number of times
the corresponding term occurs in the document.
20. 01/27/2021 20
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Transaction Data
A special type of data, where
– Each transaction involves a set of items.
– For example, consider a grocery store. The set of products
purchased by a customer during one shopping trip constitute a
transaction, while the individual products that were purchased
are the items.
– Can represent transaction data as record data
21. 01/27/2021 21
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Graph Data
Examples: Generic graph, a molecule, and webpages
Benzene Molecule: C6H6
22. 01/27/2021 22
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Ordered Data
Sequences of transactions
An element of
the sequence
Items/Events
23. 01/27/2021 23
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Ordered Data
Genomic sequence data
24. 01/27/2021 24
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Ordered Data
Spatio-Temporal Data
Average Monthly
Temperature of
land and ocean
25. 01/27/2021 25
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Data Quality
Poor data quality negatively affects many data processing
efforts
Data mining example: a classification model for detecting
people who are loan risks is built using poor data
– Some credit-worthy candidates are denied loans
– More loans are given to individuals that default
26. 01/27/2021 26
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Data Quality …
What kinds of data quality problems?
How can we detect problems with the data?
What can we do about these problems?
Examples of data quality problems:
– Noise and outliers
– Wrong data
– Fake data
– Missing values
– Duplicate data
27. 01/27/2021 27
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Noise
For objects, noise is an extraneous object
For attributes, noise refers to modification of original values
– Examples: distortion of a person’s voice when talking on a poor phone
and “snow” on television screen
– The figures below show two sine waves of the same magnitude and
different frequencies, the waves combined, and the two sine waves with
random noise
The magnitude and shape of the original signal is distorted
28. 01/27/2021 28
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Outliers are data objects with characteristics that
are considerably different than most of the other
data objects in the data set
– Case 1: Outliers are
noise that interferes
with data analysis
– Case 2: Outliers are
the goal of our analysis
Credit card fraud
Intrusion detection
Causes?
Outliers
29. 01/27/2021 29
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Missing Values
Reasons for missing values
– Information is not collected
(e.g., people decline to give their age and weight)
– Attributes may not be applicable to all cases
(e.g., annual income is not applicable to children)
Handling missing values
– Eliminate data objects or variables
– Estimate missing values
Example: time series of temperature
Example: census results
– Ignore the missing value during analysis
30. 01/27/2021 30
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Duplicate Data
Data set may include data objects that are
duplicates, or almost duplicates of one another
– Major issue when merging data from heterogeneous
sources
Examples:
– Same person with multiple email addresses
Data cleaning
– Process of dealing with duplicate data issues
When should duplicate data not be removed?
31. 01/27/2021 31
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Similarity and Dissimilarity Measures
Similarity measure
– Numerical measure of how alike two data objects are.
– Is higher when objects are more alike.
– Often falls in the range [0,1]
Dissimilarity measure
– 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
32. 01/27/2021 32
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Similarity/Dissimilarity for Simple Attributes
The following table shows the similarity and dissimilarity
between two objects, x and y, with respect to a single, simple
attribute.
33. 01/27/2021 33
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Euclidean Distance
Euclidean Distance
where n is the number of dimensions (attributes) and
xk and yk are, respectively, the kth attributes
(components) or data objects x and y.
Standardization is necessary, if scales differ.
34. 01/27/2021 34
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Euclidean Distance
Distance Matrix
35. 01/27/2021 35
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Minkowski Distance
Minkowski Distance is a generalization of Euclidean
Distance
Where r is a parameter, n is the number of dimensions
(attributes) and xk and yk are, respectively, the kth
attributes (components) or data objects x and y.
36. 01/27/2021 36
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Minkowski Distance: Examples
r = 1. City block (Manhattan, taxicab, L1 norm) distance.
– A common example of this for binary vectors is the
Hamming distance, which is just the number of bits that are
different between two binary vectors
r = 2. Euclidean distance
r . “supremum” (Lmax norm, L norm) distance.
– This is the maximum difference between any component of
the vectors
Do not confuse r with n, i.e., all these distances are
defined for all numbers of dimensions.
37. 01/27/2021 37
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Example
1. r=1 (City block distance):
1. Also known as Manhattan distance, taxicab distance, or L1 norm.
2. Formula: ∣D(P,Q)=∑i=1n∣pi−qi∣
3. Example: Consider two points in a 2D space, (3,5)P(3,5) and (1,2)Q(1,2).
The Manhattan distance would be ∣3−1∣+∣5−2∣=5∣3−1∣+∣5−2∣=5.
2. r=2 (Euclidean distance):
1. Formula:D(P,Q)=∑i=1n(pi−qi)2
2. Example: Using the same points P(3,5) and Q(1,2), the Euclidean
distance would be (3−1)2+(5−2)2=10(3−1)2+(5−2)2=10.
3. r→∞ (Supremum distance):
1. Also known as Lmax norm or L∞ norm.
2. Formula: D(P,Q)=maxi∣pi−qi∣
3. Example: For the points P(3,5) and Q(1,2), the Supremum distance
would be max(∣3−1∣,∣5−2∣)=3max(∣3−1∣,∣5−2∣)=3, considering the
maximum absolute difference along any coordinate.
38. 01/27/2021 38
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Minkowski Distance
Distance Matrix
39. 01/27/2021 39
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Mahalanobis Distance
For red points, the Euclidean distance is 14.7, Mahalanobis distance is 6.
is the covariance matrix
𝐦𝐚𝐡𝐚𝐥𝐚𝐧𝐨𝐛𝐢𝐬 𝐱, 𝐲 = ((𝐱 − 𝐲)𝑇 Ʃ−1(𝐱 − 𝐲))-0.5
40. 01/27/2021 40
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Mahalanobis Distance
Covariance
Matrix:
A: (0.5, 0.5)
B: (0, 1)
C: (1.5, 1.5)
Mahal(A,B) = 5
Mahal(A,C) = 4
B
A
C
41. 01/27/2021 41
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Common Properties of a Distance
Distances, such as the Euclidean distance,
have some well known properties.
1. d(x, y) 0 for all x and y and d(x, y) = 0 if and only
if x = y.
2. d(x, y) = d(y, x) for all x and y. (Symmetry)
3. d(x, z) d(x, y) + d(y, z) for all points x, y, and z.
(Triangle Inequality)
where d(x, y) is the distance (dissimilarity) between
points (data objects), x and y.
A distance that satisfies these properties is a
metric
42. 01/27/2021 42
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Common Properties of a Similarity
Similarities, also have some well known
properties.
1. s(x, y) = 1 (or maximum similarity) only if x = y.
(does not always hold, e.g., cosine)
2. s(x, y) = s(y, x) for all x and y. (Symmetry)
where s(x, y) is the similarity between points (data
objects), x and y.
43. 01/27/2021 43
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Similarity Between Binary Vectors
Common situation is that objects, x and y, have only
binary attributes
Compute similarities using the following quantities
f01 = the number of attributes where x was 0 and y was 1
f10 = the number of attributes where x was 1 and y was 0
f00 = the number of attributes where x was 0 and y was 0
f11 = the number of attributes where x was 1 and y was 1
Simple Matching and Jaccard Coefficients
SMC = number of matches / number of attributes
= (f11 + f00) / (f01 + f10 + f11 + f00)
J = number of 11 matches / number of non-zero attributes
= (f11) / (f01 + f10 + f11)
44. 01/27/2021 44
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
SMC versus Jaccard: Example
x = 1 0 0 0 0 0 0 0 0 0
y = 0 0 0 0 0 0 1 0 0 1
f01 = 2 (the number of attributes where x was 0 and y was 1)
f10 = 1 (the number of attributes where x was 1 and y was 0)
f00 = 7 (the number of attributes where x was 0 and y was 0)
f11 = 0 (the number of attributes where x was 1 and y was 1)
SMC = (f11 + f00) / (f01 + f10 + f11 + f00)
= (0+7) / (2+1+0+7) = 0.7
J = (f11) / (f01 + f10 + f11) = 0 / (2 + 1 + 0) = 0
45. 01/27/2021 45
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Cosine Similarity
If d1 and d2 are two document vectors, then
cos( d1, d2 ) = <d1,d2> / ||d1|| ||d2|| ,
where <d1,d2> indicates inner product or vector dot
product of vectors, d1 and d2, and || d || is the length of
vector d.
Example:
d1 = 3 2 0 5 0 0 0 2 0 0
d2 = 1 0 0 0 0 0 0 1 0 2
<d1, d2> = 3*1 + 2*0 + 0*0 + 5*0 + 0*0 + 0*0 + 0*0 + 2*1 + 0*0 + 0*2 = 5
| d1 || = (3*3+2*2+0*0+5*5+0*0+0*0+0*0+2*2+0*0+0*0)0.5 = (42) 0.5 = 6.481
|| d2 || = (1*1+0*0+0*0+0*0+0*0+0*0+0*0+1*1+0*0+2*2) 0.5 = (6) 0.5 = 2.449
cos(d1, d2 ) = 0.3150
46. 01/27/2021 46
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Correlation measures the linear relationship
between objects
47. 01/27/2021 47
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Visually Evaluating Correlation
Scatter plots
showing the
similarity from
–1 to 1.
48. 01/27/2021 48
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Drawback of Correlation
x = (-3, -2, -1, 0, 1, 2, 3)
y = (9, 4, 1, 0, 1, 4, 9)
yi = xi
2
mean(x) = 0, mean(y) = 4
std(x) = 2.16, std(y) = 3.74
corr = (-3)(5)+(-2)(0)+(-1)(-3)+(0)(-4)+(1)(-3)+(2)(0)+3(5) / ( 6 * 2.16 * 3.74 )
= 0
49. 01/27/2021 49
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Correlation vs Cosine vs Euclidean Distance
Compare the three proximity measures according to their behavior under
variable transformation
– scaling: multiplication by a value
– translation: adding a constant
Consider the example
– x = (1, 2, 4, 3, 0, 0, 0), y = (1, 2, 3, 4, 0, 0, 0)
– ys = y * 2 (scaled version of y), yt = y + 5 (translated version)
Property Cosine Correlation Euclidean Distance
Invariant to scaling
(multiplication)
Yes Yes No
Invariant to translation
(addition)
No Yes No
Measure (x , y) (x , ys) (x , yt)
Cosine 0.9667 0.9667 0.7940
Correlation 0.9429 0.9429 0.9429
Euclidean Distance 1.4142 5.8310 14.2127
50. 01/27/2021 50
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Correlation vs cosine vs Euclidean distance
Choice of the right proximity measure depends on the domain
What is the correct choice of proximity measure for the
following situations?
– Comparing documents using the frequencies of words
Documents are considered similar if the word frequencies are similar
– Comparing the temperature in Celsius of two locations
Two locations are considered similar if the temperatures are similar in
magnitude
– Comparing two time series of temperature measured in Celsius
Two time series are considered similar if their “shape” is similar, i.e., they
vary in the same way over time, achieving minimums and maximums at
similar times, etc.
51. 01/27/2021 51
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Comparison of Proximity Measures
Domain of application
– Similarity measures tend to be specific to the type of
attribute and data
– Record data, images, graphs, sequences, 3D-protein
structure, etc. tend to have different measures
However, one can talk about various properties that
you would like a proximity measure to have
– Symmetry is a common one
– Tolerance to noise and outliers is another
– Ability to find more types of patterns?
– Many others possible
The measure must be applicable to the data and
produce results that agree with domain knowledge
52. 01/27/2021 52
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Information Based Measures
Information theory is a well-developed and
fundamental disciple with broad applications
Some similarity measures are based on
information theory
– Mutual information in various versions
– Maximal Information Coefficient (MIC) and related
measures
– General and can handle non-linear relationships
– Can be complicated and time intensive to compute
53. 01/27/2021 53
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Information and Probability
Information relates to possible outcomes of an event
– transmission of a message, flip of a coin, or measurement
of a piece of data
The more certain an outcome, the less information
that it contains and vice-versa
– For example, if a coin has two heads, then an outcome of
heads provides no information
– More quantitatively, the information is related the
probability of an outcome
The smaller the probability of an outcome, the more information it
provides and vice-versa
– Entropy is the commonly used measure
54. 01/27/2021 54
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Entropy
For
– a variable (event), X,
– with n possible values (outcomes), x1, x2 …, xn
– each outcome having probability, p1, p2 …, pn
– the entropy of X , H(X), is given by
𝐻 𝑋 = −
𝑖=1
𝑛
𝑝𝑖log2 𝑝𝑖
Entropy is between 0 and log2n and is measured in
bits
– Thus, entropy is a measure of how many bits it takes to
represent an observation of X on average
55. 01/27/2021 55
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Entropy Examples
For a coin with probability p of heads and
probability q = 1 – p of tails
𝐻 = −𝑝 log2 𝑝 − 𝑞 log2 𝑞
– For p= 0.5, q = 0.5 (fair coin) H = 1
– For p = 1 or q = 1, H = 0
What is the entropy of a fair four-sided die?
56. 01/27/2021 56
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Entropy for Sample Data: Example
Maximum entropy is log25 = 2.3219
Hair Color Count p -plog2p
Black 75 0.75 0.3113
Brown 15 0.15 0.4105
Blond 5 0.05 0.2161
Red 0 0.00 0
Other 5 0.05 0.2161
Total 100 1.0 1.1540
57. 01/27/2021 57
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Entropy for Sample Data
Suppose we have
– a number of observations (m) of some attribute, X,
e.g., the hair color of students in the class,
– where there are n different possible values
– And the number of observation in the ith category is mi
– Then, for this sample
𝐻 𝑋 = −
𝑖=1
𝑛
𝑚𝑖
𝑚
log2
𝑚𝑖
𝑚
For continuous data, the calculation is harder
58. 01/27/2021 58
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Mutual Information
Information one variable provides about another
Formally, 𝐼 𝑋, 𝑌 = 𝐻 𝑋 + 𝐻 𝑌 − 𝐻(𝑋, 𝑌), where
H(X,Y) is the joint entropy of X and Y,
𝐻 𝑋, 𝑌 = −
𝑖 𝑗
𝑝𝑖𝑗log2 𝑝𝑖𝑗
Where pij is the probability that the ith value of X and the jth value of Y
occur together
For discrete variables, this is easy to compute
Maximum mutual information for discrete variables is
log2(min( nX, nY ), where nX (nY) is the number of values of X (Y)
59. 01/27/2021 59
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Mutual Information Example
Student
Status
Count p -plog2p
Undergrad 45 0.45 0.5184
Grad 55 0.55 0.4744
Total 100 1.00 0.9928
Grade Count p -plog2p
A 35 0.35 0.5301
B 50 0.50 0.5000
C 15 0.15 0.4105
Total 100 1.00 1.4406
Student
Status
Grade Count p -plog2p
Undergrad A 5 0.05 0.2161
Undergrad B 30 0.30 0.5211
Undergrad C 10 0.10 0.3322
Grad A 30 0.30 0.5211
Grad B 20 0.20 0.4644
Grad C 5 0.05 0.2161
Total 100 1.00 2.2710
Mutual information of Student Status and Grade = 0.9928 + 1.4406 - 2.2710 = 0.1624
60. 01/27/2021 60
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Maximal Information Coefficient
Reshef, David N., Yakir A. Reshef, Hilary K. Finucane, Sharon R. Grossman, Gilean McVean, Peter
J. Turnbaugh, Eric S. Lander, Michael Mitzenmacher, and Pardis C. Sabeti. "Detecting novel
associations in large data sets." science 334, no. 6062 (2011): 1518-1524.
Applies mutual information to two continuous
variables
Consider the possible binnings of the variables into
discrete categories
– nX × nY ≤ N0.6 where
nX is the number of values of X
nY is the number of values of Y
N is the number of samples (observations, data objects)
Compute the mutual information
– Normalized by log2(min( nX, nY )
Take the highest value
61. 01/27/2021 61
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
General Approach for Combining Similarities
Sometimes attributes are of many different types, but an
overall similarity is needed.
1: For the kth attribute, compute a similarity, sk(x, y), in the
range [0, 1].
2: Define an indicator variable, k, for the kth attribute as
follows:
k = 0 if the kth attribute is an asymmetric attribute and
both objects have a value of 0, or if one of the objects
has a missing value for the kth attribute
k = 1 otherwise
3. Compute
62. 01/27/2021 62
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Using Weights to Combine Similarities
May not want to treat all attributes the same.
– Use non-negative weights 𝜔𝑘
– 𝑠𝑖𝑚𝑖𝑙𝑎𝑟𝑖𝑡𝑦 𝐱, 𝐲 = 𝑘=1
𝑛
𝜔𝑘𝛿𝑘𝑠𝑘(𝐱,𝐲)
𝑘=1
𝑛
𝜔𝑘𝛿𝑘
Can also define a weighted form of distance
63. 01/27/2021 63
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Data Preprocessing
Aggregation
Sampling
Discretization and Binarization
Attribute Transformation
Dimensionality Reduction
Feature subset selection
Feature creation
64. 01/27/2021 64
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Aggregation
Combining two or more attributes (or objects) into a single
attribute (or object)
Purpose
– Data reduction - reduce the number of attributes or objects
– Change of scale
Cities aggregated into regions, states, countries, etc.
Days aggregated into weeks, months, or years
– More “stable” data - aggregated data tends to have less variability
65. 01/27/2021 65
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Example: Precipitation in Australia
This example is based on precipitation in
Australia from the period 1982 to 1993.
The next slide shows
– A histogram for the standard deviation of average
monthly precipitation for 3,030 0.5◦ by 0.5◦ grid cells in
Australia, and
– A histogram for the standard deviation of the average
yearly precipitation for the same locations.
The average yearly precipitation has less
variability than the average monthly precipitation.
All precipitation measurements (and their
standard deviations) are in centimeters.
66. 01/27/2021 66
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Example: Precipitation in Australia …
Standard Deviation of Average
Monthly Precipitation
Standard Deviation of
Average Yearly Precipitation
Variation of Precipitation in Australia
67. 01/27/2021 67
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Sampling
Sampling is the main technique employed for data
reduction.
– It is often used for both the preliminary investigation of
the data and the final data analysis.
Statisticians often sample because obtaining the
entire set of data of interest is too expensive or
time consuming.
Sampling is typically used in data mining because
processing the entire set of data of interest is too
expensive or time consuming.
68. 01/27/2021 68
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Sampling …
The key principle for effective sampling is the
following:
– Using a sample will work almost as well as using the
entire data set, if the sample is representative
– A sample is representative if it has approximately the
same properties (of interest) as the original set of data
70. 01/27/2021 70
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Types of Sampling
Simple Random Sampling
– There is an equal probability of selecting any particular
item
– Sampling without replacement
As each item is selected, it is removed from the
population
– Sampling with replacement
Objects are not removed from the population as they
are selected for the sample.
In sampling with replacement, the same object can
be picked up more than once
Stratified sampling
– Split the data into several partitions; then draw random
samples from each partition
71. 01/27/2021 71
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Sample Size
What sample size is necessary to get at least one
object from each of 10 equal-sized groups.
72. 01/27/2021 72
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Discretization
Discretization is the process of converting a
continuous attribute into an ordinal attribute
– A potentially infinite number of values are mapped
into a small number of categories
– Discretization is used in both unsupervised and
supervised settings
73. 01/27/2021 73
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Unsupervised Discretization
Data consists of four groups of points and two outliers. Data is one-
dimensional, but a random y component is added to reduce overlap.
74. 01/27/2021 74
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Unsupervised Discretization
Equal interval width approach used to obtain 4 values.
75. 01/27/2021 75
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Unsupervised Discretization
Equal frequency approach used to obtain 4 values.
76. 01/27/2021 76
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Unsupervised Discretization
K-means approach to obtain 4 values.
77. 01/27/2021 77
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Discretization in Supervised Settings
– Many classification algorithms work best if both the independent
and dependent variables have only a few values
– We give an illustration of the usefulness of discretization using
the following example.
78. 01/27/2021 78
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Binarization
Binarization maps a continuous or categorical
attribute into one or more binary variables
79. 01/27/2021 79
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Attribute Transformation
An attribute transform is a function that maps the
entire set of values of a given attribute to a new
set of replacement values such that each old
value can be identified with one of the new values
– Simple functions: xk, log(x), ex, |x|
– Normalization
Refers to various techniques to adjust to
differences among attributes in terms of frequency
of occurrence, mean, variance, range
Take out unwanted, common signal, e.g.,
seasonality
– In statistics, standardization refers to subtracting off
the means and dividing by the standard deviation
80. 01/27/2021 80
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Example: Sample Time Series of Plant Growth
Correlations between time series
Minneapolis
Correlations between time series
Net Primary
Production (NPP)
is a measure of
plant growth used
by ecosystem
scientists.
81. 01/27/2021 81
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Seasonality Accounts for Much Correlation
Correlations between time series
Minneapolis
Normalized using
monthly Z Score:
Subtract off monthly
mean and divide by
monthly standard
deviation
Correlations between time series
82. 01/27/2021 82
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Curse of Dimensionality
When dimensionality
increases, data becomes
increasingly sparse in the
space that it occupies
Definitions of density and
distance between points,
which are critical for
clustering and outlier
detection, become less
meaningful •Randomly generate 500 points
•Compute difference between max and
min distance between any pair of points
83. 01/27/2021 83
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Dimensionality Reduction
Purpose:
– Avoid curse of dimensionality
– Reduce amount of time and memory required by data
mining algorithms
– Allow data to be more easily visualized
– May help to eliminate irrelevant features or reduce
noise
Techniques
– Principal Components Analysis (PCA)
– Singular Value Decomposition
– Others: supervised and non-linear techniques
84. 01/27/2021 84
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Dimensionality Reduction: PCA
Goal is to find a projection that captures the
largest amount of variation in data
x2
x1
e
85. 01/27/2021 85
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Dimensionality Reduction: PCA
86. 01/27/2021 86
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Feature Subset Selection
Another way to reduce dimensionality of data
Redundant features
– Duplicate much or all of the information contained in
one or more other attributes
– Example: purchase price of a product and the amount
of sales tax paid
Irrelevant features
– Contain no information that is useful for the data
mining task at hand
– Example: students' ID is often irrelevant to the task of
predicting students' GPA
Many techniques developed, especially for
classification
87. 01/27/2021 87
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Feature Creation
Create new attributes that can capture the
important information in a data set much more
efficiently than the original attributes
Three general methodologies:
– Feature extraction
Example: extracting edges from images
– Feature construction
Example: dividing mass by volume to get density
– Mapping data to new space
Example: Fourier and wavelet analysis
88. 01/27/2021 88
Introduction to Data Mining, 2nd Edition
Tan, Steinbach, Karpatne, Kumar
Mapping Data to a New Space
Two Sine Waves + Noise Frequency
Fourier and wavelet transform
Frequency