SlideShare a Scribd company logo
1 of 47
Download to read offline
Prof. Pier Luca Lanzi
Data Representation
Data Mining andText Mining (UIC 583 @ Politecnico di Milano)
Prof. Pier Luca Lanzi
Readings
• “Data Mining and Analysis” – Chapter 1
• “Mining of Massive Datasets” – Chapter 1
2
Prof. Pier Luca Lanzi
syllabusdescribing data
Prof. Pier Luca Lanzi
Contact Lenses Data 4
NoneReducedYesHypermetropePre-presbyopic
NoneNormalYesHypermetropePre-presbyopic
NoneReducedNoMyopePresbyopic
NoneNormalNoMyopePresbyopic
NoneReducedYesMyopePresbyopic
HardNormalYesMyopePresbyopic
NoneReducedNoHypermetropePresbyopic
SoftNormalNoHypermetropePresbyopic
NoneReducedYesHypermetropePresbyopic
NoneNormalYesHypermetropePresbyopic
SoftNormalNoHypermetropePre-presbyopic
NoneReducedNoHypermetropePre-presbyopic
HardNormalYesMyopePre-presbyopic
NoneReducedYesMyopePre-presbyopic
SoftNormalNoMyopePre-presbyopic
NoneReducedNoMyopePre-presbyopic
hardNormalYesHypermetropeYoung
NoneReducedYesHypermetropeYoung
SoftNormalNoHypermetropeYoung
NoneReducedNoHypermetropeYoung
HardNormalYesMyopeYoung
NoneReducedYesMyopeYoung
SoftNormalNoMyopeYoung
NoneReducedNoMyopeYoung
Recommended lensesTear production rateAstigmatismSpectacle prescriptionAge
Prof. Pier Luca Lanzi
Data Representation
• Data are typically abstracted as a matrix, with n rows and d
columns, given as
• Rows are called instances, examples, records, transactions,
objects, points, feature-vectors, etc.
• Columns are called attributes, properties, features, dimensions,
variables, fields, etc.
5
Prof. Pier Luca Lanzi
6
Prof. Pier Luca Lanzi
Instances, Attributes, Concepts
• Instances (observations, case)
§ The atomic elements of information from a dataset
§ Also known as records, prototypes, or examples
• Attributes (variable)
§ Measures aspects of an instance
§ Also known as features or variables
§ Each instance is composed of a certain number of attributes
• Concepts
§ Special content inside the data
§ Kind of things that can be learned
§ Intelligible and operational concept description
7
Prof. Pier Luca Lanzi
Two Versions of the Weather Data 8
……………
YesFalseNormalMildRainy
YesFalseHighHotOvercast
NoTrueHighHotSunny
NoFalseHighHotSunny
PlayWindyHumidityTemperatureOutlook
……………
YesFalse8075Rainy
YesFalse8683Overcast
NoTrue9080Sunny
NoFalse8585Sunny
PlayWindyHumidityTemperatureOutlook
Prof. Pier Luca Lanzi
syllabusattribute types
Prof. Pier Luca Lanzi
Attributes
• Numeric Attributes
§Real-valued or integer-valued domain
§Interval-scaled when only differences are meaningful
(e.g., temperature)
§Ratio-scaled when differences and ratios are meaningful
(e.g., Age)
• Categorical Attributes
§Set-valued domain composed of a set of symbols
§Nominal when only equality is meaningful
(e.g., domain(Sex) = { M, F})
§Ordinal when both equality (are two values the same?) and
inequality (is one value less than another?) are meaningful
(e.g., domain(Education) = { High School, BS, MS, PhD})
10
Prof. Pier Luca Lanzi
Numerical Attributes
• Not only ordered but measured in fixed and equal units
• Examples
§Attribute “temperature” expressed in degrees
§Attribute “year”
• Characteristics
§Difference of two values makes sense
§Sum or product doesn’t make sense
§Zero point is not defined
• Sometimes they are divided into “discrete” and “continuous”
11
Prof. Pier Luca Lanzi
Nominal Attributes (or Categorical)
• Values are distinct symbols
• Values themselves serve only as labels or names
• Example
§Attribute “outlook” from weather data
§Values: “sunny”, “overcast”, and “rainy”
• Characteristics
§No relation is implied among nominal values
§No ordering
§No distance measure
§Only equality tests can be performed
12
Prof. Pier Luca Lanzi
Other Types of Attributes
• Ratio Attributes
§Numerical attributes for which the measurement scheme
defines a zero point (e.g., an attribute representing distance)
• Ordinal Attributes
§Categorical attributes with an imposed order on values
§No distance between values defined
§For instance, the attribute “temperature” in weather data
“hot” > “mild” > “cool”
13
Prof. Pier Luca Lanzi
Nominal or Ordinal?
• Attribute “age” nominal
§If age = young and astigmatic = no
and tear production rate = normal
then recommendation = soft
• Attribute “age” ordinal
(e.g. “young” < “pre-presbyopic” < “presbyopic”)
§If age≤pre-presbyopic and astigmatic = no
and tear production rate = normal
then recommendation = soft
14
Prof. Pier Luca Lanzi
Why Specifying Attribute Types?
• Some algorithms fit some specific data types best
• Express the best possible patterns into data
• Make the most adequate comparisons
• Example
§Outlook > “sunny” does not make sense, while
§Temperature > “cool” or
§Humidity > 70 does
• Additional uses of attribute type
§Check for valid values
§Deal with missing values, etc.
15
Prof. Pier Luca Lanzi
syllabusmissing values
Prof. Pier Luca Lanzi
Why Missing Values Exist?
• Faulty equipment, incorrect measurements, missing cells in manual
data entry, censored/anonymous data
• Review scores for movies, books, etc.
• Very frequent in questionnaires for medical scenarios
• Censored/anonymous data
• In practice, a low rate of missing values may be suspicious
• Interview data (“Did you ever …”)
17
Prof. Pier Luca Lanzi
Missing Values
• Frequently indicated by out-of-range entries (e.g. max/min float),
Nan or special values (e.g., zero)
• Missing value may have significance in itself
§E.g. missing test in a medical examination
• Most schemes assume that is not the case
§“missing” may need to be coded as additional value
• Does absence of value have some significance?
§If it does, “missing” is a separate value
§If it does not, “missing” must be treated in a special way
18
Prof. Pier Luca Lanzi
What Types of Missing Values?
• Missing completely at random (MCAR)
§ The distribution of an example having a missing value for an attribute does not depend on
either the observed data or the missing data
§ Example: some survey questions contain a random sample of the whole questionnaire
• Missing at random (MAR)
§ The distribution of an example having a missing value for an attribute depends on the
observed data, but does not depend on the missing data
§ Missing at Random means the propensity for a data point to be missing is not related to the
missing data, but it is related to some of the observed data
§ Whether or not someone answered #13 on your survey has nothing to do with the missing
values, but it does have to do with the values of some other variable
§ For example, people who don’t declare their salary not because of the amount of it but just
because they don’t want to.
• Not missing at random (NMAR)
§ The distribution of an example having a missing depends on the missing values.
§ For example, respondents with high income less likely to report income
• Note that NMAR and MAR might be difficult to identify and often require domain knowledge
19
Prof. Pier Luca Lanzi
Dealing with Missing Values
• Use what you know
§ Why data is missing
§ Distribution of missing data
• Decide on the best strategy to yield the least biased estimates
§ Deletion Methods (listwise deletion, pairwise deletion)
§ Single Imputation Methods (mean/mode substitution, dummy variable
method, single regression)
§ Model-Based Methods (maximum Likelihood, multiple imputation
20
Prof. Pier Luca Lanzi
Strategies for missing values handling
• The handling of missing data depends on the type
• Discarding all the examples with a missing values
§ Simplest approach
§ Allows the use of unmodified data mining methods
§ Only practical if there are few examples with missing values. Otherwise, it
can introduce bias
• Fill in the missing value manually J
• Convert the missing values into a new value
§ Use a special value for it
§ Add an attribute that indicates if value is missing or not
§ Greatly increases the difficulty of the data mining process
• Imputation methods
§ Assign a value to the missing one, based on the rest of the dataset. Use
the unmodified data mining methods.
21
Prof. Pier Luca Lanzi
Listwise Deletion
(Complete Case Analysis)
• Only analyze cases with available data
on each variable
• Simple, but reduces the data
• Comparability across analyses
• Does not use all the information
• Estimates may be biased if data not
MCAR
22
Prof. Pier Luca Lanzi
Pairwise deletion
(Available Case Analysis)
• Analysis with all cases in which
the variables of interest are
present
• Advantage
§Keeps as many cases as
possible for each analysis
§Uses all information
possible with each analysis
• Disadvantage
§Can’t compare analyses
because sample different
each time
23
Prof. Pier Luca Lanzi
Imputation methods
• Extract a model from the dataset to perform the imputation
• Suitable for MCAR and, to a lesser extent, for MAR
• Not suitable for NMAR type of missing data
• For NMAR we need to go back to the source of the data to
obtain more information
• Survey of imputation methods available at
http://sci2s.ugr.es/MVDM/index.php
http://sci2s.ugr.es/MVDM/biblio.php
24
Prof. Pier Luca Lanzi
Single Imputation Methods
• Mean/mode substitution (most common value)
§ Replace missing value with sample mean or mode
§ Run analyses as if all complete cases
§ Advantages: Can use complete case analysis methods
§ Disadvantages: Reduces variability
• Dummy variable control
§ Create an indicator for missing value (1=value is missing for observation;
0=value is observed for observation)
§ Impute missing values to a constant (such as the mean)
§ Include missing indicator in the algorithm
§ Advantage: uses all available information about missing observation
§ Disadvantage: results in biased estimates, not theoretically driven
• Regression Imputation
§ Replaces missing values with predicted score from a regression equation.
25
Prof. Pier Luca Lanzi
Do Not Impute (DNI)
• Simply use the default policy of the data mining method
• Works only if the policy exists
26
Prof. Pier Luca Lanzi
syllabusinaccurate values
Prof. Pier Luca Lanzi
Inaccurate Values
• Data has not been collected for mining it
• Errors and omissions that don’t affect original purpose of data
(e.g. age of customer)
• Typographical errors in nominal attributes,
thus values need to be checked for consistency
• Typographical and measurement errors in numeric attributes,
thus outliers need to be identified
• Errors may be deliberate (e.g. wrong zip codes)
28
Prof. Pier Luca Lanzi
syllabusthe geometric view
Prof. Pier Luca Lanzi
The Geometrical View of the Data
• When the data matrix contains only numerical values
§Every row can be viewed as a point in a d-dimension space
§Every column as a point in a n-dimensional space
30
Prof. Pier Luca Lanzi
31
Prof. Pier Luca Lanzi
Prof. Pier Luca Lanzi
syllabusthe probabilistic view
Prof. Pier Luca Lanzi
Prof. Pier Luca Lanzi
Prof. Pier Luca Lanzi
syllabusdata format
Prof. Pier Luca Lanzi
Data Format
• Most commercial tools have their own proprietary format
• Most tools import excel files and comma-separated value files
37
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
Year;Make;Model;Length
1997;Ford;E350;2,34
2000;Mercury;Cougar;2,38
Prof. Pier Luca Lanzi
Attribute-Relation File Format
(ARFF)
38
%
% ARFF file for weather data with some numeric features
%
@relation weather
@attribute outlook {sunny, overcast, rainy}
@attribute temperature numeric
@attribute humidity numeric
@attribute windy {true, false}
@attribute play? {yes, no}
@data
sunny, 85, 85, false, no
sunny, 80, 90, true, no
overcast, 83, 86, false, yes
...
http://www.cs.waikato.ac.nz/~ml/weka/arff.html
Prof. Pier Luca Lanzi
Additional Attribute Types
• ARFF supports string attributes:
• Similar to nominal attributes but list of values
is not pre-specified
• ARFF also supports date attributes:
• Uses the ISO-8601 combined date
and time format yyyy-MM-dd-THH:mm:ss
39
@attribute description string
@attribute today date
Prof. Pier Luca Lanzi
Additional Attribute Types
• ARFF supports sparse data, for instance the following examples,
• Can also be represented as,
40
0, 26, 0, 0, 0 ,0, 63, 0, 0, 0, “class A”
0, 0, 0, 42, 0, 0, 0, 0, 0, 0, “class B”
{1 26, 6 63, 10 “class A”}
{3 42, 10 “class B”}
Prof. Pier Luca Lanzi
Missing Values in ARFF 41
@relation labor
@attribute 'duration' real
@attribute 'wage-increase-first-year' real
@attribute 'wage-increase-second-year' real
@attribute 'wage-increase-third-year' real
@attribute 'cost-of-living-adjustment' {'none','tcf','tc'}
@attribute 'working-hours' real
@attribute 'pension' {'none','ret_allw','empl_contr'}
@attribute 'standby-pay' real
@attribute 'shift-differential' real
@attribute 'education-allowance' {'yes','no'}
@attribute 'statutory-holidays' real
@attribute 'vacation' {'below_average','average','generous'}
@attribute 'longterm-disability-assistance' {'yes','no'}
@attribute 'contribution-to-dental-plan' {'none','half','full'}
@attribute 'bereavement-assistance' {'yes','no'}
@attribute 'contribution-to-health-plan' {'none','half','full'}
@attribute 'class' {'bad','good'}
@data
1,5,?, ?, ?,40, ?, ?,2, ?,11,'average', ?, ?,'yes',?,'good'
2,4.5,5.8, ?, ?,35,'ret_allw', ?, ?,'yes',11,'below_average', ?,'full', ?,'full','good'
?, ?, ?, ?, ?,38,'empl_contr', ?,5, ?,11,'generous','yes','half','yes','half','good'
3,3.7,4,5,'tc', ?, ?, ?, ?,'yes', ?, ?, ?, ?,'yes', ?,'good'
Prof. Pier Luca Lanzi
Attribute Types and Interpretation
• Interpretation of attribute types in ARFF depends
on the mining scheme
• Numeric attributes are interpreted as
§Ordinal scales if less-than and greater-than are used
§Ratio scales if distance calculations are performed
(normalization/standardization may be required)
• Instance-based schemes define distance between nominal values
(0 if values are equal, 1 otherwise)
• Integers in some given data file: nominal, ordinal, or ratio scale?
42
Prof. Pier Luca Lanzi
DSPL: Dataset Publishing Language
• Open format by Google available at
http://code.google.com/apis/publicdata/
• Use existing data: add an XML metadata file existing CSV
• Read by the Google Public Data Explorer, which includes
animated bar chart, motion chart, and map visualization
• Allow linking to concepts in other datasets
• Geo-enabled: allows adding latitude and longitude data to your
concept definitions
43
Prof. Pier Luca Lanzi
syllabusmodel representation
Prof. Pier Luca Lanzi
Predictive Model Markup Language
• XML-based markup language developed by the Data Mining
Group (DMG) to provide a way for applications to define models
related to predictive analytics and data mining
• The goal is to share models between applications
• Vendor-independent method of defining models
• Allow to exchange of models between applications.
• PMML Components: data dictionary, data transformations, model,
mining schema, targets, output
45
Prof. Pier Luca Lanzi
syllabusdata repositories
Prof. Pier Luca Lanzi
Publicly Available Datasets
• UCI repository
§http://archive.ics.uci.edu/ml/
§Probably the most famous collection of datasets
• Kaggle
§http://www.kaggle.com/
§It is not a static repository of datasets, but a site that manages
Data Mining competitions
§Example of the modern concept of crowdsourcing
• KDNuggets
§http://www.kdnuggets.com/datasets/
47

More Related Content

What's hot

Heuristic search
Heuristic searchHeuristic search
Heuristic searchNivethaS35
 
Performance Evaluation for Classifiers tutorial
Performance Evaluation for Classifiers tutorialPerformance Evaluation for Classifiers tutorial
Performance Evaluation for Classifiers tutorialBilkent University
 
Unsupervised learning: Clustering
Unsupervised learning: ClusteringUnsupervised learning: Clustering
Unsupervised learning: ClusteringDeepak George
 
Hyperparameter Optimization for Machine Learning
Hyperparameter Optimization for Machine LearningHyperparameter Optimization for Machine Learning
Hyperparameter Optimization for Machine LearningFrancesco Casalegno
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed searchHamzaJaved64
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic RegressionKnoldus Inc.
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionMartinHogg9
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersFunctional Imperative
 
Modelling and evaluation
Modelling and evaluationModelling and evaluation
Modelling and evaluationeShikshak
 
Lec 3 knowledge acquisition representation and inference
Lec 3  knowledge acquisition representation and inferenceLec 3  knowledge acquisition representation and inference
Lec 3 knowledge acquisition representation and inferenceEyob Sisay
 
An Introduction to Anomaly Detection
An Introduction to Anomaly DetectionAn Introduction to Anomaly Detection
An Introduction to Anomaly DetectionKenneth Graham
 
Multiclass classification of imbalanced data
Multiclass classification of imbalanced dataMulticlass classification of imbalanced data
Multiclass classification of imbalanced dataSaurabhWani6
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine LearningKnoldus Inc.
 
Introduction to Principle Component Analysis
Introduction to Principle Component AnalysisIntroduction to Principle Component Analysis
Introduction to Principle Component AnalysisSunjeet Jena
 
From decision trees to random forests
From decision trees to random forestsFrom decision trees to random forests
From decision trees to random forestsViet-Trung TRAN
 
Optimizers
OptimizersOptimizers
OptimizersIl Gu Yi
 
Linear regression with gradient descent
Linear regression with gradient descentLinear regression with gradient descent
Linear regression with gradient descentSuraj Parmar
 

What's hot (20)

Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Performance Evaluation for Classifiers tutorial
Performance Evaluation for Classifiers tutorialPerformance Evaluation for Classifiers tutorial
Performance Evaluation for Classifiers tutorial
 
Unsupervised learning: Clustering
Unsupervised learning: ClusteringUnsupervised learning: Clustering
Unsupervised learning: Clustering
 
Hyperparameter Optimization for Machine Learning
Hyperparameter Optimization for Machine LearningHyperparameter Optimization for Machine Learning
Hyperparameter Optimization for Machine Learning
 
CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN7)CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN7)
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Machine Learning With Logistic Regression
Machine Learning  With Logistic RegressionMachine Learning  With Logistic Regression
Machine Learning With Logistic Regression
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
 
Modelling and evaluation
Modelling and evaluationModelling and evaluation
Modelling and evaluation
 
Lec 3 knowledge acquisition representation and inference
Lec 3  knowledge acquisition representation and inferenceLec 3  knowledge acquisition representation and inference
Lec 3 knowledge acquisition representation and inference
 
An Introduction to Anomaly Detection
An Introduction to Anomaly DetectionAn Introduction to Anomaly Detection
An Introduction to Anomaly Detection
 
Multiclass classification of imbalanced data
Multiclass classification of imbalanced dataMulticlass classification of imbalanced data
Multiclass classification of imbalanced data
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
 
Big Data Integration
Big Data IntegrationBig Data Integration
Big Data Integration
 
Introduction to Principle Component Analysis
Introduction to Principle Component AnalysisIntroduction to Principle Component Analysis
Introduction to Principle Component Analysis
 
From decision trees to random forests
From decision trees to random forestsFrom decision trees to random forests
From decision trees to random forests
 
Decision tree
Decision treeDecision tree
Decision tree
 
Optimizers
OptimizersOptimizers
Optimizers
 
Linear regression with gradient descent
Linear regression with gradient descentLinear regression with gradient descent
Linear regression with gradient descent
 

Similar to DMTM Lecture 05 Data representation

DMTM 2015 - 03 Data Representation
DMTM 2015 - 03 Data RepresentationDMTM 2015 - 03 Data Representation
DMTM 2015 - 03 Data RepresentationPier Luca Lanzi
 
DMTM 2015 - 16 Data Preparation
DMTM 2015 - 16 Data PreparationDMTM 2015 - 16 Data Preparation
DMTM 2015 - 16 Data PreparationPier Luca Lanzi
 
DMTM Lecture 20 Data preparation
DMTM Lecture 20 Data preparationDMTM Lecture 20 Data preparation
DMTM Lecture 20 Data preparationPier Luca Lanzi
 
Simple math for anomaly detection toufic boubez - metafor software - monito...
Simple math for anomaly detection   toufic boubez - metafor software - monito...Simple math for anomaly detection   toufic boubez - metafor software - monito...
Simple math for anomaly detection toufic boubez - metafor software - monito...tboubez
 
Making sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methodsMaking sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methodsolivier gimenez
 
DMTM Lecture 19 Data exploration
DMTM Lecture 19 Data explorationDMTM Lecture 19 Data exploration
DMTM Lecture 19 Data explorationPier Luca Lanzi
 
2010 smg training_cardiff_day1_session3_higgins
2010 smg training_cardiff_day1_session3_higgins2010 smg training_cardiff_day1_session3_higgins
2010 smg training_cardiff_day1_session3_higginsrgveroniki
 
The zen of predictive modelling
The zen of predictive modellingThe zen of predictive modelling
The zen of predictive modellingQuinton Anderson
 
Anomalies! You can't escape them.
Anomalies! You can't escape them.Anomalies! You can't escape them.
Anomalies! You can't escape them.CSIRO
 
Pitfalls of multivariate pattern analysis(MVPA), fMRI
Pitfalls of multivariate pattern analysis(MVPA), fMRI Pitfalls of multivariate pattern analysis(MVPA), fMRI
Pitfalls of multivariate pattern analysis(MVPA), fMRI Emily Yunha Shin
 
PSYA4 - Research methods
PSYA4 - Research methodsPSYA4 - Research methods
PSYA4 - Research methodsNicky Burt
 
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...tboubez
 
DMTM Lecture 02 Data mining
DMTM Lecture 02 Data miningDMTM Lecture 02 Data mining
DMTM Lecture 02 Data miningPier Luca Lanzi
 

Similar to DMTM Lecture 05 Data representation (20)

DMTM 2015 - 03 Data Representation
DMTM 2015 - 03 Data RepresentationDMTM 2015 - 03 Data Representation
DMTM 2015 - 03 Data Representation
 
DMTM 2015 - 16 Data Preparation
DMTM 2015 - 16 Data PreparationDMTM 2015 - 16 Data Preparation
DMTM 2015 - 16 Data Preparation
 
DMTM Lecture 20 Data preparation
DMTM Lecture 20 Data preparationDMTM Lecture 20 Data preparation
DMTM Lecture 20 Data preparation
 
Simple math for anomaly detection toufic boubez - metafor software - monito...
Simple math for anomaly detection   toufic boubez - metafor software - monito...Simple math for anomaly detection   toufic boubez - metafor software - monito...
Simple math for anomaly detection toufic boubez - metafor software - monito...
 
Making sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methodsMaking sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methods
 
DMTM Lecture 19 Data exploration
DMTM Lecture 19 Data explorationDMTM Lecture 19 Data exploration
DMTM Lecture 19 Data exploration
 
SQLDay2013_MarcinSzeliga_DataInDataMining
SQLDay2013_MarcinSzeliga_DataInDataMiningSQLDay2013_MarcinSzeliga_DataInDataMining
SQLDay2013_MarcinSzeliga_DataInDataMining
 
2010 smg training_cardiff_day1_session3_higgins
2010 smg training_cardiff_day1_session3_higgins2010 smg training_cardiff_day1_session3_higgins
2010 smg training_cardiff_day1_session3_higgins
 
The zen of predictive modelling
The zen of predictive modellingThe zen of predictive modelling
The zen of predictive modelling
 
Anomalies! You can't escape them.
Anomalies! You can't escape them.Anomalies! You can't escape them.
Anomalies! You can't escape them.
 
Pitfalls of multivariate pattern analysis(MVPA), fMRI
Pitfalls of multivariate pattern analysis(MVPA), fMRI Pitfalls of multivariate pattern analysis(MVPA), fMRI
Pitfalls of multivariate pattern analysis(MVPA), fMRI
 
07 Handling of Uncertainties in the Safety Case
07 Handling of Uncertainties in the Safety Case07 Handling of Uncertainties in the Safety Case
07 Handling of Uncertainties in the Safety Case
 
Kevin Swingler: Introduction to Data Mining
Kevin Swingler: Introduction to Data MiningKevin Swingler: Introduction to Data Mining
Kevin Swingler: Introduction to Data Mining
 
CS194Lec0hbh6EDA.pptx
CS194Lec0hbh6EDA.pptxCS194Lec0hbh6EDA.pptx
CS194Lec0hbh6EDA.pptx
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
PSYA4 - Research methods
PSYA4 - Research methodsPSYA4 - Research methods
PSYA4 - Research methods
 
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
Five Things I Learned While Building Anomaly Detection Tools - Toufic Boubez ...
 
Data in science
Data in science Data in science
Data in science
 
DMTM Lecture 02 Data mining
DMTM Lecture 02 Data miningDMTM Lecture 02 Data mining
DMTM Lecture 02 Data mining
 

More from Pier Luca Lanzi

11 Settembre 2021 - Giocare con i Videogiochi
11 Settembre 2021 - Giocare con i Videogiochi11 Settembre 2021 - Giocare con i Videogiochi
11 Settembre 2021 - Giocare con i VideogiochiPier Luca Lanzi
 
Breve Viaggio al Centro dei Videogiochi
Breve Viaggio al Centro dei VideogiochiBreve Viaggio al Centro dei Videogiochi
Breve Viaggio al Centro dei VideogiochiPier Luca Lanzi
 
Global Game Jam 19 @ POLIMI - Morning Welcome
Global Game Jam 19 @ POLIMI - Morning WelcomeGlobal Game Jam 19 @ POLIMI - Morning Welcome
Global Game Jam 19 @ POLIMI - Morning WelcomePier Luca Lanzi
 
Data Driven Game Design @ Campus Party 2018
Data Driven Game Design @ Campus Party 2018Data Driven Game Design @ Campus Party 2018
Data Driven Game Design @ Campus Party 2018Pier Luca Lanzi
 
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...Pier Luca Lanzi
 
GGJ18 al Politecnico di Milano - Presentazione di apertura
GGJ18 al Politecnico di Milano - Presentazione di aperturaGGJ18 al Politecnico di Milano - Presentazione di apertura
GGJ18 al Politecnico di Milano - Presentazione di aperturaPier Luca Lanzi
 
Presentation for UNITECH event - January 8, 2018
Presentation for UNITECH event - January 8, 2018Presentation for UNITECH event - January 8, 2018
Presentation for UNITECH event - January 8, 2018Pier Luca Lanzi
 
DMTM Lecture 18 Graph mining
DMTM Lecture 18 Graph miningDMTM Lecture 18 Graph mining
DMTM Lecture 18 Graph miningPier Luca Lanzi
 
DMTM Lecture 17 Text mining
DMTM Lecture 17 Text miningDMTM Lecture 17 Text mining
DMTM Lecture 17 Text miningPier Luca Lanzi
 
DMTM Lecture 16 Association rules
DMTM Lecture 16 Association rulesDMTM Lecture 16 Association rules
DMTM Lecture 16 Association rulesPier Luca Lanzi
 
DMTM Lecture 15 Clustering evaluation
DMTM Lecture 15 Clustering evaluationDMTM Lecture 15 Clustering evaluation
DMTM Lecture 15 Clustering evaluationPier Luca Lanzi
 
DMTM Lecture 14 Density based clustering
DMTM Lecture 14 Density based clusteringDMTM Lecture 14 Density based clustering
DMTM Lecture 14 Density based clusteringPier Luca Lanzi
 
DMTM Lecture 13 Representative based clustering
DMTM Lecture 13 Representative based clusteringDMTM Lecture 13 Representative based clustering
DMTM Lecture 13 Representative based clusteringPier Luca Lanzi
 
DMTM Lecture 12 Hierarchical clustering
DMTM Lecture 12 Hierarchical clusteringDMTM Lecture 12 Hierarchical clustering
DMTM Lecture 12 Hierarchical clusteringPier Luca Lanzi
 
DMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringDMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringPier Luca Lanzi
 
DMTM Lecture 10 Classification ensembles
DMTM Lecture 10 Classification ensemblesDMTM Lecture 10 Classification ensembles
DMTM Lecture 10 Classification ensemblesPier Luca Lanzi
 
DMTM Lecture 09 Other classificationmethods
DMTM Lecture 09 Other classificationmethodsDMTM Lecture 09 Other classificationmethods
DMTM Lecture 09 Other classificationmethodsPier Luca Lanzi
 
DMTM Lecture 08 Classification rules
DMTM Lecture 08 Classification rulesDMTM Lecture 08 Classification rules
DMTM Lecture 08 Classification rulesPier Luca Lanzi
 
DMTM Lecture 07 Decision trees
DMTM Lecture 07 Decision treesDMTM Lecture 07 Decision trees
DMTM Lecture 07 Decision treesPier Luca Lanzi
 
DMTM Lecture 06 Classification evaluation
DMTM Lecture 06 Classification evaluationDMTM Lecture 06 Classification evaluation
DMTM Lecture 06 Classification evaluationPier Luca Lanzi
 

More from Pier Luca Lanzi (20)

11 Settembre 2021 - Giocare con i Videogiochi
11 Settembre 2021 - Giocare con i Videogiochi11 Settembre 2021 - Giocare con i Videogiochi
11 Settembre 2021 - Giocare con i Videogiochi
 
Breve Viaggio al Centro dei Videogiochi
Breve Viaggio al Centro dei VideogiochiBreve Viaggio al Centro dei Videogiochi
Breve Viaggio al Centro dei Videogiochi
 
Global Game Jam 19 @ POLIMI - Morning Welcome
Global Game Jam 19 @ POLIMI - Morning WelcomeGlobal Game Jam 19 @ POLIMI - Morning Welcome
Global Game Jam 19 @ POLIMI - Morning Welcome
 
Data Driven Game Design @ Campus Party 2018
Data Driven Game Design @ Campus Party 2018Data Driven Game Design @ Campus Party 2018
Data Driven Game Design @ Campus Party 2018
 
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
GGJ18 al Politecnico di Milano - Presentazione che precede la presentazione d...
 
GGJ18 al Politecnico di Milano - Presentazione di apertura
GGJ18 al Politecnico di Milano - Presentazione di aperturaGGJ18 al Politecnico di Milano - Presentazione di apertura
GGJ18 al Politecnico di Milano - Presentazione di apertura
 
Presentation for UNITECH event - January 8, 2018
Presentation for UNITECH event - January 8, 2018Presentation for UNITECH event - January 8, 2018
Presentation for UNITECH event - January 8, 2018
 
DMTM Lecture 18 Graph mining
DMTM Lecture 18 Graph miningDMTM Lecture 18 Graph mining
DMTM Lecture 18 Graph mining
 
DMTM Lecture 17 Text mining
DMTM Lecture 17 Text miningDMTM Lecture 17 Text mining
DMTM Lecture 17 Text mining
 
DMTM Lecture 16 Association rules
DMTM Lecture 16 Association rulesDMTM Lecture 16 Association rules
DMTM Lecture 16 Association rules
 
DMTM Lecture 15 Clustering evaluation
DMTM Lecture 15 Clustering evaluationDMTM Lecture 15 Clustering evaluation
DMTM Lecture 15 Clustering evaluation
 
DMTM Lecture 14 Density based clustering
DMTM Lecture 14 Density based clusteringDMTM Lecture 14 Density based clustering
DMTM Lecture 14 Density based clustering
 
DMTM Lecture 13 Representative based clustering
DMTM Lecture 13 Representative based clusteringDMTM Lecture 13 Representative based clustering
DMTM Lecture 13 Representative based clustering
 
DMTM Lecture 12 Hierarchical clustering
DMTM Lecture 12 Hierarchical clusteringDMTM Lecture 12 Hierarchical clustering
DMTM Lecture 12 Hierarchical clustering
 
DMTM Lecture 11 Clustering
DMTM Lecture 11 ClusteringDMTM Lecture 11 Clustering
DMTM Lecture 11 Clustering
 
DMTM Lecture 10 Classification ensembles
DMTM Lecture 10 Classification ensemblesDMTM Lecture 10 Classification ensembles
DMTM Lecture 10 Classification ensembles
 
DMTM Lecture 09 Other classificationmethods
DMTM Lecture 09 Other classificationmethodsDMTM Lecture 09 Other classificationmethods
DMTM Lecture 09 Other classificationmethods
 
DMTM Lecture 08 Classification rules
DMTM Lecture 08 Classification rulesDMTM Lecture 08 Classification rules
DMTM Lecture 08 Classification rules
 
DMTM Lecture 07 Decision trees
DMTM Lecture 07 Decision treesDMTM Lecture 07 Decision trees
DMTM Lecture 07 Decision trees
 
DMTM Lecture 06 Classification evaluation
DMTM Lecture 06 Classification evaluationDMTM Lecture 06 Classification evaluation
DMTM Lecture 06 Classification evaluation
 

Recently uploaded

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

DMTM Lecture 05 Data representation

  • 1. Prof. Pier Luca Lanzi Data Representation Data Mining andText Mining (UIC 583 @ Politecnico di Milano)
  • 2. Prof. Pier Luca Lanzi Readings • “Data Mining and Analysis” – Chapter 1 • “Mining of Massive Datasets” – Chapter 1 2
  • 3. Prof. Pier Luca Lanzi syllabusdescribing data
  • 4. Prof. Pier Luca Lanzi Contact Lenses Data 4 NoneReducedYesHypermetropePre-presbyopic NoneNormalYesHypermetropePre-presbyopic NoneReducedNoMyopePresbyopic NoneNormalNoMyopePresbyopic NoneReducedYesMyopePresbyopic HardNormalYesMyopePresbyopic NoneReducedNoHypermetropePresbyopic SoftNormalNoHypermetropePresbyopic NoneReducedYesHypermetropePresbyopic NoneNormalYesHypermetropePresbyopic SoftNormalNoHypermetropePre-presbyopic NoneReducedNoHypermetropePre-presbyopic HardNormalYesMyopePre-presbyopic NoneReducedYesMyopePre-presbyopic SoftNormalNoMyopePre-presbyopic NoneReducedNoMyopePre-presbyopic hardNormalYesHypermetropeYoung NoneReducedYesHypermetropeYoung SoftNormalNoHypermetropeYoung NoneReducedNoHypermetropeYoung HardNormalYesMyopeYoung NoneReducedYesMyopeYoung SoftNormalNoMyopeYoung NoneReducedNoMyopeYoung Recommended lensesTear production rateAstigmatismSpectacle prescriptionAge
  • 5. Prof. Pier Luca Lanzi Data Representation • Data are typically abstracted as a matrix, with n rows and d columns, given as • Rows are called instances, examples, records, transactions, objects, points, feature-vectors, etc. • Columns are called attributes, properties, features, dimensions, variables, fields, etc. 5
  • 6. Prof. Pier Luca Lanzi 6
  • 7. Prof. Pier Luca Lanzi Instances, Attributes, Concepts • Instances (observations, case) § The atomic elements of information from a dataset § Also known as records, prototypes, or examples • Attributes (variable) § Measures aspects of an instance § Also known as features or variables § Each instance is composed of a certain number of attributes • Concepts § Special content inside the data § Kind of things that can be learned § Intelligible and operational concept description 7
  • 8. Prof. Pier Luca Lanzi Two Versions of the Weather Data 8 …………… YesFalseNormalMildRainy YesFalseHighHotOvercast NoTrueHighHotSunny NoFalseHighHotSunny PlayWindyHumidityTemperatureOutlook …………… YesFalse8075Rainy YesFalse8683Overcast NoTrue9080Sunny NoFalse8585Sunny PlayWindyHumidityTemperatureOutlook
  • 9. Prof. Pier Luca Lanzi syllabusattribute types
  • 10. Prof. Pier Luca Lanzi Attributes • Numeric Attributes §Real-valued or integer-valued domain §Interval-scaled when only differences are meaningful (e.g., temperature) §Ratio-scaled when differences and ratios are meaningful (e.g., Age) • Categorical Attributes §Set-valued domain composed of a set of symbols §Nominal when only equality is meaningful (e.g., domain(Sex) = { M, F}) §Ordinal when both equality (are two values the same?) and inequality (is one value less than another?) are meaningful (e.g., domain(Education) = { High School, BS, MS, PhD}) 10
  • 11. Prof. Pier Luca Lanzi Numerical Attributes • Not only ordered but measured in fixed and equal units • Examples §Attribute “temperature” expressed in degrees §Attribute “year” • Characteristics §Difference of two values makes sense §Sum or product doesn’t make sense §Zero point is not defined • Sometimes they are divided into “discrete” and “continuous” 11
  • 12. Prof. Pier Luca Lanzi Nominal Attributes (or Categorical) • Values are distinct symbols • Values themselves serve only as labels or names • Example §Attribute “outlook” from weather data §Values: “sunny”, “overcast”, and “rainy” • Characteristics §No relation is implied among nominal values §No ordering §No distance measure §Only equality tests can be performed 12
  • 13. Prof. Pier Luca Lanzi Other Types of Attributes • Ratio Attributes §Numerical attributes for which the measurement scheme defines a zero point (e.g., an attribute representing distance) • Ordinal Attributes §Categorical attributes with an imposed order on values §No distance between values defined §For instance, the attribute “temperature” in weather data “hot” > “mild” > “cool” 13
  • 14. Prof. Pier Luca Lanzi Nominal or Ordinal? • Attribute “age” nominal §If age = young and astigmatic = no and tear production rate = normal then recommendation = soft • Attribute “age” ordinal (e.g. “young” < “pre-presbyopic” < “presbyopic”) §If age≤pre-presbyopic and astigmatic = no and tear production rate = normal then recommendation = soft 14
  • 15. Prof. Pier Luca Lanzi Why Specifying Attribute Types? • Some algorithms fit some specific data types best • Express the best possible patterns into data • Make the most adequate comparisons • Example §Outlook > “sunny” does not make sense, while §Temperature > “cool” or §Humidity > 70 does • Additional uses of attribute type §Check for valid values §Deal with missing values, etc. 15
  • 16. Prof. Pier Luca Lanzi syllabusmissing values
  • 17. Prof. Pier Luca Lanzi Why Missing Values Exist? • Faulty equipment, incorrect measurements, missing cells in manual data entry, censored/anonymous data • Review scores for movies, books, etc. • Very frequent in questionnaires for medical scenarios • Censored/anonymous data • In practice, a low rate of missing values may be suspicious • Interview data (“Did you ever …”) 17
  • 18. Prof. Pier Luca Lanzi Missing Values • Frequently indicated by out-of-range entries (e.g. max/min float), Nan or special values (e.g., zero) • Missing value may have significance in itself §E.g. missing test in a medical examination • Most schemes assume that is not the case §“missing” may need to be coded as additional value • Does absence of value have some significance? §If it does, “missing” is a separate value §If it does not, “missing” must be treated in a special way 18
  • 19. Prof. Pier Luca Lanzi What Types of Missing Values? • Missing completely at random (MCAR) § The distribution of an example having a missing value for an attribute does not depend on either the observed data or the missing data § Example: some survey questions contain a random sample of the whole questionnaire • Missing at random (MAR) § The distribution of an example having a missing value for an attribute depends on the observed data, but does not depend on the missing data § Missing at Random means the propensity for a data point to be missing is not related to the missing data, but it is related to some of the observed data § Whether or not someone answered #13 on your survey has nothing to do with the missing values, but it does have to do with the values of some other variable § For example, people who don’t declare their salary not because of the amount of it but just because they don’t want to. • Not missing at random (NMAR) § The distribution of an example having a missing depends on the missing values. § For example, respondents with high income less likely to report income • Note that NMAR and MAR might be difficult to identify and often require domain knowledge 19
  • 20. Prof. Pier Luca Lanzi Dealing with Missing Values • Use what you know § Why data is missing § Distribution of missing data • Decide on the best strategy to yield the least biased estimates § Deletion Methods (listwise deletion, pairwise deletion) § Single Imputation Methods (mean/mode substitution, dummy variable method, single regression) § Model-Based Methods (maximum Likelihood, multiple imputation 20
  • 21. Prof. Pier Luca Lanzi Strategies for missing values handling • The handling of missing data depends on the type • Discarding all the examples with a missing values § Simplest approach § Allows the use of unmodified data mining methods § Only practical if there are few examples with missing values. Otherwise, it can introduce bias • Fill in the missing value manually J • Convert the missing values into a new value § Use a special value for it § Add an attribute that indicates if value is missing or not § Greatly increases the difficulty of the data mining process • Imputation methods § Assign a value to the missing one, based on the rest of the dataset. Use the unmodified data mining methods. 21
  • 22. Prof. Pier Luca Lanzi Listwise Deletion (Complete Case Analysis) • Only analyze cases with available data on each variable • Simple, but reduces the data • Comparability across analyses • Does not use all the information • Estimates may be biased if data not MCAR 22
  • 23. Prof. Pier Luca Lanzi Pairwise deletion (Available Case Analysis) • Analysis with all cases in which the variables of interest are present • Advantage §Keeps as many cases as possible for each analysis §Uses all information possible with each analysis • Disadvantage §Can’t compare analyses because sample different each time 23
  • 24. Prof. Pier Luca Lanzi Imputation methods • Extract a model from the dataset to perform the imputation • Suitable for MCAR and, to a lesser extent, for MAR • Not suitable for NMAR type of missing data • For NMAR we need to go back to the source of the data to obtain more information • Survey of imputation methods available at http://sci2s.ugr.es/MVDM/index.php http://sci2s.ugr.es/MVDM/biblio.php 24
  • 25. Prof. Pier Luca Lanzi Single Imputation Methods • Mean/mode substitution (most common value) § Replace missing value with sample mean or mode § Run analyses as if all complete cases § Advantages: Can use complete case analysis methods § Disadvantages: Reduces variability • Dummy variable control § Create an indicator for missing value (1=value is missing for observation; 0=value is observed for observation) § Impute missing values to a constant (such as the mean) § Include missing indicator in the algorithm § Advantage: uses all available information about missing observation § Disadvantage: results in biased estimates, not theoretically driven • Regression Imputation § Replaces missing values with predicted score from a regression equation. 25
  • 26. Prof. Pier Luca Lanzi Do Not Impute (DNI) • Simply use the default policy of the data mining method • Works only if the policy exists 26
  • 27. Prof. Pier Luca Lanzi syllabusinaccurate values
  • 28. Prof. Pier Luca Lanzi Inaccurate Values • Data has not been collected for mining it • Errors and omissions that don’t affect original purpose of data (e.g. age of customer) • Typographical errors in nominal attributes, thus values need to be checked for consistency • Typographical and measurement errors in numeric attributes, thus outliers need to be identified • Errors may be deliberate (e.g. wrong zip codes) 28
  • 29. Prof. Pier Luca Lanzi syllabusthe geometric view
  • 30. Prof. Pier Luca Lanzi The Geometrical View of the Data • When the data matrix contains only numerical values §Every row can be viewed as a point in a d-dimension space §Every column as a point in a n-dimensional space 30
  • 31. Prof. Pier Luca Lanzi 31
  • 33. Prof. Pier Luca Lanzi syllabusthe probabilistic view
  • 36. Prof. Pier Luca Lanzi syllabusdata format
  • 37. Prof. Pier Luca Lanzi Data Format • Most commercial tools have their own proprietary format • Most tools import excel files and comma-separated value files 37 Year,Make,Model,Length 1997,Ford,E350,2.34 2000,Mercury,Cougar,2.38 Year;Make;Model;Length 1997;Ford;E350;2,34 2000;Mercury;Cougar;2,38
  • 38. Prof. Pier Luca Lanzi Attribute-Relation File Format (ARFF) 38 % % ARFF file for weather data with some numeric features % @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature numeric @attribute humidity numeric @attribute windy {true, false} @attribute play? {yes, no} @data sunny, 85, 85, false, no sunny, 80, 90, true, no overcast, 83, 86, false, yes ... http://www.cs.waikato.ac.nz/~ml/weka/arff.html
  • 39. Prof. Pier Luca Lanzi Additional Attribute Types • ARFF supports string attributes: • Similar to nominal attributes but list of values is not pre-specified • ARFF also supports date attributes: • Uses the ISO-8601 combined date and time format yyyy-MM-dd-THH:mm:ss 39 @attribute description string @attribute today date
  • 40. Prof. Pier Luca Lanzi Additional Attribute Types • ARFF supports sparse data, for instance the following examples, • Can also be represented as, 40 0, 26, 0, 0, 0 ,0, 63, 0, 0, 0, “class A” 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, “class B” {1 26, 6 63, 10 “class A”} {3 42, 10 “class B”}
  • 41. Prof. Pier Luca Lanzi Missing Values in ARFF 41 @relation labor @attribute 'duration' real @attribute 'wage-increase-first-year' real @attribute 'wage-increase-second-year' real @attribute 'wage-increase-third-year' real @attribute 'cost-of-living-adjustment' {'none','tcf','tc'} @attribute 'working-hours' real @attribute 'pension' {'none','ret_allw','empl_contr'} @attribute 'standby-pay' real @attribute 'shift-differential' real @attribute 'education-allowance' {'yes','no'} @attribute 'statutory-holidays' real @attribute 'vacation' {'below_average','average','generous'} @attribute 'longterm-disability-assistance' {'yes','no'} @attribute 'contribution-to-dental-plan' {'none','half','full'} @attribute 'bereavement-assistance' {'yes','no'} @attribute 'contribution-to-health-plan' {'none','half','full'} @attribute 'class' {'bad','good'} @data 1,5,?, ?, ?,40, ?, ?,2, ?,11,'average', ?, ?,'yes',?,'good' 2,4.5,5.8, ?, ?,35,'ret_allw', ?, ?,'yes',11,'below_average', ?,'full', ?,'full','good' ?, ?, ?, ?, ?,38,'empl_contr', ?,5, ?,11,'generous','yes','half','yes','half','good' 3,3.7,4,5,'tc', ?, ?, ?, ?,'yes', ?, ?, ?, ?,'yes', ?,'good'
  • 42. Prof. Pier Luca Lanzi Attribute Types and Interpretation • Interpretation of attribute types in ARFF depends on the mining scheme • Numeric attributes are interpreted as §Ordinal scales if less-than and greater-than are used §Ratio scales if distance calculations are performed (normalization/standardization may be required) • Instance-based schemes define distance between nominal values (0 if values are equal, 1 otherwise) • Integers in some given data file: nominal, ordinal, or ratio scale? 42
  • 43. Prof. Pier Luca Lanzi DSPL: Dataset Publishing Language • Open format by Google available at http://code.google.com/apis/publicdata/ • Use existing data: add an XML metadata file existing CSV • Read by the Google Public Data Explorer, which includes animated bar chart, motion chart, and map visualization • Allow linking to concepts in other datasets • Geo-enabled: allows adding latitude and longitude data to your concept definitions 43
  • 44. Prof. Pier Luca Lanzi syllabusmodel representation
  • 45. Prof. Pier Luca Lanzi Predictive Model Markup Language • XML-based markup language developed by the Data Mining Group (DMG) to provide a way for applications to define models related to predictive analytics and data mining • The goal is to share models between applications • Vendor-independent method of defining models • Allow to exchange of models between applications. • PMML Components: data dictionary, data transformations, model, mining schema, targets, output 45
  • 46. Prof. Pier Luca Lanzi syllabusdata repositories
  • 47. Prof. Pier Luca Lanzi Publicly Available Datasets • UCI repository §http://archive.ics.uci.edu/ml/ §Probably the most famous collection of datasets • Kaggle §http://www.kaggle.com/ §It is not a static repository of datasets, but a site that manages Data Mining competitions §Example of the modern concept of crowdsourcing • KDNuggets §http://www.kdnuggets.com/datasets/ 47