Input: �Concepts, Attributes, �Instances
Module Outline
2
Terminology
3
What’s a concept?
4
Classification learning
5
Association learning
6
Clustering
7
| Sepal length | Sepal width | Petal length | Petal width | Type |
1 | 5.1 | 3.5 | 1.4 | 0.2 | Iris setosa |
2 | 4.9 | 3.0 | 1.4 | 0.2 | Iris setosa |
… | | | | | |
51 | 7.0 | 3.2 | 4.7 | 1.4 | Iris versicolor |
52 | 6.4 | 3.2 | 4.5 | 1.5 | Iris versicolor |
… | | | | | |
101 | 6.3 | 3.3 | 6.0 | 2.5 | Iris virginica |
102 | 5.8 | 2.7 | 5.1 | 1.9 | Iris virginica |
… | | | | | |
Numeric prediction
8
Outlook | Temperature | Humidity | Windy | Play-time |
Sunny | Hot | High | False | 5 |
Sunny | Hot | High | True | 0 |
Overcast | Hot | High | False | 55 |
Rainy | Mild | Normal | False | 40 |
… | … | … | … | … |
What’s in an example?
9
A family tree
Peter
M
10
Peggy
F
=
Steven
M
Graham
M
Pam
F
Grace
F
Ray
M
=
Ian
M
Pippa
F
Brian
M
=
Anna
F
Nikki
F
Family tree represented as a table
11
Name | Gender | Parent1 | parent2 |
Peter | Male | ? | ? |
Peggy | Female | ? | ? |
Steven | Male | Peter | Peggy |
Graham | Male | Peter | Peggy |
Pam | Female | Peter | Peggy |
Ian | Male | Grace | Ray |
Pippa | Female | Grace | Ray |
Brian | Male | Grace | Ray |
Anna | Female | Pam | Ian |
Nikki | Female | Pam | Ian |
The “sister-of” relation
12
First �person | Second person | Sister of? |
Peter | Peggy | No |
Peter | Steven | No |
… | … | … |
Steven | Peter | No |
Steven | Graham | No |
Steven | Pam | Yes |
… | … | … |
Ian | Pippa | Yes |
… | … | … |
Anna | Nikki | Yes |
… | … | … |
Nikki | Anna | yes |
First �person | Second person | Sister of? |
Steven | Pam | Yes |
Graham | Pam | Yes |
Ian | Pippa | Yes |
Brian | Pippa | Yes |
Anna | Nikki | Yes |
Nikki | Anna | Yes |
All the rest | No | |
Closed-world assumption
A full representation in one table
13
First person | Second person | Sister�of? | ||||||
Name | Gender | Parent1 | Parent2 | Name | Gender | Parent1 | Parent2 | |
Steven | Male | Peter | Peggy | Pam | Female | Peter | Peggy | Yes |
Graham | Male | Peter | Peggy | Pam | Female | Peter | Peggy | Yes |
Ian | Male | Grace | Ray | Pippa | Female | Grace | Ray | Yes |
Brian | Male | Grace | Ray | Pippa | Female | Grace | Ray | Yes |
Anna | Female | Pam | Ian | Nikki | Female | Pam | Ian | Yes |
Nikki | Female | Pam | Ian | Anna | Female | Pam | Ian | Yes |
All the rest | No | |||||||
If second person’s gender = female�and first person’s parent = second person’s parent�then sister-of = yes |
Generating a flat file
14
*The “ancestor-of” relation
15
First person | Second person | Sister of? | ||||||
Name | Gender | Parent1 | Parent2 | Name | Gender | Parent1 | Parent2 | |
Peter | Male | ? | ? | Steven | Male | Peter | Peggy | Yes |
Peter | Male | ? | ? | Pam | Female | Peter | Peggy | Yes |
Peter | Male | ? | ? | Anna | Female | Pam | Ian | Yes |
Peter | Male | ? | ? | Nikki | Female | Pam | Ian | Yes |
Pam | Female | Peter | Peggy | Nikki | Female | Pam | Ian | Yes |
Grace | Female | ? | ? | Ian | Male | Grace | Ray | Yes |
Grace | Female | ? | ? | Nikki | Female | Pam | Ian | Yes |
Other positive examples here | Yes | |||||||
All the rest | No | |||||||
*Recursion
16
If person1 is a parent of person2�then person1 is an ancestor of person2 If person1 is a parent of person2�and person2 is an ancestor of person3�then person1 is an ancestor of person3 |
*Multi-instance problems
17
What’s in an attribute?
18
Nominal quantities
19
Ordinal quantities
20
Interval quantities (Numeric)
21
Ratio quantities
22
Attribute types used in practice
23
Attribute types: Summary
24
Why specify attribute types?
25
Transforming ordinal to boolean
26
Temperature |
Cold |
Medium |
Hot |
Temperature > cold | Temperature > medium |
False | False |
True | False |
True | True |
Original data
Transformed data
🢩
Metadata
27
Preparing the input
28
The ARFF format
29
% % 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 ... |
Attribute types in Weka
30
Nominal vs. ordinal
(e.g. “young” < “pre-presbyopic” < “presbyopic”)
31
If age = young and astigmatic = no�and tear production rate = normal�then recommendation = soft If age = pre-presbyopic and astigmatic = no �and tear production rate = normal �then recommendation = soft |
If age ≤ pre-presbyopic and astigmatic = no�and tear production rate = normal�then recommendation = soft |
Missing values
32
Missing values - example
33
Name | Age | Sex | Pregnant? | .. |
Mary | 25 | F | N | |
Jane | 27 | F | - | |
Joe | 30 | M | - | |
Anna | 2 | F | - | |
| | | | |
Hospital Check-in Database
Inaccurate values
34
Precision “Illusion”
35
Getting to know the data
36
Summary
37