read.pudn.comread.pudn.com/.../data-mining-book-transparences.doc  · web viewconcepts, models,...

369
DATA MINING: Concepts, Models, Methods & Algorithms TRANSPARENCES

Upload: others

Post on 07-Nov-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DATA MINING:Concepts, Models, Methods & Algorithms

TRANSPARENCES

Mehmed KantardzicLouisville, 2003

Copyright © 2003 by Mehmed Kantardzic

Page 2: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

APPLIED STATISTICS

DATA MINING

COMPUTER SCIENCE

Statistics plays a major role in data mining. However, computer scientists are leading changes and adapting methods to new problems and new environments.

Contributions and enhancements within computer science:

1. Flexible predictive modeling methods (ANN, Decision Rules) – strong algorithmic foundation but weaker formal statistical justification.

2. The use of hidden variable models (ANN, Markov models) – data can be “compressed” into a relatively simple hidden state representation.

3. Finding patterns and local models - rather than insisting on global modeling (Association Rules).

4. Analysis and discovery in heterogeneous data types – (multimedia – images, audio, video; Web and text documents).

5. The engineering of scale – scaling traditional (or modified) algorithms to handle massive data sets.

Page 3: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Tabular representation of a data set

FEATURESSAMPLES

Feature’s value for the given sample

Features = Variables

o independent variables (input variables) – X

o dependent variables (output variables) - Y

X? System Y

Z Unobserved variables

Page 4: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DATA MINING ROOTS

1. Statistics - driven by the notion of a model,

2. Machine learning - emphasizes algorithms,

3. Data bases - concentration on large amount of data.

____________________________ . ________________________________

4. Control theory

To predict a system’s behavior.

To explain the interaction and relationships between variables of a system.

Page 5: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DATA QUALITY

Requirements:

1. The data should be accurate.

2. The data should be stored according to data types.

3. The data has integrity.

4. The data is consistent.

5. The data is not redundant.

6. The data is timely.

7. The data is well understood.

8. The data set is complete.

Page 6: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DATA WAREHOUSING

The data warehouse is a collection of integrated, subject-oriented databases designed to support the decision support functions (DSF), where each unit of data is relevant to some moment in time.

Data warehouse includes different types of data:

1. Old detail data2. Current (new) detail data3. Lightly summarized data4. Highly summarized data5. Metadata (the data directory or guide).

Data transformation, in a preparation of a data warehouse, are standardized:

1. Simple transformations 2. Cleansing and scrubbing3. Integration4. Aggregation and summarization

Page 7: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DATA WAREHOUSING Data mining represents one of the major applications

for data warehousing

SQL : Data Mining

SQL is a standard relational database language that is good for queries that impose some kind of constraints on data in the database in order to extract an answer.

In contrast, data mining methods are good for queries that are exploratory in nature, trying to extract hidden, not so obvious information.

OLAP : Data Mining

OLAP tools make it very easy to look at dimensional data from any angle, or to “slice-and-dice” it.

OLAP tools do not learn from data, nor do they create new knowledge. They are usually special-purpose visualization tools that can help an end user to make his/her own conclusions and decisions based on graphically condensed data.

OLAP tools are very useful for the data mining process, they can be a part of it but they are not its substitute.

Page 8: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

REPRESENTATION OF RAW DATA

Common types:

1. Numeric

A feature with numeric values has two important properties:

a) Order relation (for example, 2 < 5 and 5 < 7) ,

b) Distance relation (for example, d(2.3, 4.2) = 1.9).

2. Categorical

Categorical (often called symbolic) variables have neither of these two relations.

The two values of a categorical variable can be either equal or not equal: they only support equality relation (Blue = Blue, or Red Black)

Coded categorical variables are known as “dummy variables“ in statistics:

Feature value Code Black 1000Blue 0100Green 0010Brown 0001

Page 9: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

REPRESENTATION OF RAW DATAAnother way of variable classification:

1. Continuous variables(also known as quantitative or metric variables)

These variables are measured using either:

a) interval scale The zero point in the interval scale is placed arbitrarily. (Temperatures: 40O and 80O)

b) ratio scale It has an absolute zero point and the ratio relation holds. (Lengths: 2 ft. and 4 ft.)

2. Discrete variables (also called qualitative variables)

They use one of two kinds of non-metric scales:

a) nominal scale

A nominal scale is an order-less scale,(A, B and C values for the variable, or ZIP-code)

b) ordinal scale

An ordinal scale consists of ordered discrete gradations, e.g. rankings. An order relation is defined but no distance relation.(gold, silver, and bronze medal, or students ranked as 15th and 16th).

* c) Periodic variable is a feature for which the distance relation exists, but there is no order relation. (Days of the week, month, or year).

Page 10: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

REPRESENTATION OF RAW DATA

Another way of variable classification with respect to time:

Some data do not change with time and we consider them static data.

On the other hand, there are attribute values that change with time, and this type of data we call dynamic or temporal data.

The majority of the data mining methods are more suitable for static data.

Page 11: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

“CURSE OF DIMENSIONALITY”

The “curse of dimensionality” is due to the geometry of high-dimensional spaces.

The properties of high-dimensional spaces often appear counterintuitive because our experience with the physical world is in low-dimensional space such as space with two or three dimensions.

Conceptually objects in high-dimensional spaces have a larger amount of surface area for a given volume than objects in low-dimensional spaces.

For example, a high-dimensional hypercube, if it could be visualized, would look like a porcupine. As the dimensionality grows larger, the edges grow longer relative to the size of a central part of the hypercube.

Page 12: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

“CURSE OF DIMENSIONALITY”

1. The size of a data set yielding the same density of data points in n-dimensional space increases exponentially with dimensions.

SAME DENSITY OF DATA:

one-dimension k dimensions n nk 100 k=5: 100 5 = 10 10

2. A larger radius is needed to enclose a fraction of data points in a high-dimensional space. The edge length e of the hypercube:

e(p) = p 1/d where p is the pre-specified fraction of samples and d is the number of dimensions.

10% of the samples (p=0.1):

one-dimension 2 dimensions 3 dimensions 10-dimensions e1(0.1) = 0.1 e2(0.1) = 0.32 e3(0.1) = 0.46 e10 (0.1) = 0.80

0.10 0.32

0.46

Page 13: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

“CURSE OF DIMENSIONALITY”2. Almost every point is closer to an edge than to another

sample point in a high-dimensional space.

For a sample size n, the expected distance D between data points in d-dimensional space is:

D(d, n) = ½ (1/n) 1/d

- For a two-dimensional space with 10000 points D(2,10000) = 0.0005

- For a 10-dimensional space with 10000 points D(10,10000) = 0.4

3. Almost every point is an outlier.

As the dimension of the input space increases, the distance between the prediction point and the center of classified points increases.

When d=10, the expected value of the prediction point is 3.1 SD away from the center of the data belonging to one class.

When d=20, the distance is 4.4 SD.

Page 14: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

CHARACTERISTICS OF RAW DATA

Missing data,

Misrecorded data,

Data may be from the other population,…::

Two central tasks for the preparation of data:

To organize data into a standard form (typically a standard form is a relational table)

To prepare data sets that lead to the best data mining performances.

Page 15: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TRANSFORMATION OF RAW DATA

1. Normalizations

a) Decimal scaling : v’(i) = v(i)/ 10k

for the smallest k such that max (v’(i)) < 1.b) Min-max normalization:

v’(i) = (v(i) – min(v(i)) ) / (max(v(i)) –min(v(i)))

for normalized interval [0,1],

c) Standard deviation normalization:

v’(i) = ( v(i) – mean(v) ) / sd(v)

2. Data smoothing

F = {0.93, 1.01, 1.001, 3.02, 2.99, 5.03, 5.01, 4.98}, F smoothed = {1.0, 1.0, 1.0, 3.0, 3.0, 5.0, 5.0, 5.0}.

3. Differences and ratios

s(t+1)-s(t) s(t+1)/s(t)

4. Composing new features (For example: BMI=k f(W,H))

Page 16: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MISSING DATA Manually examine samples with missing data values

Automatic replacement:

Replace all missing values with a single global constant (a selection of a global constant is highly application dependent).

Replace a missing value with its feature mean.

Replace a missing value with its feature mean for the given class (only for classification problems).

One possible interpretation of missing values is that they are “don’t care” values. X = {1, ?, 3} for the feature domain [0, 1, 2, 3, 4]:

X1 = {1, 0, 3}, X2 = {1, 1, 3}, X3 = {1, 2, 3}, X4 = {1, 3, 3}, X5 = {1, 4, 3}

Data miner can generate model of correlation between features. Different techniques may be used such as regression, Bayesian formalism, clustering, or decision tree induction.

____________________ o_____________________________

In general, it is speculative and often misleading to replace missing values using a simple, artificial schema of data preparation.

It is best to generate multiple solutions of data mining with and without features that have missing values, and then make analysis and interpretation.

Page 17: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TIME-DEPENDENT DATA

The time series of values can be expressed as:

X = {t(1), t(2), t(3), …, t(n)},

where t(n) is the most recent value.

For many problems based on time series the goal is to forecast t(n+1) from previous values of the feature, where these values are directly related to the predicted value.

The most important step in pre-processing of row time-dependent data is specification of a window or a time lag.

For example, if the time series consists of eleven measurements:

X = {t(0), t(1), t(2), t(3), t(4), t(5), t(6), t(7), t(8), t(9), t(10)}

1. Transform data if the window for analysis of time-series is five.

2. More formally, given the time-dependent values: t(n-i),…, t(n), it is necessary to predict the value t(n+j). Transform data for the previous example taking j=3.

Page 18: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TIME-DEPENDENT DATA

1.) t=5, j=1

Sample W I N D O W Next ValueM1 M2 M3 M4 M5

1 t(0) t(1) t(2) t(3) t(4) t(5)2 t(1) t(2) t(3) t(4) t(5) t(6)3 t(2) t(3) t(4) t(5) t(6) t(7)4 t(3) t(4) t(5) t(6) t(7) t(8)5 t(4) t(5) t(6) t(7) t(8) t(9)6 t(5) t(6) t(7) t(8) t(9) t(10)

2.) t=5, j=3

Sample W I N D O W Next Value

M1 M2 M3 M4 M5

1 t(0) t(1) t(2) t(3) t(4) t(7)2 t(1) t(2) t(3) t(4) t(5) t(8)3 t(2) t(3) t(4) t(5) t(6) t(9)4 t(3) t(4) t(5) t(6) t(7) t(10)

Page 19: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TIME-DEPENDENT DATA

One way of summarizing features in the data set is to average them producing so called “moving averages” (MA):

i MA(i, m) = 1/m t(j)

j=i-m+1

The objective is to smooth neighboring time points by a moving average to reduce the random variation and noise components:

MA(i, m) = t(i) = mean(i) + error

Another type of average is an exponential moving average (EMA) that gives more weight to the most recent time periods. It is described recursively:

EMA(i, m) = p* t(i) + (1-p) * EMA (i-1, m-1)EMA (i, 1) = t(i)

where p is a value between 0 and 1.

For example if p=0.5:

EMA(i, 2) = 0.5 t(i) + 0.5 t(i-1)EMA(i, 3) = 0.5 t(i) + 0.5 [ 0.5 t(i-1) + 0.5 t(i-2) ]

Page 20: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

OUTLIER ANALYSIS

Samples, which are significantly different or inconsistent with the remaining set of data, are called outliers.

1. Outlier detection for one-dimensional samples:

STATISTICAL APPROACH

Age = {3,56,23,39,156,52,41,22,9,28,139,31,55,20, -67,37,11,55,45,37}

Statistical parameters are:Mean = 39.9Standard deviation = 45.65

If we select that the threshold value for normal distribution of data is

Threshold = Mean 2 Standard deviation

then all data out of range [-54.1, 131.2] will be potential outliers.

2. Outlier detection for n-dimensional samples:

DISTANCE-BASED OUTLIER DETECTION:

a) Evaluate the distance measures between all samples in n-dimensional data set.

b) A sample si in a data set S is an outlier if at least a fraction p of the samples in S lies at a distance greater than d.

Deviation-based techniques

Page 21: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DIMENSION REDUCTION OF LARGE DATA SETS

Main dimensions:

columns (features), rows (cases or samples), and values of the features.

Analysis of data reduction operations:

1. Computing time – Simpler data due to data reduction process can hopefully lead to the time reduction for data mining.

2. Predictive/descriptive accuracy –We expect that by only using relevant features, a data-mining algorithm cannot only learn faster, but also with higher accuracy:

irrelevant data may mislead a learning process; redundant data may complicate the task and cause

unexpected data mining results.

3. Representation of the data-mining model – The simplicity of representation, often implies model’s better comprehensibility (small decrease of accuracy may be tolerable!).

Page 22: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DATA REDUCTION ALGORITHMS

Recommended characteristics:

1. Measurable quality

2. Recognizable quality

3. Monotonicity

4. Consistency

5. Diminishing returns

6. Interuptibility

7. Preemptability

Page 23: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

Two standard tasks:

1. Feature selection

feature ranking algorithms, and

minimum subset algorithms.

2. Feature composition

Feature selection in general can be viewed as a search problem (2N)

For practical methods, an optimal search is not feasible, and simplifications are made to produce acceptable and timely reasonable results:

heuristic criteria

bottom-up approach

top-down approach

Page 24: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

1. Comparison of means and variances:

If one feature describes different classes of entities,

samples of two (or more) different classes can be examined:

SE(A-B) = ( var(A)/n1 +var(B) /n2 )

TEST:

mean(A) – mean(B) / SE(A-B) > threshold-value

where A and B are sets of feature values measured for two different classes, and n1 and n2 are the corresponding number of samples

For k classes, k pairwise comparisons can be made, comparing each class to its complement.

We apriori assumed that the given feature is independent of the others.

Page 25: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

Comparison of means and variances (EXAMPLE):

X Y C

0.3 0.7 A0.2 0.9 B Threshold value is 0.5 0.6 0.6 A0.5 0.5 A0.7 0.7 B0.4 0.9 B

XA = {0.3, 0.6, 0 .5}, XB = {0.2, 0.7, 0.4},

YA = {0.7, 0.6, 0.5}, and YB = {0.9, 0.7, 0.9}

and the results of applied tests are:

SE(XA-XB) = (var(XA)/n1 +var(XB) /n2) = (0.0233/3 + 0.6333/3) = 0.4678

SE(YA-YB) = (var(YA)/n1 +var(YB) /n2 ) = (0.01/3 + 0.0133/3) = 0.0875

mean(XA)–mean(XB)/SE(XA-XB)=0.4667–0.4333/0.4678=0.0735< 0.5

mean(YA)–mean(YB)/ SE(YA-YB) =0.6–0.8333/ 0.0875 = 2.6667 > 0.5

X is a candidate feature for reduction because its mean values are close, and therefore the final test is below threshold value.

Page 26: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

2. Covariance matrix of the means:

Under assumption of normal distributions for features values:

M – a vector of the m feature means, and

C – an mm covariance matrix of the means, where Ci,i are simply the variance of feature i, and Ci,j terms are correlations between each pair of features:

nCi,j = 1/n (((v(k,i) – m(i)) * ( v(k,j) – m(j)))

k=1where: v(k,i) and v(k,j) are the values of features indexed with i and j, m(i) and m(j) are feature means, and n is the number of dimensions.

3. Heuristic measure DM for filtering features that separate two classes is defined as:

DM = (M1 – M2) (C1 + C2 ) –1 (M1 – M2) T

where M1 and C1 are descriptors of samples for the first class, and M2 and C2 for the second class.

Given the target of k best features, all subsets of k from m features must be evaluated to find the subset with the largest DM.

Page 27: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION3. Principal Components Analysis:

The features are examined collectively, merged and transformed into a new set of features that hopefully retain the original information content in a reduced form.

Given m features, they can be transformed into a single new feature F’, by the simple application of weights:

mF’ = w(j) f(j)

j=1 x2

x1

The first principal component is an axis in the direction of maximum variance.

Most likely a single set of weights w(j) will not be adequate transformation, and up to m transformations are generated, where each vector of m weights is called a principal component and it generate a new feature. Eliminating the bottom ranked transformation will cause dimensions reduction.

Page 28: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

3. Principal Components Analysis:

1. We use covariance matrix S computation, as a first step in features transformation.

nS nn = 1/(n-1) [ (xj – x’)T (xj – x’)]

j=1

nwhere x’ = (1/n ) xj .

j=1

2. The eigenvalues of the covariance matrix S for the given data should be calculated in the next step:

The eigenvalues of S nn are {1, 2, …, n} where 1

2 … n 0.

3. The eigenvectors e1, e2, …, en correspond to eigenvalues 1, 2, …, n, and they are called the principal axes.

4. The criterion for features selection is based on the ratio of the sum of the m largest eigenvalues of S to the trace of S (for example R>90%):

m nR = ( i ) / ( i )

i=1 i=1

Page 29: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 30: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

4. Entropy measure for features ranking:

1.1 The similarity measure S of two numerical samples is:

Sij = e- Dij

where Dij is the distance between samples xi and xj,

nDij = [ ((xik – xjk) / (maxk – mink ))2]1/2

k=1

and is a parameter mathematically expressed as:

= - (ln 0.5) /D

D is the average distance among samples in the data set, but in practical applications = 0.5.

1.2 Similarity for nominal variables is measured directly using Hamming distance:

nSij = ( xik = xjk) / n

k=1

where xik = xjk is 1 if xik = xjk , and 0 otherwise.

2. The entropy measure is given by:

N-1 N E = - ( Sij log Sij + (1 - Sij) log (1 – Sij))

i=1 j=i+1

Page 31: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FEATURE REDUCTION

Sample F1 F2 F3 R1 R2 R3 R4 R5

R1 A X 1 R1 0/3 0/3 2/3 0/3R2 B Y 2 R2 2/3 1/3 0/3R3 C Y 2 R3 0/3 1/3R4 B X 1 R4 0/3R5 C Z 3

Data set Table of similarity measures

4. Entropy measure for features ranking -Algorithm 1. Start with the initial full set of features F.

2. For each feature fF: Remove one feature f from F and obtain a subset Ff . Find the difference between entropy for F and entropy for all Ff. For our example in Figure we have to compare the differences: (EF – E F-F1), (EF – E F-F2), and (EF – E F-F3).

3. Let fk be the feature such that the difference between entropy for F and entropy for Ffk is minimum.

4. Update the set of features: F = F – {fk}, where – is a difference operation on sets. For our example, if the difference (EF – E F-F1) is minimum, then the reduced set of features is {F2, F3}. F1 becomes bottom of the ranked list.

5. Repeat steps (2) –(4) until there is only one feature in F.

Page 32: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VALUES REDUCTION

Feature discretization techniques:

Cut points ?

Age 0 150

Child Adolescent Adult Middle-age Elderly

Discretization of the age feature

What are the cut points?

How to select representatives of intervals?

1. BINS METHOD

a) Sort all values for a given feature.

b) Assign approximately equal numbers of adjacent sorted values vi to each bin, where the number of bins k is given in advance.

c) Move a border element vi from one bin to the next (or previous) when that reduces the global distance error

Page 33: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

ER (sum of all distances from each vi to the mean or mode of its assigned bin).

VALUES REDUCTION

1. BINS METHOD (Example)

Given the set of values for the feature f:{ 5, 1, 8, 2, 2, 9, 2, 1, 8, 6}. Split them into three bins (k = 3), where bins will be represented by its modes.

===========================================

a) Sorted set of values for feature f is:

{1, 1, 2, 2, 2, 5, 6, 8, 8, 9}

b) Initial bins (k=3) are:

{1, 1, 2, 2, 2, 5, 6, 8, 8, 9} BIN1 BIN2 BIN3

c1) Modes for three selected bins are: {1, 2, 8}. After initial distribution the total error, using absolute distance for modes, is:

ERR = 0+0+1+0+0+3+2+0+0+1 = 7....c4) After moving two elements from BIN2 into BIN1, and

one element from BIN3 to BIN2 in the next three iterations, the new and final distribution of elements will be:

Page 34: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

f = {1, 1, 2, 2, 2, 5, 6, 8, 8, 9} Final bins BIN1 BIN2 BIN3

Modes are:{2, 5, 8}, and the total minimized error is: ER = 4.

Page 35: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VALUES REDUCTION

2. Number Approximation by Rounding

1. Integer division: Y = int (X/10k)

2. Rounding: If (mod (X,10k) (10k/2)) then Y=Y+1

3. Integer multiplication: X = Y * 10k

where k is the number of rightmost decimal places to round.

For example, 1453 is rounded to 1450 with k=1, rounded to 1500 with k=2, and rounded to 1000 with k=3.

This simple rounding algorithm can be applied in iterations to reduce the number of values for selected features in large data sets.

A maximum number of values in real-world applications is given between 50 and 100.

Page 36: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VALUES REDUCTION

3. ChiMerge Technique

The algorithm determines similarities between distributions of data in two adjacent intervals based on output classification of samples.

1. Sort the data for the given feature in ascending order.

2. Define initial intervals so that every value of the feature is in a separate interval.

3. Repeat until no 2 of any two adjacent intervals is less then threshold value:

After each merger, 2 tests for the remaining intervals are calculated, and two adjacent with smallest 2 value are found. Merge these intervals if calculated 2 is less then threshold.

If no merge is possible, and the number of intervals is greater then user-defined maximum, increase the threshold value.

Page 37: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VALUES REDUCTION

3. ChiMerge Technique

A contingency table for 2 2 categorical data:

Class1 Class2

Interval-1 A11 A12 R1

Interval-2 A21 A22 R2

C1 C2 N

2 test is: 2 k

2 = (Aij – Eij)2 / Eij i=1 j=1

where:

k = number of classes,Aij = number of instances in the i-th interval, j-th class,Eij = expected frequency of Aij , which is computed as ( Ri Cj ) / N, Ri = number of instances in the i-th interval = Aij , j = 1,…k,Cj = number of instances in the j-th class = Aij , i = 1,2,N = total number of instances = Ri , i = 1,2.

Page 38: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VALUES REDUCTION

3. ChiMerge Technique (Example)

Data Set Sample: F K

1 1 12 3 23 7 14 8 15 9 16 11 27 23 28 37 19 39 210 45 111 46 112 59 1

Interval points for feature F are: 0, 2, 5, 7.5, 8.5, 10, etc.

2 was minimum for intervals: [7.5, 8.5] and [8.5, 10]

K=1 K=2

Interval [7.5, 8.5] A11=1 A12=0 R1=1Interval [8.5, 9.5] A21=1 A22=0 R2=1

C1=2 C2=0 N=2

Based on the table’s values, we can calculate expected values:

E11 = 2/2 = 1,E12 = 0/2 0.1,E21 = 2/2 = 1, and E22 = 0/2 0.1

and corresponding 2 test:2 = (1 – 1)2 / 1 + (0 – 0.1)2 / 0.1 + (1 – 1)2 / 1 + (0 – 0.1)2 / 0.1 = 0.2

For the degree of freedom d=1, and 2 = 0.2 < 2.706

Page 39: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

( MERGE !)

Page 40: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VALUES REDUCTION

3. ChiMerge Technique (Example)

Additional Iterations:

K=1 K=2

Interval [0, 7.5] A11=2 A12=1 R1=3Interval [7.5, 10] A21=2 A22=0 R2=2

C1=4 C2=1 N=5

E11 = 12/5 = 2.4,E12 = 3/5 = 0.6,E21 = 8/5 = 1.6, and E22 = 2/5 = 0.4

2 = (2 – 2.4)2 / 2.4 + (1 – 0.6)2 / 0.6 + (2 – 1.6)2 / 1.6 + (0 – 0.4)2 / 0.4

2 = 0.834For the degree of freedom d=1, 2 = 0.834 < 2.706 (MERGE!)::

K=1 K=2

Interval [0, 10.0] A11=4 A12=1 R1=5Interval [10.0, 42.0] A21=1 A22=3 R2=4

C1=5 C2=4 N=9

E11 = 2.78, E12 =2.22, E21 = 2.22, E22 = 1.78, and 2 = 2.72 > 2.706 (NO MERGE !)

Final discretization: [0, 10], [10, 42], and [42, 60]

Page 41: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

CASES REDUCTION

The largest and the most critical dimension.

The most complex task in data reduction.

Sampling: After the subset of data is obtained, it is used to estimate information about entire data set.

Sampling process always causes a sampling error. Sampling error is inherent and avoidable for every approach and every strategy.

Advantages: reduce cost, greater speed, greater scope, and sometimes even higher accuracy

Classifications for sampling methods:

1) general-purpose sampling methods, and

2) sampling methods for specific domains.

Page 42: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

CASES REDUCTION

General-purpose sampling methods:

1. Systematic sampling

2. Random sampling

random sampling without replacement, random sampling with replacement.

1.1 Incremental sampling

2.2 Average sampling

3. Stratified sampling

4. Inverse sampling

Page 43: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Types of inference: induction, deduction, and transduction

apriori knowledge(Assumptions)

Induction Deduction

Transduction Training data Predicted output

Estimated model

Page 44: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LEARNING MACHINE

Generator X Learning Y’Of Inputs Machine

System Y

Page 45: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Hypotheses for a given data set

Page 46: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LEARNING MACHINE

1. loss function L(y, f(X, w))

where:y – is the output produced by the system,X – is a set of inputs,f(X, w) – is the output produced by the learning

machine for a selected approximating function, andw – is the set of parameters in the approximating

functions.

2. risk functional R(w):

R(w) = L(y, f(X, w)) p(X, y) dX dy

= = = = = = == == = = = = = = === = = == = = = == = = == = = = = = == = = = = = = =1a) classification error:

0 if y = f(X, w)L(y, f(X, w)) =

1 if y ≠ f(X, w)

1b) loss function for regression is the squared error measure:

L(y, f(X, w)) = (y – f(X, w))2

Page 47: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

STATISTICAL LEARNING THEORY

Asymptotic consistency of the ERM:

RiskFunctional True (expected) risk

min R(w)

Empirical risk

Number of samples

Page 48: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GROWTH FUNCTION G(N)

G(n) h ( ln(n/h) + 1)

n ln2

h n

Page 49: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

STRUCTURAL RISK MINIMIZATION (SRM)

Structure on a set of approximating functions

== = = = == = == == == = = = = = = = = = == = = = == = = = = = = == = == = = = = =

SRM approach:

1) calculate or estimate VC-dimension for any element Sk of the structure,

2) minimize empirical risk for each element of the structure.

Sk

>>>…….Sk S2 S1

Page 50: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

SRM optimization strategy

Underfitting Overfitting

Error

Model complexity

Empirical and true risk as a function of h (model complexity)

Optimization:

1. Stochastic approximation (or gradient descent)2. Iterative methods 3. Greedy optimization

True

Empirical

Optimal Structure – VC Dimension

Page 51: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

STATISTICAL LEARNING THEORY

1. A wide, flexible set of approximating functions f(X, w).

2. apriori knowledge (or assumptions) used to impose constraints on a potential solution.

3. An inductive principle, or method of inference, specifies what to be done.

4. A learning method, namely a constructive, computational implementation of an inductive principle for a given class of approximating functions.

Page 52: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MAIN TYPES OF INDUCTIVE LEARNING

Environment X Teacher y

DesiredX f(X,w) response

Learning Environment Learningsystem Actual system

response y – f(X,w) X

Error signal

Supervised learning Unsupervised learning

-------___

Page 53: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MODEL ESTIMATION

a) Resubstitution Method

b) Holdout Method

c) Leave-one-out Method

d) Rotation Method (n-fold cross validation)

e) Bootstrap method

Page 54: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Confusion matrix for three classes

True class

Classification model 0 1 2 Total

0 28 1 4 331 2 28 2 322 0 1 24 25

Total 30 30 30 90

R = E / S = 10 / 90 = 0.11

A = 1 – R = 1 - 0.11 = 0.89 ( 89%)

Page 55: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

ROC curve

ROC curve shows the trade-off between sensitivity and 1-specificity values

FAR 1

0.5

0 0 0.2 0.4 0.6 0.8 1 1-FRR

Page 56: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

STATISTICAL INFERENCE

a) Estimation - one wants to come up with a plausible value or range of plausible values for the unknown system parameter.

Data set T is described by ordered n-tuples of values for variablesX= {X1, X2, …, Xn } (attributes of entities in population):

T = {(x11, …, x1n), (x21, …, x2n), …, (xm1, …, xmn)}

Output: Inputs: Y X , X* = X - Y Based on given X* estimate Y

Y numeric regression Y categorical classification

___________________ O _______________________________

b) Tests of hypotheses - one wants to decide whether a hypothesis concerning the value of the population characteristic should be accepted or rejected in the light of data set.

o null hypothesis H0

Page 57: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Assessing Data Sets

________________________________________________________________ n

1. mean = 1/n xi

i=1

n nmean = wi xi / wi

i=1 i=1

________________________________________________

x (n+1)/2 if n is odd2. median =

(x n/2 + x (n/2)+1 ) / 2 if n is even

________________________________________________

3. mode - is the value occurs most frequently in the set of data.

________________________________________________

n4. variance - 2 = ( 1 / (n-1) ) ( xi – mean ) 2

i=1

Page 58: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Assessing Data Sets

Given the data set : T = { 3, 5, 2, 9, 0, 7, 3, 6}

After sorting : T = {0, 2, 3, 3, 5, 6, 7, 9}

________________________________________________________________ n

1. mean = 1/n xi

i=1

= (0+2+3+3+5+6+7+9)/8 = 4.375________________________________________________

x (n+1)/2 if n is odd2. median =

(x n/2 + x (n/2)+1 ) / 2 if n is even

= (3+5)/2 = 4________________________________________________

3. mode - is the value occurs most frequently in the set of data.mode = 3

________________________________________________ n

4. variance - 2 = ( 1 / (n-1) ) ( xi – mean ) 2

i=1 8

2 = 1/7 ( xi – 4.375)2 = 8.5532 i=1

= 2.9246

Page 59: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Boxplot

Values 10Max

2 5

Mean-2

0 Min

Data set T

Page 60: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Bayesian Inference

Let X be a data sample whose class label is unknown.

Let H be some hypothesis, such as that the data sample X belongs to a specific class C.

P(H/X) = [P(X/H) P(H) ] / P(X)

Naïve Bayesian Classifier:

P(Ci/X) = [P(X/Ci) P(Ci) ] / P(X)

P(X/Ci) = P(xt / Ci) t= 1, …, n

Page 61: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Naïve Bayesian Classifier

Prior probabilities P(Ci):

P(C=1) = 4 / 7 = 0.5714P(C=2) = 3 / 7 = 0.4286

Conditional probabilities P(xt / Ci) for every attribute value:

P(A1=1 / C=1) = 2 / 4 = 0.50P(A1=1 / C=2) = 1 / 3 = 0.33

P(A2=2 / C=1) = 1 / 4 = 0.25P(A2=2 / C=2) = 2 / 3 = 0.66

P(A3=2 / C=1) = 1 / 4 = 0.25P(A3=2 / C=2) = 2 / 3 = 0.66

Conditional probabilities P(X/Ci):

P(X/C=1) = P(A1=1/C=1)P(A2=2/C=1)P(A3=2/C=1) =

= 0.50 0.25 0.25 = 0.03125

P(X/C=2) = P(A1=1/C=2)P(A2=2/C=2)P(A3=2/C=2) =

= 0.33 0.66 0.66 = 0.14375

______________________________________________P(C1 / X) P(X / C=1) P(C=1) = 0.03125 0.5714 = 0.0179P(C2 / X) P(X / C=2) P(C=2) = 0.14375 0.4286 = 0.0616

P(C2 / X) = Max{ P(C1 / X), P(C2 / X) } = Max{0.0179, 0.0616}

Page 62: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

REGRESSION

General linear model:

Y = + 1 X1 + 2 X2 + 3 X3 + …+ n Xn

Applying this equation to each of the given samples we obtain a new set of equations:

yj = + 1x1j + 2x2j + 3x3j + …+ nxnj + jj=1, …, m

Nonlinear regression (examples):

Y = + 1 X1 + 2 X2 + 3 X1 X3 + 4 X2 X3

Y = + 1 X + 2 X2 + 3 X3

Linearization of the regression model

Page 63: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Estimate the quality of linear regression model:

Correlation coefficient r :

r = ( Sxx / Syy) = Sxy / (Sxx Syy)

where: nSxx = (xi – meanx)2

i=1

nSyy = (yi – meany)2

i=1

nSxy = (xi – meanx) (yi – meany)

i=1

Page 64: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

ANOVA

The analysis of variance, or ANOVA, is primarily a method of identifying which of the ’s in a linear regression model are non-zero.

Y = + 1 X1 + 2 X2 + 3 X3 + …+ n Xn

The size of the residuals, for all m samples in a data set, is related to the size of variance 2, and it can be estimated by:

mS2 = [ ( yi – f(xi))2] / (m – (n – 1))

i=1

F-ratio or F-statistic test in a form:

F = Snew2 / Sold

2

For example:

Case Set of inputs Si2 F

1 x1, x2, x3 3.562 x1, x2 3.98 F21 = 1.12 X3 – redundant! 3 x1, x3 6.22 F31 = 1.75 (3 =0)4 x2, x3 8.34 F41 = 2.345 x1 9.02 F52 = 2.276 x2 9.89 F62 = 2.48

MANOVA (multivariate ANOVA).

Page 65: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LOGISTIC REGRESSION

Logistic regression - is modeling of categorical response variables using generalized linear regression model.

Rather than predicting the value of the dependent variable, the logistic regression method tries to estimate the probability p that the dependent variable will have a given value.

Suppose that output Y has two possible categorical values coded with 0 and 1.

Based on available data we can compute probabilities for both values for the given input sample:

P(yj=0) = 1- pj and

P(yj=1) = pj.

Linear logistic model - is the model that will fit these probabilities for accommodated linear regression:

log (pj /(1-pj)) = + 1X1j + 2X2j + 3X3j + …+ nXnj

log ( pj / (1-pj)) <=> logit(p)

Page 66: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LOGISTIC REGRESSION - example

Model:

logit(p) = 1.5 - 0.6 x1 + 0.4 x2 – 0.3 x3

New sample for classification:

{x1, x2, x3, Y} = {1, 0, 1, ?}

Classification:

logit(p) = 1.5 – 0.6 1 + 0.4 0 – 0.3 1 = 0.6

log ( p / (1-p)) = 0.6

p = p(Y=1) = e –0.6 / ( 1 + e –0.6) = 0.35

_____________________________________

Y=1 (with p=0.35) is less probable than the other categorical value Y=0 (with p=0.65)

Page 67: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LOG-LINEAR MODELS

Log-linear modeling is a way of analyzing the relationship between categorical (or quantitative) variables

Because all variables are categorical, we analyze possible associations between them using incidence matrices, also called contingency tables.

Example (2 X 2):

SupportYes No Total

Female 309 191 500 Sex

Male 319 281 600

Total 628 472 1100

Algorithm for feature association:

1. Transform given contingency table into a similar table, but instead of observed values we calculate expected values for the case when the variables are independent.

2. Compare the two matrices using squared distance measure, and chi-square test as a criteria of association for two categorical variables.

Page 68: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Linear regression with one input variableY = + X

Sum of squares of the errors n n n

SSE = ei2 = (yi – yi’)2 = ( yi - - xi)2

i=1 i=1 i=1

Differentiating SSE with respect to and , we have: n

(SEE) / = -2 ( yi - - xi) i=1

n (SSE) / = -2 (( yi - - xi) xi )

i=1

Setting the partial derivatives equal to zero (minimization of the total error):

n n n + xi = yi

i=1 i=1n n n

xi + xi2 = xi yi

i=1 i=1 i=1

Solving for and : n n

= [ (xi – meanx) (yi – meany) ] / [ (xi – meanx)2] i=1 i=1

= meany - meanx

Page 69: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Linear regression with one input variable(Example)

A B

B = + A

1 3 meanA=5 meanB = 67 9

10 11 = 0.8 = 1.044 53 2 B = 0.8 + 1.04 A

B B=0.8+1.04A

10

A10

Page 70: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LOG-LINEAR MODELS

Algorithm for feature association steps:

1.1 Denote the contingency table as X mn.

The row totals for the table are:n

Xj+ = Xji

i=1The column totals are:

mX+i = Xji

j=1The grand total is defined as a sum of row totals:

mX++ = Xj+

j=1or as a sum of column totals:

nX++ = X+i

i=1

1.2 Using these totals we can calculate the contingency table of expected values under the assumption that there is no association between the row variable and the column variable. The expected values are:

Eji = (Xj+ X+i) / X++ for j = 1, …, m, i = 1, …, n

2. Calculate 2 test. The bigger 2, the greater the evidence against H0 hypothesis.

m n2 = ((Xji – Eji)2 /Eji ) j=1 i=1

Page 71: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Feature’s association - example

22 contingency table for the 1100 samples survey

SupportYes No Total

Female 309 191 500 Sex

Male 319 281 600

Total 628 472 1100

22 contingency table of expected values

SupportYes No Total

Female 285.5 214.5 500 Sex

Male 342.5 257.5 600

Total 628 472 1100

m n2 = ((Xji – Eji)2 /Eji ) = 8.2816 j=1 i=1

d.f.(degrees of freedom) = (m-1)(n-1) = (2-1) (2-1) = 1

T(0.05) = 2 (1-, d.f.) = 2 (0.95, 1) = 3.84.

=================================2 = 8.2816 T(0.05) = 3.84

Page 72: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Hypothesis H0 is rejected; the attributes, analyzed in the survey, are with high level of dependency.

Page 73: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LINEAR DISCRIMINANT ANALYSIS (LDA)

The dependent variable (output) is categorical (nominal or ordinal), and the independent variables (inputs) are metric.

LDA - construct a discriminant function that yields different scores (z) when computed with data from different output classes. A linear discriminant function has the following form:

z = w1 x1 + w2 x2 + …+ wk xk

x2 x x x

x x x

x1

z = w1 x1 + w2 x2

z cut-ab = (za + zb) / 2

Geometric interpretation of the discriminant score

Page 74: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LINEAR DISCRIMINANT ANALYSIS (LDA)

Multiple discriminant analysis

INPUT

DISCRIMINANT SCORE #1

DISCRIMINANT SCORE #2

DISCRIMINANT SCORE #n

MAXIMASELECTOR OUTPUT

Page 75: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

SIMILARITY MEASURES

The word “similarity” in clustering means that the value of s(x, x’) is large when x and x’ are two similar samples; the value of s(x, x’) is small when x and x’ are not similar.

Similarity measure s is symmetric:

s(x, x’) = s(x’, x) , x, x’ X

Similarity measure is normalized:

0 s(x, x’) 1 , x, x’ X

Dissimilarity measure is denoted by d(x, x’) , x, x’ X, and it is frequently called a distance:

d(x, x’) 0, x, x’ X

d(x, x’) = d(x’, x), x, x’ X

d(x, x”) d(x, x’) + d(x’, x”), x, x’, x”X (triangular inequality)

Page 76: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

SIMILARITY/DISTANCE MEASURES

1. Euclidean distance in m-dimensional feature space: m

d2(xi, xj) = ( (xik – xjk )2) ½ k=1

2. L1 metric or city block distance: m

d1(xi, xj) = xik –xjk k=1

3. Minkowski metric (includes the Euclidean distance and city block distance as special cases):

mdp(xi, xj) = ( (xik – xjk )p) 1/p

k=1

4. Cosine-correlation: m m m

scos(xi, xj) = [ (xik xjk )] / [ xik2 xjk

2]1/2

k=1 k=1 k=1

scos(xi, xj) = 1 i, j and > 0 where xi = xj

scos(xi, xj) = -1 i, j and < 0 where xi = xj

Page 77: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

SIMILARITY/DISTANCE MEASURES (example)

For 4-dimensional vectors

x1 = {1, 0, 1, 0} and x2 = {2, 1, -3, -1}

these distance measures are:

1. Euclidean distance in m-dimensional feature space:

d2(xi, xj) = (1 + 1 + 16 + 1)1/2 = 4.36

2. L1 metric or city block distance:

d1(xi, xj) = 1 + 1 + 4 + 1 =7

3. Minkowski metric (for p=3):

d3(xi, xj) = (1 + 1 + 64 + 1)1/3 = 4.06

4. Cosine-correlation:

scos(xi, xj) = (2 + 0 – 3 + 0) / ( 2 ½ 15 ½ ) = -0.18

Page 78: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

SIMILARITY/DISTANCE MEASURES

5. Distance measure for n-dimensional vectors with binary data:

Use the 2 2 contingency table for samples xi and xj:xj

1 0

1 a b

xi

0 c d

a) Simple Matching Coeficient (SMC):

ssmc(xi, xj) = (a + d) / (a + b + c + d)

b) Jaccard Coefficient:

sjc(xi, xj) = a / (a + b + c )

c) Rao’s Coefficient:

src(xi, xj) = a / (a + b + c + d)

Example: For xi = {0,0,1,1,0,1,0,1} and xj = {0,1,1,0,0,1,0,0} parameters are

a = 2, b = 2, c = 1, and d = 3

and similarity measures: ssmc(xi, xj) = 5/8, sjc(xi, xj) = 2/5, and src(xi, xj) = 2/8

Page 79: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 80: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

SIMILARITY/DISTANCE MEASURES

6. MUTUAL NEIGHBOR DISTANCE (MND):

The similarity between two points xi and xj is:

MND(xi, xj) = NN(xi, xj) + NN(xj, xi)

where:

NN(xi, xj) is the neighbor number of xj with respect to xi.

o If xi is the closest point to xj then NN(xi, xj) is equal to 1,

if it is the second closest point to xj then NN(xi, xj) is equal to 2,

etc.

NN=3 xj NN=1

NN=3 NN=1

xj NN=2

NN=2

Page 81: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MUTUAL NEIGHBOR DISTANCE (MND):x2

C

B

Ax1

NN(A, B) = NN(B, A) = 1 MND(A, B) = 2

NN(B, C) = 1, NN(C, B) = 2 MND(B, C) = 3__________________________________________________

A and B are more similar than B and C using MND measure

__________________________________ 0______________________________x2

C

B

D A F E x1

NN(A, B) = 1, NN(B, A) = 4 MND(A, B) = 5NN(B, C) = 1, NN(C, B) = 2 MND(B, C) = 3

_______________________________________________________After changes in the context, B and C are more similar than A and B using MND measure

Page 82: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DISTANCE MEASURE BETWEEN CLUSTERS (set of samples)

1) Dmin (Ci, Cj) = min pi - pj

where pi Ci and pj Cj.

2) Dmean (Ci, Cj) = mi – mj

where mi and mj are centriods of Ci and Cj.

3) Davg (Ci, Cj) = 1/(ni nj) pi - pj

where pi Ci and pj Cj, and ni and nj are the numbers of samples

in clusters Ci and Cj.

4.) Dmax ( Ci, Cj) = max pi - pj

where pi Ci and pj Cj.

Page 83: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

CLUSTERING ALGORITHMS

1. HIERARCHICAL CLUSTERING

1.1 Divisible algorithms

1.2 Agglomerative algorithms

single-link or

complete-link

Single-link distance Complete-link distance

2. PARTITIONAL CLUSTERING (ITERATIVE SQUARE-ERROR BASED)

2.1 K-means partitional clustering algorithm

2.1.1 K-nearest neighbor

2.2 Incremental clustering

Cluster 1 Cluster 1

Cluster 2Cluster 2

Page 84: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

AGGLOMERATIVE CLUSTERING ALGORITHM

1. Place each sample in its own cluster. Construct the list of inter-cluster distances for all distinct unordered pairs of samples, and sort this list in ascending order.

2. Step through the sorted list of distances, forming for each distinct threshold value dk a graph of the samples where pairs of samples closer than dk are connected into a new cluster by a graph edge. If all the samples are members of a connected graph, stop. Otherwise, repeat this step.

3. The output of the algorithm is a nested hierarchy of graphs, which can be cut at a desired dissimilarity level forming a partition (clusters) identified by simple connected components in the corresponding sub-graph.

Example:

x1 = (0, 2), x2 = (0, 0), x3 = (1.5, 0), x4 = (5, 0), x5 = (5, 2).

Page 85: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

K-means partitional clustering algorithm

Suppose that the given set of N samples in n-dimensional space has to be partitioned into K clusters {C1, C2, …, Ck}.

1. Select an initial partition with K clusters containing randomly chosen samples, and compute centroids of the clusters:

nk

Mk = (1/nk) xik (centroid of each cluster) i=1

nk

ek2 = (xik – Mk)2 (within-cluster variation)

i=1

K Ek

2 = ek2 (the total square-error)

k=1

2. Generate a new partition by assigning each sample to the closest cluster center.

3. Compute new cluster centers as the centroids of the clusters.

4. Repeat steps 2 and 3 until an optimum value of the criterion function is found (or until the cluster membership stabilizes).

Page 86: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

K-means partitional clustering algorithm(Example)

Data: x1 = (0, 2), x2 = (0, 0), x3 = (1.5, 0), x4 = (5, 0) , x5 = (5, 2).

2. Random distribution of samples:

C1 = {x1, x2, x4} and C2 = {x3, x5}

3. Centriods:

M1 = {(0+0+5)/3, (2+0+0)/3} = {1.66, 0.66}

M2 = {(1.5+5)/2, (0+2)/2} = {3.25, 1.00}

Within-cluster variations:

e12 =[(0-1.66)2+(2-0.66)2] + [(0-1.66)2 + (0-0.66)2]+[(5-1.66)2+ (0-0.66)2]

= 19.36

e22 = [(1.5-3.25)2 + (0-1)2] + [(5-3.25)2 + (2-1)2]

= 8.12

Total square error:

E2 = e12 + e2

2 = 19.36 + 8.12 = 27.48

Page 87: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

K-means partitional clustering algorithm(Example)

Reassign all samples:

d(M1, x1) = 2.14 and d(M2, x1) = 3.40 x1 C1

d(M1, x2) = 1.79 and d(M2, x2) = 3.40 x2 C1

d(M1, x3) = 0.83 and d(M2, x3) = 2.01 x3 C1

d(M1, x4) = 3.41 and d(M2, x4) = 2.01 x4 C2

d(M1, x5) = 3.60 and d(M2, x5) = 2.01 x5 C2

New clusters:

C1 = {x1, x2, x3} and C2 = {x4, x5}

New centroids:

M1 = {0.5, 0.67}

M2 = {5.0, 1.0}

Errors:e1

2 = 4.17

e22 = 2.00

E2 = 6.17

Page 88: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

INCREMENTAL CLUSTERING

2. Assign the first data item to the first cluster.

3. Consider the next data item. Either assign this item to one of the existing clusters or assign it to a new cluster. This assignment is done based on some criterion, e.g. the distance between the new item and the existing cluster centroids. In that case, after every addition of a new item to an existing cluster recompute a new value for the centroid.

4. Repeat previous step 2 till all the data samples are clustered.

The space requirements of incremental algorithm are very small; only for centroids of the clusters.

If these algorithms are noniterative, their time requirements are also small.

Even if we introduce iterations into an incremental clustering algorithm, computational complexity and corresponding time requirements do not increase significantly.

Page 89: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Do not satisfy: order-independence.

INCREMENTAL CLUSTERING(Example)

Data: x1 = (0, 2), x2 = (0, 0), x3 = (1.5, 0), x4 = (5, 0) , x5 = (5, 2).Threshold: = 3

_____________________________________________________________1. First sample x1 will become first cluster C1 = {x1}

-> centroid M1 = {0, 2}.

2. Start analysis of other samples:

2.1 Second sample x2 is compared with M1:

d(x2, M1) = (02 + 22)1/2 = 2.0 < 3Therefore, x2 C1. New centroid will be: M1 = {0, 1}

2.2 Third sample x3 is compared with the centroid M1 (still the only centroid!):

d(x3, M1) = (1.52 + 12) ½ = 1.8 < 3x3 C1 C1 = {x1, x2, x3} M1 = {0.5, 0.66}

2.3 Fourth sample x4 is compared with the centroid M1:

d(x4, M1) = (4.52 + 0.662)1/2 = 4.55 > 3C2 = {x4} with the new centroid M2 = {5, 0}.

2.4 Fifth example x5 is comparing with both cluster centroids:

d(x5, M1) = (4.52 + 1.442) ½ = 4.72 > 3d(x5, M2) = (02 + 22)1/2 = 2 < 3

C2 = {x4, x5} M2 = {5, 1}

3. All samples are analyzed and a final clustering solution:

Page 90: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C1 = {x1, x2, x3} and C2 = {x4, x5}

Page 91: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

K-nearest neighbor

APPLIED FOR CATEGORICAL DATA

1. The distances between new sample and all previous samples, already classified into clusters, are computed.

2. The distances are sorted in increasing order, and K samples with smallest distance values are selected.

3. Voting principle is applied:

New sample will be added (classified) to the cluster that belongs to the largest number out of K selected samples.

Page 92: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

K-nearest neighbor(Example)

Given six 6-dimensional categorical samples:

X1 = { A, B, A, B, C, B}X2 = {A, A, A, B, A, B} C1

X3 = {B, B, A, B, A, B}X4 = {B, C, A, B, B, A}X5 = {B, A, B, A, C, A} C2

X6 = {A, C, B, A, B, B}

clustered into two clusters C1 = {X1, X2, X3} and C2 = {X4, X5, X6}.

Classify the new sample: Y = {A, C, A, B, C, A} _____________________________________________________________________

1. Using SMC measure:

Similarities with elements in C1 Similarities with elements in C2

SMC(Y, X1) = 4/6 = 0.66 SMC(Y, X4) = 4/6 = 0.66SMC(Y, X2) = 3/6 = 0.50 SMC(Y, X5) = 2/6 = 0.33SMC(Y, X3) = 2/6 = 0.33 SMC(Y, X6) = 2/6 = 0.33

2. Using 1-nearest neighbor rule (K = 1) new sample cannot be classified because there are two samples (X1 and X4) with the same, highest similarity (smallest distances), and one of them is in the class C1 and the other in the class C2.

2a. Using 3-nearest neighbor rule (K = 3), and selecting three largest similarities in the set, we can see that two samples (X1 and X2) belong to class C1, and only one sample to class C2.

3. Using simple voting system: Y C1 class.

Page 93: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DECISION TREES

Efficient method for producing classifiers from data (logic method).

Supervised learning methods that construct decision trees from a set of input-output samples

It guarantees that a simple, but not necessarily the simplest, tree is found

A decision tree consists of nodes that are tests on the attributes.

The outgoing branches of a node correspond to all the possible outcomes of the test at the node.

Leafs are sets of samples that belong to the same class

Yes No

Y=A Y=B Y=C

Class1 Class2 Class2 Class1

X>1

1X>1

Y=?

Y=?

Page 94: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 95: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

DECISION TREE ALGORITHMS

Requirements:

1. Attribute-value description

2. Predefined classes

3. Discrete classes

4. Sufficient data

5. “Logical” classification models

Examples: CLS

ID3

C4.5 (C5.0)

Page 96: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm

Let the classes be denoted {C1, C2,…, Ck}. There are three possibilities for the content of the set of training samples T in the given node of decision tree:

1. T contains one or more samples, all belonging to a single class Cj. The decision tree for T is a leaf identifying class Cj.

2. T contains no samples. The decision tree is again a leaf, but the class to be associated with the leaf must be determined from information other than T, such as the overall majority class in T. C4.5 algorithm uses as a criterion the most frequent class at the parent of the given node.

3. T contains samples that belong to a mixture of classes. In this situation, the idea is to refine T into subsets of samples that are heading towards single-class collections of samples. An appropriate test is chosen, based on single attribute, that has one or more mutually exclusive outcomes {O1, O2, …,On}:

T is partitioned into subsets T1, T2, …, Tn where Ti contains all the samples in T that have outcome Oi of the chosen test. The decision tree for T consists of a decision node identifying the test and one branch for each possible outcome.

Page 97: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm

TEST - entropy:

If S is any set of samples, let freq(Ci, S) stand for the number of samples in S that belong to class Ci (out of k possible classes), and S denotes the number of samples in the set S. Then the entropy of the set S:

kInfo(S) = - ( (freq(Ci, S)/ S) log2 (freq(Ci, S)/ S))

i=1

After set T has been partitioned in accordance with n outcomes of one attribute test X:

nInfox(T) = - ((Ti/ T) Info(Ti))

i=1

Gain(X) = Info(T) - Infox(T)

Criterion: select an attribute with the highest Gain value.

Page 98: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm(Example)

Database T:

Attribute1 Attribute2 Attribute3 Class

A 70 True CLASS1A 90 True CLASS2A 85 False CLASS2A 95 False CLASS2A 70 False CLASS1B 90 True CLASS1B 78 False CLASS1B 65 True CLASS1B 75 False CLASS1C 80 True CLASS2C 70 True CLASS2C 80 False CLASS1C 80 False CLASS1C 96 False CLASS1

Info(T) = -9/14 log2 (9/14) -5/14 log2 (5/14) = 0.940 bits

Attribute1: Infox1(T) = 5/14 (-2/5 log2 (2/5) – 3/5 log2 (3/5))======== + 4/14 (- 4/4 log2 (4/4) - 0/4 log2 (0/4))

+ 5/14 (-3/5 log2 (3/5) – 2/5 log2 (2/5))

= 0.694 bits

Gain (x1) = 0.940 – 0.694 = 0.246 bits

Attribute3: Infox2(T) = 6/14 (-3/6 log2 (3/6) – 3/6 log2 (3/6))======== + 8/14 (- 6/8 log2 (6/8) - 2/8 log2 (2/8))

= 0.892 bits

Gain (x2) = 0.940 – 0.892 = 0.048 bits

Page 99: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm

C4.5 contains mechanisms for proposing three types of tests:

a) The “standard” test on a discrete attribute, with one outcome and branch for each possible value of that attribute.

b) If attribute Y has continuous numeric values, a binary test with outcomes YZ and Y>Z could be defined, based on comparing the value of the attribute against a threshold value Z.

c) A more complex test based on a discrete attribute, in which the possible values are also allocated to a variable number of groups with one outcome and branch for each group.

___________________________________

b*) Threshold value Z:

The training samples are first sorted on the values of the attribute Y being considered. There are only a finite number of these values, so let us denote them in sorted order as {v1, v2, …, vm}.

Any threshold value lying between vi and v i+1 will have the same effect of dividing the cases into those whose value of the attribute Y lies in {v1, v2, …, vi} and those whose value is in {v i+1, v i+2, …, vm}. There are thus only m-1 possible splits on Y, all of which should be examined systematically to obtain an optimal split.

It is usual to choose the midpoint of each interval: (vi +v i+1)/2 as the representative threshold. C4.5 chooses as the threshold a smaller value vi for every interval {vi, v i+1}, rather than the midpoint itself.

Page 100: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm(Example)

Attribute2:After a sorting process, the set of values is:

{65, 70, 75, 78, 80, 85, 90, 95, 96},

and the set of potential threshold values Z is:

{65, 70, 75, 78, 80, 85, 90, 95}.

The optimal Z value is Z=80 and the corresponding process of information gain computation for the test x3 (Attribute2 80 or Attribute2 > 80).

Infox3(T) = 9/14 ( -7/9 log2 (7/9) – 2/9 log2 (2/9)) + 5/14 ( -2/5 log2 (2/5) – 3/5 log2 (3/5)) = 0.837 bits

Gain(x3) = 0.940 - 0.837 = 0.103 bits

====================

Attribute1 gives the highest gain of 0.246 bits, and therefore this attribute will be selected for the first splitting.

Page 101: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm

Gain criterion has a serious deficiency: a strong bias in favor of tests with many outcomes.

Solution was found in some kind of normalization:

nSplit-info(X) = - ((Ti/ T) log2 (Ti/ T))

i=1

Gain-ratio(X) = Gain(X) / Split-info(X)

_________________

Example:

Split-info(x1) = - 5/14 log2 (5/14) – 4/14 log2 (4/14) - 5/14 log2 (5/14) = 1.577 bits

Gain-ratio(x1) = 0.246 / 1.557 = 0.156

Page 102: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm(UNKNOWN VALUES)

In C4.5 it is an accepted principle that samples with unknown values are distributed probabilistically according to the relative frequency of known values.

The new gain criterion will have the form:Gain(x) = F ( Info(T) – Infox(T))

F = number of samples in database with known value for a given attribute / total number of samples in a data set

Database T:

Attribute1 Attribute2 Attribute3 Class

A 70 True CLASS1A 90 True CLASS2A 85 False CLASS2A 95 False CLASS2A 70 False CLASS1? 90 True CLASS1B 78 False CLASS1B 65 True CLASS1B 75 False CLASS1C 80 True CLASS2C 70 True CLASS2C 80 False CLASS1C 80 False CLASS1C 96 False CLASS1

Info(T) = -8/13 log2 (8/13) -5/13 log2 (5/13) = 0.961 bits

Infox1(T) = 5/13 (-2/5 log2 (2/5) – 3/5 log2 (3/5))+ 3/13 (-3/3 log2 (3/3) – 0/3 log2 (0/3))+ 5/14 (-3/5 log2 (3/5) –2/5 log2 (2/5)) = 0.747 bits

Gain (x1) = 13/14 (0.961 – 0.747) = 0.199 bits

Split-info(x1) = - (5/13 log(5/13) + 3/13 log(3/13) + 5/13 log(5/13) + 1/13 log(1/13)) = 1.876

Page 103: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 algorithm(UNKNOWN VALUES)

When a case of T with known value is assigned to subset T i, its probability belonging to Ti is 1, and in all other subsets is 0.

C4.5 therefore associate with each sample (having missing value) in each subset Ti a weight w representing the probability that the case belongs to each subset.

wnew = w old P(Ti)

Splitting set T using test x1 on Attribute1. New weights wi

will be equal to probabilities in this case: 5/13, 3/13, and 5/13, because initial (old) value for w is equal to one.

T1 = 5+5/13, T2 = 3 +3/13, and T3 = 5+5/13.

The decision tree leafs are defined with two new parameters: (Ti/E).

Ti is the sum of the fractional samples that reach the leaf, and E is the number of samples that belong to classes other than nominated class.

Page 104: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

PRUNING DECISION TREES

Discarding one or more subtrees and replacing them with leaves simplify decision trees and that is the main task in decision tree pruning:

Prepruning

Postpruning

C4.5 follows a postpruning approach (pessimistic pruning).

? CLASS1 (16, 1)

A=1 A=2 A=3

CLASS1 (6, 0) CLASS1 (9, 0) CLASS2 (1,0)

Using default confidence of 25%, upper confidence limits for all nodes are collected from statistical tables:

U25%(6,0) = 0.206, U25%(9,0) = 0.143, U25%(1,0) = 0.750, and U25%(16,1) = 0.157.

Predicted errors for the initial tree and replaced node are:

PEtree = 6 0.206 + 9 0.143 + 1 0.750 = 3.257PEnode = 16 0.157 = 2.512

Since PEtree > PEnode replace the subtree with the new leaf node.

X1 A=?

Page 105: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

C4.5 ALGORITHM: GENERATING DECISION RULES

ROOT If A=1 and B=1X1: A Then CLASS1

A=1 A=2 Transformation If A=1 and

B=2X2: B CLASS1 ========= Then CLASS2

Paths into Rules B=1 B=2 If A=2

Then CLASS1CLASS1 CLASS2

a) Decision tree b) Decision rules

Decision rules for database T:

If Attribute1 = A and Attribute2 <= 70Then Classification = CLASS1(2.0 / 0);

If Attribute1 = A and Attribute2 > 70Then Classification = CLASS2 (3.4 / 0.4);

If Attribute1 = BThen Classification = CLASS1(3.2 / 0);

If Attribute1 = C and Attribute3 = TrueThen Classification = CLASS2 (2.4 / 0);

If Attribute1 = C and Attribute3 = FalseThen Classification = CLASS1(3.0 / 0).

Page 106: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Limitations of decision trees and decision rules

x2 Classification through a linear combination of attributes

Rules as orthogonal hyperplanes

x1

Given class is supported if n out of m conditions are presented. To represent this classifier with rules, it would be necessary to define ( m n) regions only for one class:

Medical diagnostic: If 4 out of 11 symptoms support diagnosis of a given disease, then the corresponding classifier will generate 330 regions in 11-dimensional space for positive diagnosis only. That corresponds to 330 decision rules.

Introducing new attributes, rather than removing old ones, can avoid sometimes-intensive fragmentation of the n-dimensional space.

Page 107: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

CMAR (Classification based on Multiple Association Rules)

Adopted from the FP-growth

Phases:

4. rule generation or training (R: Pc, such that sup(R ) and conf( R ) pass the given thresholds), and

5. classification or testing phase (predict the classification of the new sample).

Training database T for CMAR algorithm (the support threshold is 2 and the confidence threshold is 70%).

ID A B C D Class01 a1 b1 c1 d1 A02 a1 b2 c1 d2 B03 a2 b3 c2 d3 A04 a1 b2 c3 d3 C05 a1 b2 c1 d3 C

F-list = (a1, b2, c1, d3)

FP-tree is a prefix tree with respect to F-list

Page 108: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

CMAR (Classification based on Multiple Association Rules)

Non-merged FP-tree FP-tree after merging d3 nodes

ROOT ROOT

a1 d3

a1 A=1

c1 b2

c1 b2 A=1A=1 C=1

c1 d3 c1

B=1 C=1 B=1, C=1

d3

C=1

Rules subsets: a) The rules having d3 value; b) The rules having c1 but no d3; c) The rules having b2 but no d3 nor c1; and d) The rules having only a1.

d3-projected samples: (a1, b2, c1, d3):C, (a1, b2, d3):C, and (d3):

Rule: A(a1, b2, d3) C (support = 2, confidence=100%)

Page 109: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

(a1, c1) is a frequent pattern with support 3, but all rules are with confidence less than threshold value. Similar conclusions are for pattern (a1, b2), and finally for (a1).

MARKET BASKET ANALYSIS A market basket is a collection of items purchased by a customer

in an individual customer transaction.

Database DB:

TID Items

001 A C D002 B C E003 A B C E004 B E

RULES & MEASURES

The association rule X Y holds in the transaction set DB with confidence c if c% of transactions in D that contain X also contain Y.

The association rule X Y has support s in the transaction set D if s% of transactions in DB contain X Y.

ASSOCIATION RULES MINING PROCES:

1. Discover the large itemsets, i.e., the sets of items that have transaction support s above a pre-determined minimum threshold.

Page 110: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

2. Use the large itemsets to generate the association rules for the database that have confidence c above pre-determined minimum threshold.

Page 111: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Algorithm apriori

Finds all frequent itemsets in DB.

o Works iteratively: 1-itemsets, 2-itemsets, etc.

o Iteration i computes all frequent i-item sets (item sets with i elements). Ith iteration is the last one if there is no frequent I+1 item sets.

o Each of the iterations has two steps:

candidate generation, and

candidate counting and selection.

Page 112: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

From frequent itemsets to association rules

Process:1. For the rule in a form of implication: {x1, x2, x3} x4, it is

necessary that both, itemsetsets {x1, x2, x3, x4} and {x1, x2, x3} are frequent.

2. The confidence c of the rule is computed as quotient of supports for itemsets: c=s(x1,x2,x3,x4)/s(x1,x2,x3).

Example:Check is the association rule: {B, C} E a strong rule?

We select corresponding supports from tables L2 and L3:

s(B, C) = 2 , s(B, C, E) =2

and using these supports we compute the confidence of the rule:

c({B, C} E) = s(B, C, E) / s(B, C) = 2/2 = 1 (or 100%)

To filter out misleading associations:

s(A, B) / s(A) – s(B) > d

Page 113: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Improving the efficiency of the apriori algorithm

1. Partition based apriori

2. Sampling based apriori

3. Incremental updating techniques

4. Concept level associations

is-a hierarchy on database items

Page 114: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FREQUENT PATTERN GROWTH METHOD (FTP-growth)

Example: Given minimum support threshold of 3 and transactional database T:

TID Itemset01 f, a, c, d, g, i, m, p02 a, b, c, f, l, m, o03 b, f, h, j, o04 b, c, k, s, p05 a, f, c, e, l, p, m, n

First scan of database T derives a list L:

L = {(f,4), (c,4), (a,3), (b,3), (m,3), (p,3)}.

The root of the tree, labeled with ROOT is created.

Scan the database T second time.

o The scan of the first transaction leads to the construction of the first branch of the FP-tree:

{(f,1), (c,1), (a,1), (m,1), (p,1)}.

For the second transaction: since it shares common items, f, c, and a, it shares the common prefix {f, c, a} with the previous branch, and extends to the new branch:

{(f, 2), (c, 2), (a, 2), (m, 1), (p, 1)}.

Page 115: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FREQUENT PATTERN GROWTH METHOD

ROOT ROOT

f, 2 f, 4c, 1

c, 2 c, 3 b, 1b, 1

a, 2 a, 3p, 1 Header

m, 1 b, 1 : m, 2 b, 1

b p, 1 m, 1 p, 2 m, 1

a) FP-tree after two samples b) Final FP-tree

FP-tree for the database T

To facilitate tree traversal, an item header table is built, in which each item in L list connects nodes in FP-tree with the same item value through node-links.

According to the list of frequent items L, the complete set of frequent itemsets can be divided into subsets (6 for our example) without overlap:

1) frequent itemsets having item p (the end of L list); 2) the itemsets having item m but no p; 3) the frequent itemsets with b and without both m and p; …; 6) the large itemsets only with f.

Page 116: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 117: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FREQUENT PATTERN GROWTH METHOD

1.) For our example, two paths are selected in the FP-tree:

{(f,4), (c,3), (a,3), (m,2), ((p,2)} and {(c,1), (b,1), (p,1)},

where samples with a frequent item p are {(f,2), (c,2), (a,2), (m,2), ((p,2)} and {(c,1), (b,1), (p,1)}. Given threshold value (3) satisfies only frequent itemset

{(c,3), (p,3)}, or simplified {c, p}.

2.) Next subset of frequent itemsets are these with m and without p. FP-tree recognizes paths:

{(f,4), (c,3), (a,3), (m,2)} and {(f,4), (c,3), (a,3), (b,1), (m,1)},

or corresponding accumulated samples: {(f,2), (c,2), (a,2), (m,2)} and {(f,1), (c,1), (a,1), (b,1), (m,1)}. Analyzing samples we discover frequent itemset

{(f,3), (c,3), (a,3), (m,3)} or simplified {f, c, a, m}.

Repeating the same process for subsets 3) to 6) in our example, additional frequent itemsets could be mined. In our example these are itemsets {f, c, a} and {f, c} , but they are already subsets of the frequent itemset {f, c, a, m}.Therefore the final solution of the FP-growth method is the set of frequent itemsets, which is in our example:

{ {c, p}, {f, c, a, m} } ____________________

FP-growth algorithm is about an order of magnitude faster than apriori algorithm.

Page 118: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MULTIDIMENSIONAL ASSOCIATION RULES MINING

DB schema : (ID, A1, A2,…, An, items)

ID A1 A2 A3 items01 a 1 m x, y, z02 b 2 n z, w03 a 2 m x, z, w04 c 3 p x, w

Multi-dimensional transactional database DB

1.1 Sort all tuples in the database in alphabetical order of values for the first dimension (A1). The only MD-pattern find for this dimension is (a, *, *).

1.2 Select tuples in a database with found MD-pattern (or patterns). In our database t here are samples with ID values 01 and 03.

1.3 Reduced database sort again with respect to the second dimension (A2), where values are 1 and 2, and there is no MD-patterns above the threshold.

1.4 Selected tuples in a database are sorted in alphabetic order of values for the third dimension (in our example A3). A sub-group (a, *, m) is contained in two tuples and it is MD-pattern.

2. Repeat the processes in step 1 only starting with the second dimension, and then third dimension, etc.

Page 119: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MULTIDIMENSIONAL ASSOCIATION RULES MINING

ROOT

(A1, *, *) (*, A2, *) (*, *, A3)

(A1, A2, *) (A1, * , A3) (*, A2, A3)

(A1, A2, A3)

MD-patterns : (a, *, m) , (*, 2, *)

SECOND PHASE:

ONE OF STANDARD ASSOCIATION RULES MINING ALGORITHMS APPLIED ON SUBSETS OF DATABASE CONTAINING MD-PATTERNS.

Page 120: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

WEB MINING

Four subtasks of Web mining:

1. Resource finding – is the process of retrieving the data.

2. Information selection and pre-processing – is the process of different kind of transformation of the original data retrieved.

3. Generalization – is a process of automatically discovering general patterns at individual Web sites as well as across multiple sites.

4. Analysis- this is a phase in which validation and/or interpretation of the mined patterns is performed.

______________________________________

Factors affecting Web mining process:

i. Web page content,

ii. Web page design, and

iii. Overall site design including its structure.

Page 121: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

WEB MINING

Three areas of Web mining:

1. Web content mining - describes the discovery of useful information from the Web documents.

2. Web structure mining - tries to discover the model underlying the link structure on the Web.

3. Web usage mining - tries to make sense of the data generated by the Web surfer’s sessions or behaviors.

Page 122: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

HITS algorithm

Two types of important pages:

authorities, which provide the best source of information on a given topic, and

hubs, which provide collections of links to authorities.

Two main steps of the HITS algorithm are:

1. sampling component, which constructs a focused collection of Web pages likely to be rich in relevant information, and

2. weight-propagation component, which determines estimates of hubs and authorities by an iterative procedure, and obtain the subset of most relevant and authoritative Web pages.

Page 123: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

HITS algorithm

BASIC IDEAS:

We associate a nonnegative authority weight ap and a nonnegative hub weight hp with each page p V.

If page is pointed to by many good hubs, we update the value of ap for the page p, to be the sum of hq over all pages q that link to p:

ap = hq , q such that qp

where the notation qp indicates that page q links to page p.

In a strictly dual fashion, if a page points to many good authorities, we increase its hub weight:

hp = aq , q such that pq.

Page 124: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

HITS algorithm

FORMALIZATION:

Let us number the pages {1,2,…, n} and define their adjacency matrix A to be n n matrix whose (i, j) th element is equal to 1 if page i links to page j, and is 0 otherwise.

All pages at the beginning of the computation are both hubs and authorities:

a = { a1, a2, …, an} and h = {h1, h2, …, hn}

Update rules for authorities and hubs can be written in a form:

a = AT hh = A a

or substituting one into another relation:

a = AT h = AT A a = ( AT A ) a h = A a = A AT h = ( A AT ) h

These are relations for iterative computation of vectors a and h.

Page 125: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

HITS algorithm

Initialization of HITS algorithm:

1 0 0 0 1 1 1 0 0 0 1 1 0

A = 0 0 0 0 1 00 0 0 0 0 0 0 0 0 0 0 00 0 1 0 0 0

a = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1}h = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1}

Subgraph of the linked pages Adjacency matrix A and weight vectors

_______________________________________

First iteration:

0 0 0 0 0 0 0 0 0 1 1 1 0.10 0 0 0 0 0 0 0 0 1 1 0 0.1

a = 0 0 0 0 0 1 0 0 0 0 1 0 0.1 =1 1 0 0 0 0 0 0 0 0 0 0 0.11 1 1 0 0 0 0 0 0 0 0 0 0.11 0 0 0 0 0 0 0 1 0 0 0 0.1

= [ 0 0 0.1 0.5 0.6 0.3 ]

0 0 0 1 1 1 0 0 0 0 0 0 0.10 0 0 1 1 0 0 0 0 0 0 0 0.1

h = 0 0 0 0 1 0 0 0 0 0 0 1 0.1 =0 0 0 0 0 0 1 1 0 0 0 0 0.10 0 0 0 0 0 1 1 1 0 0 0 0.10 0 1 0 0 0 1 0 0 0 0 0 0.1

= [ 0.6 0.5 0.3 0 0 0.1 ]______________________________________________________________

Document-5 has the most authority, and Document-1 is the best hub.

1 2

3

45

6

Page 126: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LOGSOM algorithm

We assume that there is a finite set of unique URLs :

U = {url1, url2, …, urln}

and a finite set of m user transactions:

T = {t1, t2, …, tm}.

Transactions are represented as a vector with binary values ui:

t = [u1, u2, …, un]

where 1 if urli t

ui = 0 otherwise

Pre-processed log file can be represented as a binary matrix:

url1 url2 … urln

t1 0 1 1t2 1 1 0

…tm 0 0 0

Page 127: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LOGSOM algorithm

TRANSFORMATIONS:

1. Representing URLs as vectors of transaction group activity:

Transaction Groups

1 2 … k

url1 15 0 2url2 2 1 10…urln 0 1 2

2. SOM generated by URLs descriptions:

1 2 3 … p

1 2 1 15 2 3 1 10 …

p 54 … 11

______________________________________________________

Page 128: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

The SOM organize web pages into similar classes based on users’ navigation patterns.

Page 129: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MINING PATH TRAVERSAL PATTERNS

Capturing user access patterns in Web environment is referred to as mining path traversal patterns.

a) Convert the original sequence of log data into a set of traversal subsequences.

Filter out the effect of backward references, which are mainly made for easy of traveling.

The new reduced set of user-defined forward paths enables us to concentrate on mining meaningful user access sequences.

Each traversal subsequence represents a maximum forward reference from the starting point of a user access.

b) Determine the frequent traversal patterns, termed large reference sequences.

A large reference sequence is a sequence that appeared a sufficient number of times in the log database.

Form the maximal references obtained from large reference sequences:A maximal large sequence is a large reference sequence that is not contained in any other maximal reference sequence.

Page 130: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MINING PATH TRAVERSAL PATTERNS

EXAMPLE:

Path = {A B C D C B E G H G W A O U O V}

A

B O

C E U V

D G

H W

_______________________________________________

1. MFR = {ABCD, ABEGH, ABEGW, AOU, AOV}.

If the threshold value is 0.4 (or 40%), large reference sequences LRS with lengths 2, 3, and 4 are:

_______________________________________

2. LRS = {AB, BE, EG, AO, BEG, ABEG}

_______________________________________

3. Maximal reference sequences are:

MRS = {ABEG, AO}.

Page 131: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TEXT MININGTwo key technologies:

1. Internet searching capabilities, and

2. Text analysis methodology.

1. In the information retrieval (IR) domain, documents have been traditionally represented in the vector space model using keywords in text documents. Documents are vectors in this n-dimensional space.

If a keyword t occurs n times in document d, then the t-th coordinate of d is simply n. One may choose to normalize the length of the document to 1, using the L1, L2, or L norms:

d1 = n(d,t),

t

d2 = n(d,t)2 ,t

d = max t n(d,t)

If t occurs in nt out of N documents, nt/N gives sense of rarity, hence, importance of the term.

The inverse document frequency: IDF= 1 + log (nt/N)

is used to stretch the axes of the vector space differentially. Thus the t-th coordinate of document d may be represented with the value

( n(d,t) / d1 ) IDF(t) in the weighted vector space model.

Page 132: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

2. Text analysis methodology

Content-based analysis and partition of documents is a more complicated problem. No standards or common theoretical background have been established in the domain.

Generally, you can think of text categorization as comparing a document to other documents or to some predefined set of terms or definitions. This idea is analogous to the type of approach used to construct Kohonen feature maps.

The automatic analysis of text information can be used:

1. To provide an overview of the contents of a large document collection, and to organize them in the most efficient way,

2. To identify hidden structures between documents or groups of documents,

3. To increase the efficiency and effectiveness of a search process to find similar or related information, and

4. To detect duplicate information or documents in an archive.

Page 133: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TEXT MINING PROCESS

Two phases:

Text refining that transforms free-form text documents into a chosen intermediate form, and

Knowledge distillation that deduces patterns or knowledge from an intermediate form.

_____________________________________________________________

A text-mining framework:

ClusteringCategorization

Visualization

Text

PredictivemodelingAssociative discovery

IF

Document-based intermediate form

Concept-based intermediate form

Textrefining

Knowledgedistillation

Page 134: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 135: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

ARTIFICIAL NEURAL NETWORKS

An artificial neural network is a massively parallel distributed processor made up of simple processing units, which has a property of learning experiential knowledge expressed through inter-unit connection strengths, and making it available for use.

Properties:

Nonlinearity

Learning from examples

Adaptivity

Evidential Response

Fault Tolerance

Uniformity of Analysis and Design

Page 136: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MODEL OF AN ARTIFICIAL NEURON

Three basic elements:

1 A set of connecting links from different inputs xi (or synapses), each of which is characterized by a weight or strength wki.

2 An adder for summing the input signals xi weighted by the respective synaptic strengths wki.

3 An activation function f(net).

x1 kth artificial neuronx2 wk1

. net yk

.

. wkm

xm

bk

f(net)

Page 137: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MODEL OF AN ARTIFICIAL NEURON

x1 kth artificial neuronx2 wk1

. net yk

.

. wkm

xm

bk

net k= x1 wk1 +x2 wk2 + … + xm wkm + bk

Using adopted notation for wk0 = bk and default input x0 = 1: m

netk = x0 wk0 + x1 wk1 +x2 wk2 + … + xm wkm = xi wki i=1

Vector notation:

netk = X W where:

X = {x0, x1, x2, …, xm}

W = {wk0, wk1, wk2, …, wkm}

Finally, an artificial neuron computes the output yk as a certain function of netk

value:

yk = f(netk)

f(net)

Page 138: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MODEL OF ARTIFICIAL NEURONS(EXAMPLES)

a) A single node b) Three interconnected nodes

y1x1=0.5 0.3 x1=1 0.2 1.0

-0.6x2=0.5 0.2 y 0.5 y3

y2x3=0.2 0.5 b= - 0.2 x2=0.5 -1.0 -0.5

a1) Symmetrical Hard Limit

net = 0.5 0.3 + 0.5 0.2 + 0.2 0.5 + (-0.2) 1 = 0.15y = f(net) = f(0.15) = 1

a2) Saturating Linear

net = 0.15 (computation is the same as for case a) )y = f(net) = f(0.15) = 0.15

a3) Log-Sigmoid

net = 0.15 (computation is the same as for case a) )y = f(net) = f(0.15) = 1/(1+e-0.15) = 0.54

____________________________________________________________

b) Symmetric saturating linear

net1 = 1 0.2 + 0.5 0.5 = 0.45 y1 = f(0.45) = 0.45net2 = 1 (-0.6) + 0.5 (-1) = -1.1 y2 = f(-1.1) = -1

net3 = y1 1 + y2 (-0.5) = 0.45 1 + (-1) (-0.5) = 0.95 y3 = f(0.95) = 0.95

f1

23

Page 139: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LEARNING PROCESS Learning is a process by which the free parameters of a neural network are

adapted through a process of stimulation by the environment in which the network is embedded.

The type of learning is determined by the manner in which the parameter changes take place.

Every data sample for ANN training (learning) consists of input vector X(n) and corresponding output d(n).

Inputs Output

Samplek : xk1, xk2, …, xkm dk

Processing the input vector X(n), a neuron k produce the output that is denoted by yk(n):

myk(n) = f ( xi wki )

i=1

yk(n) is compared to a desired response or target output dk(n) given in the sample. An error ek(n) produced at the output is by definition:

ek(n) = dk(n) –yk(n)

The corrective adjustments are designed to make the output signal yk(n) come closer to the desired response dk(n) in a step-by-step manner.

This objective is achieved by minimizing a cost function E(n) (error energy):

E(n) = ½ ek2(n)

Page 140: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LEARNING PROCESS

The learning process based on minimization of a cost function is referred to as error-correction learning.

In particular, minimization of E(n) leads to a learning rule commonly referred to as the delta rule or Widrow-Hoff rule.

DELTA RULE:

The adjustment wkj(n) is defined by:

wkj(n) = ek(n) xj(n)

where is a positive constant that determines the rate of learning.

wkj(n+1) = wkj(n) + wkj(n)

In effect, wkj(n) and wkj(n+1) may be viewed as the old and new values of synaptic weight wkj, respectively.

_________________________________________________________________

The adjustment made to a weight factor of n input neuron connection is proportional to the product of the error signal and the input value of the connection in question.

Page 141: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LEARNING PROCESS (AN EXAMPLE)

DATA:

x1 0.5n (sample) x1 x2 x3 d

x2 y =============================== -0.3 1 1 1 0.5 0.7x3 0.8 2 -1 0.7 -0.5 0.2

b=0 3 0.3 0.3 -0.3 0.5

= 0.1______________________________________________________________________

LEARNING:

First sample:net(1) = 0.5 1 + (-0.3) 1 + 0.8 0.5 = 0.6

y(1) = f(net(1)) = f(0.6) = 0.6

e(1) = d(1) – y(1) = 0.7 – 0.6 = 0.1

w1(1) = 0.1 0.1 1 = 0.01 w1(2) = w1(1) + w1(1) = 0.5+0.01 = 0.51w2(1) = 0.1 0.1 1 = 0.01 w2(2) = w2(1) + w2(1) = -0.3+ 0.01 = -0.29w3(1) = 0.1 0.1 0.5 = 0.005 w3(2) = w3(1) + w3(1) = 0.8+ 0.005 = 0.805

Continue the learning process with second and third samples (n=2 and n=3).

f

Page 142: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

LEARNING TASKS USING ANN’S

Pattern Association

autoassociation

heteroassociation

Pattern Recognition

Function Approximation

Control

Indirect learning

Direct learning

Reference Error Process Process Signal: d signal: e A N N input: x output: y + Controller Process

_ Feedback

Block diagram of feedback control system

Filtering

Filtering

Smoothing

Prediction

Page 143: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MULTILAYER PERCEPTRON

Multilayer perceptrons use error back-propagation algorithm for learning.

Error back-propagation learning consists of two phases:

Forward pass –computing yj(n), and

Backward pass – correct weights wji based on error ej(n).

The error:

ej(n) = dj(n) – yj(n)

E(n) = ½ ej2(n), j C

Set C includes all neurons in the output layer of the network.

For N samples: N

Eav = 1/N E(n) n=1

The backpropagation algorithm applies a correction wji(n) to the synaptic weight wji(n) , which is proportional to the partial derivative E(n)/wji(n).

Page 144: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MULTILAYER PERCEPTRON(Learning)

a) NEURON j IS A HIDDEN NODE

Partial derivatives for E(n) are:

E(n)/wji(n) = E(n)/ej(n) ej(n)/ yj(n) yj(n)/ vj(n) vj(n)/ wji(n)

The partial derivative E(n)/wji(n) represents a sensitive factor, determining the direction of search in weight space. Knowing:

E(n)/ej(n) = ej(n) (from E(n) = ½ ej2(n) )

ej(n)/ yj(n) = -1 (from ej(n) = dj(n) – yj(n) )

yj(n)/ vj(n) = ’(vj(n)) (from yj(n) = (vj(n)) )

vj(n)/ wji(n) = xi(n) (from vj(n) = wji(n) xi(n) )

partial derivative E(n)/wji(n) we can express in the form:

E(n)/wji(n) = - ej(n) ’(vj(n)) xi(n)

The correction wji(n) applied to wji(n) is defined by delta rule:

wji(n) = - E(n)/wji(n) = ej(n) ’(vj(n)) xi(n)or

wji(n) = j(n) xi(n)

where

j(n)=ej(n)j’(vj(n)) is the local gradient.

Page 145: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MULTILAYER PERCEPTRON(Learning)

If the activation function is sigmoid:

yj(n) = (vj(n)) = 1 / (1+e(-vj(n)) )then the first derivative is:

’(vj(n)) = e(-vj(n)) / (1+e(-vj(n) )2 = yj(n) (1 – yj(n))

and a final weight correction is:

wji(n) = ej(n) yj(n) (1 – yj(n)) xi(n)

If the activation function is hyperbolic tangent:

’(vj(n)) = (1 – yj(n)) (1 + yj(n))

wji(n) = ej(n) (1 – yj(n)) (1 + yj(n)) xi(n)

____________________________________________________________________

b) NEURON j IS A HIDDEN NODE:

j(n) = ’(vj(n)) k(n) wkj(n), k D

where D denotes set of all nodes on a next layer that are connected to the node j.

Going backward, all k(n) for the nodes in a next layer are known before computation of local gradient j(n) for a given node on a layer closer to the inputs.

Page 146: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

MULTILAYER PERCEPTRON(Learning)

Momentum

A simple method of increasing the rate of learning yet avoiding the danger of instability is to modify the delta rule by including so called a momentum term:

MOMENTUM TERM

wji(n) = j(n) xi(n) + wji(n-1)

where

- is usually a positive number called momentum constant and

wji(n-1) - is the correction of the weight factor for a previous (n-1)th sample (in practice: [0.1 , 1] ).

The addition of the momentum term smoothes weight updating and tends to resist erratic weight changes due to gradient noise (a stabilizing effect).

Page 147: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

ANN overfitting / overtraining

Generalization as a curve-fitting problem:

y y Training

Testing

x x

Properly fitting curve with Overfitted curvegood generalization

Page 148: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

COMPETITIVE NETWORKS

A set of neurons that have the same structure, and they are connected with initially randomly selected weights. Therefore, the neurons respond differently to a given set of input samples.

A limit value is determined on the strength of each neuron.

A mechanism that permits the neurons to compete for the right to respond to a given subset of inputs, such that only one output neuron is active at the time. The neuron that wins the competition is called winner-takes-all neuron.

Connections:

lateral inhibitory,

feedforward excitatory

Architecture:

Layer of Single layer of Competitiveinputs output nodes outputs

x1 y1

x2 y2

. . . .

. .

xn yk

Page 149: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

COMPETITIVE NETWORKS

yk = 1 if netk > net j for all j, j k 0 otherwise

wkj = (xj – wkj) if neuron k wins the competition 0 if neuron k loses the competition

_________________________________________________________

Geometric interpretation of the competitive learning

-synaptic weights - input vectors

Initial state of the network Final state of the network

Page 150: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

COMPETITIVE NETWORKS (EXAMPLE)

New sample: X = { x1, x2, x3 } = { 1, 0, 1 }

Network:0.5

x1 y1

0.3 0.5 0.2 0.4 0.6

0.7 y2

x2

-0.5 0.2 0.1 0.2 x3 -0.2 y3

Learning:

net1* = 0.5 x1 + (-0.5) x3 = 0.5 1 – 0.5 1 = 0net2* = 0.3 x1 + 0.7 x2 = 0.3 1 + 0.7 0 = 0.3net3* = 0.2 x2 + (-0.2) x3 = 0.2 0 - 0.2 1 = -0.2

After including lateral inhibitory connections:

net1 = net1* + 0.5 0.3 + 0.6 (-0.2) = 0.03net2 = net2* + 0.2 0 + 0.1 (-0.2) = 0.28 (maximum !! Vinner)net3 = net3* + 0.4 0 + 0.2 0.3 = - 0.14

The final outputs from the network for a given sample will be:

Y = { y1, y2, y3 } = { 0, 1, 0 }

New weight factors (only for the winning node y2) based on learning rate = 0.2:

w12 = 0.3 + 0.2 ( 1 – 0.3) = 0.44w22 = 0.7 + 0.2 ( 0 – 0.7) = 0.56w32 = 0.0 + 0.2 ( 1 – 0.0) = 0.20

2

1

3

Page 151: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GENETIC ALGORITHMS

o John Holland at the University of Michigan in 1975 (Idea: natural evolution is a population-based optimization process)

o Genetic algorithm (GA) is an iterative optimization method.

o Hard optimization problems

o GAs encode each point in a parameter space (or solution space) into a binary bit string called a chromosome.

o Each point or binary string represents a potential solution to the problem that is to be solved.

o GAs are more robust than existing directed search methods: they maintain a population of potential solutions, while all other methods process a single point of the search space.

o GAs applications:wire routing - scheduling - adaptive control - game playing

transportation problems - traveling salesman problems database query optimization - machine learning

Page 152: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GA Strategy: Multimodal Optimization

o Offspring populations: mountain-hopping & mountain-climbing

GA characteristics:

GAs are parallel-search procedures (can be implemented on parallel processing machines for massively speeding up their operations).

GAs are applicable to both continuous and discrete optimization problems.

GAs are stochastic and less likely to get trapped in local minima.

Page 153: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GAs’ flexibility facilitates both structure and parameter identification in complex models.

Natural Evolution & Genetic Algorithms

Concept in Concept inNatural Evolution Genetic Algorithms

Chromosome StringGene Features in the stringLocus Position in the stringAllela Position value (usually 0 or 1)Genotype String structurePhenotype Set of characteristics (features)

_____________________________________ . _______________________________

Major phases of a genetic algorithm:

Encoding schemas

Fitness evaluation YES

Testing the end of the algorithm

NO

Parent selection

Crossover operators

Halt

Page 154: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Mutation operators

Optimization using GA:

GOAL: max f*(x)

o f*(x) - positive ( f*(x) = max {f(x) + C} )

o min g(x) max f(x) = - g(x).

Coding:

Each variable xi, on [a,b] is coded as a binary string of length m:

xi = a + decimal (binary-string i) {[b –a]/ [2m – 1]}

o Example:

- X [10, 20], m=3 binary-codes [000, 111]

- Precision: [b –a] / [2m – 1] =(20–10)/(2 3–1) = 10/7 =1.42

- binary-codes = 011 X = 10 + 3 1.42 = 14.26

o Each chromosome: concatenation of binary codes for all features.

o Total length m is a sum of features code lengths mi:

k

Page 155: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

m = mi i=1

GA PRINCIPLES

Page 156: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

1. GA - Encoding schemes & initialization

o GAs usually use binary coding schema.

o GA starts with designing a representation of a solution for the given problem

o Example: Max f(x, y, z) with ranges [0, 15] for x, y, and z:

Point (x, y, z) concatenated binary string 3 4 (m=4)

(x, y, z) = (11, 6, 9) (101101101001)

o GAs are manipulating not with a single chromosome, but with the set of chromosomes called a population.

o To initialize a population, we can simply set some pop-size number of chromosomes randomly (parameter – size of population).

2. GA - Fitness evaluation

o Each chromosome in the population is a candidate for an optimal solution

o The fitness value fi of the ith member is the value of the objective function that is optimized (complex analytical formulas, simulation models)

o Use the rankings of members in a population as their fitness values. The advantage: the objective function does not need to be

accurate, as long as it can provide the correct ranking information.

Page 157: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

3. GA - Selection

o Create a new population from the current generation.

Question: which parent chromosomes participate in producing offspring for the next generation?

o Members are selected for mating with a selection probability

proportional to their fitness values.

o The selection probability p equal to:

npi = fi / fk

k=1

where n is population size and fi is a fitness value for ith chromosome.

o The effect: members with above-average values reproduce and replace members with below-average fitness values.

o Implementation: A roulette wheel with slots sized according to fitness for each chromosome is used

Page 158: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

3. GA – Selection: roulette wheel

Constructing the roulette wheel:

1. Calculate the fitness value f(vi) for each chromosome vi.

2. Find the total fitness of the populationpop-size

F = f(vi) i=1

3. Calculate the probability of a selection pi for each chromosome vi:

pi = f(vi) / F

4. Calculate a cumulative probability qi after each chromosome vi is included:

iqi = pj

j=1where q increases from 0 to maximum 1. q=1 shows that all chromosomes are included into a cumulative probability.

Selection = spinning the roulette wheel pop-size times:

Repeat pop-size times:

1. Generate a random number r from the range [0, 1].

2. If r < q1 then select the first chromosome v1; otherwise select the i-th chromosome vi such that q i-1 < r qi.

Page 159: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 160: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

4. GA - Crossover

o The probability of crossover PC

o expected number of chromosomes which undergo the crossover operation: PC pop-size

o One-point crossover:

1 0 0 1 1 1 1 0 1 0 0 1 0 0 1 0

1 0 1 1 0 0 1 0 1 0 1 1 1 1 1 0

o Two-point crossover:

1 0 0 1 1 1 1 0 1 0 1 1 0 1 1 0

1 0 1 1 0 0 1 0 1 0 0 1 1 0 1 0

o N-point crossover

o The effect: some children are able to outperform their parents if they get “good” genes or genetic traits from their parents.

Procedure:Repeat for all chromosomes:

1. Generate a random number r from the range [0, 1].

2. If r < PC select given chromosome for crossover.

Page 161: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

5. GA - Mutation

o A mutation operator: spontaneously generating new chromosomes from old ones.

o Parameter: very low mutation rate (MR)

o If the mutation rate is high (for example above 0.1), GA performance will approach that of a primitive random search.

Example:

Randomly selected mutated bit Chromosome after mutation(in the sixth position)

1 0 0 1 1 1 1 0 1 0 0 1 1 0 1 0

Implementing mutation: flip a bit with a probability equal to MR.

Page 162: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GENETIC ALGORITHM

Page 163: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GENETIC ALGORITHM

Page 164: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GENETIC ALGORITHM

Page 165: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 166: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

A simple illustration of a genetic algorithm

1. Representation:

o Five-bits code (string) for required precision:

(b – a) / (2m – 1) Required precision(31 – 0) / (2m – 1) 12m 32m 5

o Examples of coding:

x = 11 code = 01011.

code = 11001 x = 25

Given:f(x) = x 2 (required precision = 1)

Task: max f(x) on x [0,31]

Parameters:

Population size, pop-size = 4. Probability of crossover, PC = 1. Probability of mutation, PM = 0.001.

Page 167: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 168: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

2. Initial population:

o Randomly selected population of chromosomes is:

CR1 = 01101CR2 = 11000CR3 = 01000CR4 = 10011

___________________________________ . ____________________________

3. Evaluation:

x1 (CR1) = 13 f(x1) = 169

x2 (CR2) = 24 f(x) = x2 f(x2) = 576

x3 (CR3) = 8 f(x3) = 64

x4 (CR4) = 19 f(x4) = 361

Table of Evaluation

CRi Code x f(x) f(x) / f(x) Expected reproduction: f(x)/fav

1 01101 13 169 0.14 0.582 11000 24 576 0.49 1.973 01000 8 64 0.06 0.224 10011 19 361 0.31 1.23 1170 1.00 4.00Average 293 0.25 1.00Max 576 0.49 1.97

Page 169: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

4. Alternation:

Roulette wheel for selection of a next population

Randomly selected pairs: CR1-CR2 and CR2-CR4

First pair CR1 = 01101CR2 = 11000

Second pair CR2 = 11000

CR4 = 10011

New population: CR1’ = 01100CR2’ = 11001CR3’ = 11011 CR4’ = 10000

Table of Evaluation (second iteration):

CRi Code x f(x) f(x) / f(x) Expected reproduction: f(x)/fav

1 01100 12 144 0.08 0.322 11001 25 625 0.36 1.443 11011 27 729 0.42 1.684 10000 16 256 0.14 0.56 1754 1.00 4.00Average 439 0.25 1.00Max 729 0.42 1.68

49% CR2

14%CR1

31% 6% CR4 CR3

Page 170: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Schemata

f(x) f(x)

0 16 31 x 0 16 19 24 27 31 x

a) Schema 1**** b) Schema 1*0**f(x) = x2 : Search spaces for different schemata

Schemata

Properties: - order (O), - length (L),- fitness (F)

A schema – a template allowing exploration of similarities among chromosomes

A schema is built by introducing a don’t care symbol (*) into the alphabet of genes.

A schema represents all strings, which match it on all positions other than *.

A schema of the length l are defined as H {0, 1, *}l.

An example:The schema : ( * 1 * 1 1 0 0 1 0 0 )

matches four strings:

{(0 1 0 1 1 0 0 1 0 0 ), (0 1 1 1 1 0 0 1 0 0 ), (1 1 0 1 1 0 0 1 0 0 ), (1 1 1 1 1 0 0 1 0 0)}

Example:

Given: S1 = ( * * * 0 0 1 * 1 1 0)S2 = ( * * * * * 0 * * 0 *)S3 = ( 1 1 1 0 1 * * 0 0 1)

___________________________________________________

O(S1) = 10–4 = 6, O(S2) = 10–8 = 2, O(S3) = 10–2 = 8

L(S1) = 10–4 = 6, L(S2) = 9–6 = 3, L(S3) = 10–1 = 9.

Page 171: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

fitness F(S): It is defined as the average fitness of all strings in the population matched by the schema S.

_____________________________ . _____________________________________

Fundamental theorem of a schema construction:

The short (high O), low-order (low L), above-average schemata (high F) receive exponentially increasing number of strings in the next generations of a genetic algorithm.

Page 172: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Traveling Salesman Problem (TSP)

9

6 3

7 10

5 4

8

9 3 4 8 7Optimal solution: A ----->B------>C-------E------>D----->(A)

A B

C

D E

Fitness function:

Min: f(s) = s (s is total distance)

Max: f(s) = 1/s, f(s) = 1/s2 , f(s) = K – s,

where K is a positive constant that makes f(s) 0.

Page 173: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Traveling Salesman Problem (TSP)

Crossover operations will result in invalid solution for TSP:

A D E B CA E C D B

will produce new strings:

A D E D BA E C B C

Partially Matched Crossover (PMX) operation:

A D E B CA E C D B

The crossover operation requires exchange the symbols: E with C, we denote as ordered pair (E, C), and B with D, represented as (B, D).

PMC exchange the places for pairs (E, C) and (B, D) in both strings (“horizontally!!”).

A B C D E A C E B D

Page 174: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Traveling Salesman Problem (TSP)

Page 175: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Machine Learning using GA

Database DB: Set of records R(A1, A2, A3, A4, A5, A6 ).

Attributes Values

A1 x, y, zA2 x, y, zA3 y, nA4 m, n, pA5 r, s, t, uA6 y, n

Classification model Rules: (p1, p2, p3, p4, p5, p6) : d

((A1 = x) (A5 = s)) ( (A1 = y) (A4 = n)) C1

((A3 = y) (A4 = n)) (A1 = x) C2

( x * * * s * ) : C1

( y * * n * * ) : C1

( * * y n * * ) : C2

( x * * * * * ) : C2

Page 176: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Machine Learning using GA

Let us assume that at some stage of the learning process, there is a small and random generated population of classifiers Q in the system where each classifier is given with its strength s:

Q1 (* * * m s * ) : 1, s1 = 12.3Q2 (* * y * * n ) : 0, s2 = 10.1Q3 ( x y * * * * ) : 1, s3 = 8.7Q4 ( * z * * * * ) : 0, s4 = 2.3

Strengths si are parameters computed based on available training data set. They show the fitness of rule to training data set and they are proportional to the percentage of data set supported by the rule.

Task: optimize the set of rules with respect to the fitness function of the rules to training data set.

The operators: mutation and crossover.

Example: Rules:

Q1 (* * * m s * ) : 1Q2 (* * y * * n ) : 0

After crossover the offspring are:

Q1c (* * * * * n ) : 0 Q2c (* * y m s * ) : 1

Page 177: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Classes of Search Techniques

Page 178: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GA: An Abstract Example

Distribution of Individuals in Generation 0

Distribution of Individuals in Generation N

Page 179: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TSP

Page 180: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TSP

Page 181: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

TSP: Best Solution

Page 182: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FUZZY SETS

The concepts formed in human brains for perceiving, recognizing, and categorizing natural phenomena are often also fuzzy concepts: Boundaries of these concepts are vague.

Classical set A of real numbers:

“Tall person” is higher than 6 ft.

is a set with a crisp boundary, and it can be expressed as:

A = { x x > 6}

The dichotomous nature of the classical set would classify a person 6.001 ft tall as a tall person, but not a person 5.999 ft tall.

Lotfi Zadeh introduced the theory of fuzzy sets

Fuzzy set A in a domain X is defined as a set of ordered pairs:

A= { (x, A(x)) x X, A(x) [0,1] } A(x) is called the membership function (MF).

Page 183: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

FUZZY SETS

Examples:

(x) (x)

1 1

1 2 3 4 5 6 x 50 x A = “sensible number of children” B = “about 50 years old”

Discrete and continuous representation of membership

1. The fuzzy set C = “desirable city to live in”:

C = { (San Francisco, 0.9), (Boston, 0.8), (Los Angeles, 0.6) }

2. The fuzzy set A = “sensible number of children in a family”:

A = {(0, 0.1), (1, 0.3), (2, 0.7), (3, 1), (4, 0.7), (5, 0.3), (6, 0.1)}

or:

A = 0.1/0 + 0.3/1 + 0.7/2 + 1.0/3 + 0.7/4 + 0.3/5 + 0.1/6

3. The fuzzy set B = “about 50 years old” :

B = {(x, B(x)) x X}where

B(x)= 1/ (1 + ((x-50)/10)4)

Page 184: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 185: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Membership Function Shapes

1 1 1

a b c a b c d cTriangular Trapezoidal Gaussian

Examples:

1 1 1

20 40 60 80 100 x 20 40 60 80 100 x 20 40 60 80 100 x

0 for x a (x – a)/(b – a) for a x b

(x) = triangle (x, a, b, c) = (c - x)/(c – b) for b x c 0 for c x

0 for x a (x – a)/(b – a) for a x b

(x) = trapezoid (x, a, b, c, d) = 1 for b x c (d - x)/(d – c) for c x d 0 for d x

(x) = gaussian (x, c, ) = e –1/2 ((x-c)/)2

Page 186: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

triangle(x, 20, 60, 80) trapezoid(x, 10, 20, 60, 90) gaussian(x, 50, 20)

Membership Function Shapes

Page 187: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 188: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Parameters and Characteristics of Membership Function

1. Support: Support (A) = {x A(x) > 0}

2. Core: Core (A) = {x A(x) = 1}

3. Normalization: A fuzzy set A is normal if its core in nonempty: x X such that A(x) = 1.

4. Cardinality : Card(A) = A(x) where x X

Example: A = 0.1/1 + 0.3/2 + 0.6/3 + 1.0/4 + 0.4/5 Card (A) = 2.4.

5. -cut : A = {x A(x) }

6. Fuzzy Number: 1. The membership function must be normalized.2. The membership function has to be monotonically

increasing left of the core, and monotonically decreasing to the right.

(x) 1

A(x,(x))

0.5-cut = 0.5

core

support x

Page 189: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Set Operations

1. The union of two fuzzy sets A and B is a fuzzy set C:

C=A B or C=A OR B,

where C(x) = max (A(x), B(x)) = A(x) B(x), x X

2. The intersection of two fuzzy sets A and B is a fuzzy set C:

C = A B or C = A AND B,

where C(x) = min (A(x), B(x)) = A(x) B(x), x X

3. The complement of fuzzy set A, denoted by A’ is defined by membership function:

A’(x) = 1 - A(x), x X

1 A B 1

Fuzzy sets A and B C = A’

1 1

C=A B C = A B

Page 190: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Set Operations

4. The Cartesian product of A and B, denoted by A B, is a fuzzy set in the product space X Y with a membership function:

A B (x, y) = min (A(x), B(y)) = A(x) B(y), x X and y Y

Example: Given fuzzy sets A and B on discrete universe of discourse S = {1,2,3,4,5}:

A = 0/1 + 0.5/2 + 0.8/3 + 1.0/4 + 0.2/5

B = 0.9/1 + 0.4/2 + 0.3/3 + 0.1/4 + 0/5

A B = 0.9/1 + 0.5/2 + 0.8/3 + 1.0/4 + 0.2/5

A B = 0/1 + 0.4/2 + 0.3/3 + 0.1/4 + 0/5

AC = 1/1 + 0.5/2 + 0.2/3 + 0/4 + 0.8/5

A B = 0/(1,1) + 0/(1,2) + 0/(1,3) + 0/(1,4) + 0/(1,5) + 0.5/(2,1) + 0.4/(2,2) + 0.3/(2,3) + 0.1/(2,4) + 0/(2,5) + 0.8/(3,1) + 0.4/(3,2) + 0.3/(3,3) + 0.1/(3,4) + 0/(3,5) + 0.9/(4,1) + 0.4/(4,2) + 0.3/(4,3) + 0.1/(4,4) + 0/(4,5) + 0.2/(5,1) + 0.2/(5,2) + 0.2/(5,3) + 0.1/(5,4) + 0/(5,5)

Page 191: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Comparison of Fuzzy Sets

1. Distance measures

Minkowski distance:

D(A, B) = { A(x) – B(x)p }1/p , x X , p 1.

Specific cases:

Hamming distance for p = 1, Euclidean distance for p = 2, and Tchebyshev distance for p = .

Example:

Given: A = 0/1 + 0.5/2 + 0.8/3 + 1.0/4 + 0.2/5

B = 0.9/1 + 0.4/2 + 0.3/3 + 0.1/4 + 0/5

_________________________._________________________

Euclidian distance measure, is:

D(A, B) = (0–0.9)2+(0.5–0.4)2+(0.8–0.3)2+(1–0.1)2+(0.2–0)2 =1.39

Page 192: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Comparison of Fuzzy Sets

2. Possibility and Necessity Measures

Pos(A, B) = max [ min ( A(x), B(x) ) ] , x X

Nec(A, B) = min [ max ( A(x), 1-B(x) ) ] , x X

(x) 1

Pos(A, B)

Nec(A,B)

20 40 60 80 100 120 x Comparison of fuzzy sets: A = high speed and B= speed around 80 km/h

Example:

Given: A = 0/1 + 0.5/2 + 0.8/3 + 1.0/4 + 0.2/5

B = 0.9/1 + 0.4/2 + 0.3/3 + 0.1/4 + 0/5 ___________________________ . ___________________________

Pos(A, B) = max [ min {(0, 0.5, 0.8, 1.0, 0.2), (0.9, 0.4, 0.3, 0.1, 0)}] = max [0, 0.4, 0.3, 0.1, 0] = 0.4

Nec(A, B) = min [ max {(0, 0.5, 0.8, 1.0, 0.2), (0.9, 0.4, 0.3, 0.1, 0)}] = min [0.1, 0.6, 0.8, 1.0, 1.0] = 0.1

Page 193: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 194: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Additional Unary Fuzzy Set Operations

1. Normalization: This operation converts a subnormal, nonempty fuzzy set into a normalized version by dividing the original membership function by the max height of A:

NormA(x) = {(x, (A(x) / hgt(x)) = A(x) / max A(x)) where xX }

2. Concentration: The membership function becomes more concentrated around points with higher membership grades as, for instance, being raised to power two:

ConA(x) = {(x, A2(x)) where xX }

3. Dilation: The opposite effect from concentration as, for instance, modifying the membership function through the exponential transformation where the exponent is less than one:

DilA(x) = {(x, A1/2(x)) where xX }

(x) (x) (x) 1 1 1

A AA

x x x

Normalization Concentration Dilation

Page 195: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Linguistic Variables

large profit?

high pressure ??

tall man ? wealthy woman

moderate temperature.

Variable X = “age” - has values defined as fuzzy sets “young,” “middle aged,” and “old”, and they are characterized by MFs young(x), middleaged(x), and old(x).

(x)young middle-age old

1

20 40 60 80 100 age

Variable X = “height”

Page 196: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 197: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Linguistic Variables

Variable X = “outdoor temperature”

Variable X = “truthfullness”

Truthfulness (certainty) of events as fuzzy sets over the [0,1] domain.

Page 198: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Relations

(x)

1B

A

x

The concept of A B where A and B are fuzzy sets

Equality: A = B iff A(x) = B(x), x X

Inclusion: A B A(x) B(x), x X

Degree of Subsethood (DS ):

DS(A, B) = (1/Card(A) ) { Card(A) - max[0, A(x)-B(x)]}, x X

Page 199: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extension Principle

Let A and B be fuzzy two sets, and f is a mapping from A to B:

f: A B

where: yi = f(xi), i =1,…,n.

B(y) = max A(x), x X and y = f(x).

______________________________ . _______________________________

A = A(x1)/x1 + A(x2)/x2 + A(x3)/x3 + …+ A(xn)/xn

B = f(A) = A(x1)/y1 + A(x2)/y2 + A(x3)/y3 + …+ A(xn)/yn

Fuzzy sets (A1, A2, …, An) in X are transformed via y=f(x) producing the fuzzy set B = f(A1, A2, …An) in Y such that, for each y Y:

B(y) = maxx { min [A1(x1), A2(x2), …, An(xn)]}

subject to x X and y = f(x).

Page 200: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extension Principle

Example:

GIVEN: A = 0.1/-2 + 0.4/-1 + 0.8/0 + 0.9/1 + 0.3/2

and the function f is f(x) = x2 – 3

Upon applying the extension principle:

B = 0.1/1 + 0.4/-2 + 0.8/-3 + 0.9/-2 + 0.3/1 = = 0.8/-3 + (0.4 0.9)/-2 + (0.1 0.3)/1 = = 0.8/-3 + 0.9/-2 + 0.3/1

Page 201: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Binary Fuzzy Relations

Example:

R = “y is much greater than x”.

1. R(x, y) = (y - x) / (x + y + 2), if y > x 0 if y x

2. If X and Y are finite set of discrete values such as X {3, 4, 5} and Y = {3, 4, 5, 6, 7}, then it is convenient to express the fuzzy relation R as a relation matrix:

0 0.111 0.200 0.273 0.333R(x, y) = 0 0 0.091 0.167 0.231

0 0 0 0.077 0.143

R = { ((x, y), R(x, y)) (x, y) X Y}

Examples of binary fuzzy relations:

x is close to y (x and y are numbers). x depends on y (x and y are categorical data). x and y look alike. If x is large, then y is small.

Page 202: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Inference System

Examples:

If pressure is high, then volume is small.

If the road is slippery, then driving is dangerous.

If a tomato is red, then it is ripe.

If the speed is high, then apply the brake a little.

___________________________________ . ________________________________

Fuzzy reasoning (approximate reasoning)

generalized modus ponens

A fuzzy If-then rule (fuzzy implication):

If (x is A) then (y is B)

where A and B are linguistic values.

Page 203: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Systems as Universal Approximators

Fuzzy Reasoning Generalized Modus Ponens

xj

"about xi""about xj"

xi

"about yj"

"about yi"

yj

yi

y(x)y

x

Interval Rules IF x<1 THEN y = 0IF 1<x<2 THEN y = 1IF 2<x<3 THEN y = 2IF 3<x<4 THEN y = 3

Page 204: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

GMP: Fact: x is A’Rule: IF x is A THEN y is B___________________________

Conclusion: y is B’

where A’ is close to A and B’ is close to B.

Assume that fuzzy implication A B is expressed as a fuzzy relation R on X Y.

Then the fuzzy set B’ induced by A’ and A B is defined by:

B’(y) = max x min [ A’(x) , R(x, y) ]

= x [ A’(x) R(x, y) ]

________________________ . _________________________

Characteristics:

A, A’ B’ B ( or B’(y) B(y) )

If A’ A (or A(x) A’(x) ) B’ = B

Page 205: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Reasoning using Generalized Modus Ponens

Example:

Given: - A’ = “x is above average height”, and - The fuzzy rule: “If x is high, then he/she is overweight”, (AB)

Fuzzy sets: A’, A, B:

A’: x (x) A: x (x) B: y (y)

5’6” 0.3 5’6” 0 120 05’9” 1.0 5’9” 0.2 150 0.26’ 0.4 6’ 0.8 180 0.56’3” 0 6’3” 1.0 210 1.0

Fuzzy implication AB:

1. R(x, y) = 1 for A(x) B(y) B(y) otherwise

1 1 1 1R(x, y) = 0 1 1 1

0 0.2 0.5 10 0.2 0.5 1

2. the Lukasiewicz-norm:

R(x, y) = {1 (1 - A(x) + B(y) }

Page 206: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Fuzzy Reasoning using Generalized Modus Ponens

Reasoning:

B’(y) = max x min [ A’(x) , R(x, y) ]

1 1 1 10 1 1 1

= max x min [0.3 1 0.4 0] 0 0.2 0.5 10 0.2 0.5 1

0.3 0.3 0.3 0.3= max x 0 1 1 1

0 0.2 0.4 0.40 0 0 0

= [0.3 1 1 1]

Resulting fuzzy set B’ can be represented in a form of table:

B: y (y) 120 0.3150 1.0180 1.0210 1.0

(x) (x) 1 1 A’ A B’ B

5’6” 5’9” 6’ 6’3” x 120 150 180 210 x

Fuzzy sets A and A’ Fuzzy sets B and B’(conclusion)

Page 207: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Multifactorial Evaluation

U = {u1, u2, …, un} be a set of objects for evaluation.

F = {f1, f2, …, fm} be the set of basic factors in the evaluation process.

E = {e1, e2, …, ep} be a set of descriptive grades or qualitative evaluation classes.

___________________________ . ____________________________

R(u) evaluation matrix with dimensions m p (generated based on available data set).

W(u) vector of evaluation factors (generated based on available data set).

__________________________________ . _______________________________

R(u)

u W(u) R(u) D(u) W(u)

Multifactorial evaluation model

Page 208: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Multifactorial EvaluationExample:

F = {f1, f2, f3}: f1 = style, f2 = quality, and f3 = price.

E = {e1, e2, e3, e4}: e1= best, e2 = good, e3 = fair, and e4 = poor.

Evaluation matrix R(u) for a given product u:

R1(u) 0.6 0.2 0.1 0.1 R(u) = R2(u) = 0.1 0.5 0.3 0.1

R3(u) 0.1 0.3 0.4 0.2

A customer’s weight vector W(u):

W(u) = {0.4, 0.4, 0.2}_______________________________________________________ Evaluate D(u) = [d1, d2, d3, d4]:

0.6 0.2 0.1 0.1D(u) = W(u) R(u) = [0.4 0.4 0.2] 0.1 0.5 0.3 0.1

0.1 0.3 0.4 0.2

= [0.4 0.4 0.3 0.2]

d1 is calculated through the following min-max steps:

d1 = (w1 r11) (w2 r21 ) (w3 r31) = (0.4 0.6) (0.4 0.1 ) (0.2 0.1) = 0.4 0.1 0.1 = 0.4

Page 209: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extracting Fuzzy Models from Data

Grid-based rule sets model (Mamdani model)

1. x2 x2

oldR 2,1 R 2,2 R 2,3

youngR 1,1 R 1,2 R 1,3

x1

1

Low medium high x1

2. y y

high x

above-average x x x

below-average

low x

1

low below-average above-average high x

Selection of characteristic points in a granulated space

Page 210: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extracting Fuzzy Models from Data

3. y y

R1 R2 R3 R4

high x

above-average x x x

below-average

low x

1

low below-average above-average high x

Graphical representation of generated fuzzy rule, and resulting crisp (interval) approximation.

4.

R1: IF x is small THEN y is above-average.R2: IF x is below-average THEN y is above-average.R3: IF x is above-average THEN y is high.R4: IF x is high THEN y is above-average.

Resulting fuzzy approximation

Page 211: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extracting Fuzzy Models from Data

Automatically Determining Fuzzy Granulation

1. Select point of maximal error: y y

x

1

x

2. For the selected point of maximum error, new triangular fuzzy values:

y y

x

1

x

Page 212: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extracting Fuzzy Models from Data

Automatically Determining Fuzzy Granulation

3. Repeat 1. and 2. until a maximum number of divisions:

y y

x

1

Page 213: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Extracting Fuzzy Models from Data

Automatically Determining Fuzzy Granulation

4. Final granulation if a maximum number of divisions is 4:

y y

By

Dy

Ay

Cy

x

Dx Cx Ax Bx

1

Final fuzzy rules:

R1: IF x is Ax THEN y is Ay.

R2: IF x is Bx THEN y is By.

R3: IF x is Cx THEN y is Cy.

R4: IF x is Dx THEN y is Dy.

Page 214: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 215: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VISUALIZATION METHODS

Human vision is still the most powerful means of shifting out irrelevant information and detecting significant patterns.

Seeing and understanding together enable humans to discover a new knowledge, having deeper insight from large amount of data.

The power of visualization to exploit human perception offers both a challenge and an opportunity.

Computer visualization, in particular, is about using computer graphics and other techniques to think about more cases, more variables, and more relations.

Visual data mining uses computer visualization techniques to augment data mining process.

________________________________________________________

Visualizations can be used:

1. To explore data, - exploratory visualizations

2. To confirm a hypothesis, - confirmatory visualizations

3. To manipulate a view - manipulative visualizations.

Page 216: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VISUALIZATION METHODS

Second taxonomy:

Scientific visualization:

Focuses primarily on physical data such as human body, the earth, molecules.

Deals with multi-dimensional data, but most of the data sets used in this field use the spatial attributes.

Information visualization:

Focuses on abstract, nonphysical data such as text, hierarchies, and statistical data.

Design a visual representation in a case of multidimensional samples (where the number of dimensions is greater than three).

__________________________________________________________

Data mining techniques are primary oriented toward information visualization.

Page 217: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Information VisualizationCategories:

a) Traditional IVT (based on 2D and 3D graphics)

Small number of dimensions. Include:

Bar chart that show aggregations and frequencies. Histogram shows the distribution of variables values. Line chart for understanding trends in ordered. Pie charts for visualizing fractions of a total. Scatter plot for bivariate analysis.

Color coding Data cubes

b) New IVT

With large number of dimensions at the same time on one screen.

Classification:

1. Geometric projection techniques,

2. Icon-based techniques,

3. Pixel-oriented techniques, and

4. Hierarchical techniques.

Page 218: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

New Information Visualization Techniques

1. Geometric projection techniques

Aim to find interesting projections of multidimensional data sets.

Includes techniques of exploratory statistics such as

i. principal component analysis, ii. factor analysis, and

iii. multidimensional scaling.

Parallel coordinate visualization technique and radial visualization technique belong in this category of visualizations

Scatter-Plot Matrix Technique is an approach that is very often available in new data mining software tools. User interactions of zooming and panning are needed to interpret the scatter plots effectively.

Survey Plot is a simple technique of extending an n-dimensional point (sample) in a line graph.

Page 219: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

New Information Visualization Techniques

1. Geometric projection techniques

4-dimensional Survey Plot

Dimension1 Dimension 2 Dimension 3 Dimension 4

Sample

Andrews’s curves technique plots each n-dimensional sample as a curved line transforming the n-dimensional point

X = (x1, x2, x3, …, xn)

into continuous plot:

f(t) = x1/1.41+x2sin(t)+x3cos(t) +x4 sin(2t)+x5cos(2t) + …

Page 220: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

New Information Visualization Techniques

2. Icon–based techniques (or iconic display techniques).

The idea is to map each multidimensional data item to an icon.

An example is the stick figure technique. It maps two dimensions to the display dimensions and the remaining dimensions are mapped to the angles and/or limb lengths of the stick figure icon. This technique limits the number of dimensions that can be visualized.

A star display for data on seven quality of life measures for three states

Literacy Life expectancy Population

No. of cold days Non-homicide Rate Income

High-school graduates

California Vermont New Hampshire

Page 221: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 222: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

New Information Visualization Techniques

3. Pixel-oriented techniques

They use only one pixel per data value.

The techniques allow a visualization of the largest amount of data, which is possible on current displays (up to about 1,000,000 data values).

Map each data value to a colored pixel and present the data values belonging to one attribute in separate windows.

4. Hierarchical techniques

These types of visualization subdivide the k-dimensional space and present the subspaces in a hierarchical fashion. For example, at the lowest level are 2D subspaces.

Common representative of these techniques is dimensional stacking representation.

Dimensional stacking is a recursive visualization technique for displaying high-dimensional data.

o Each dimension is discretized into a small number of bins, and the display area is broken into a grid of sub-images.

The sub-images are decomposed further based on the number of bins for two more dimensions. This decomposition process continues recursively until all dimensions have been assigned.

Page 223: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 224: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Parallel Coordinates Visualization

Map the k-dimensional space onto the two display dimensions by using k equidistant axes parallel to one of the display axes.

The axes correspond to the dimensions and are linearly scaled from the minimum to the maximum value of the corresponding dimension.

Each data item is presented as a polygonal line.

_________________________________________________________________

Database with 6 numerical attributes:

Sample# DimensionsA B C D E F

1 1 5 10 3 3 5 2 3 1 3 1 2 2 3 2 2 1 2 4 2 4 4 2 1 3 1 2

Parallel Coordinates Visualization

4 5 10 3 4 5

1 1 1 1 1 2A B C D E F

Page 225: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 226: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Parallel Coordinates Visualization

The database for visualization:

Sample# DimensionsA B C D E

1 low low 2 4 3

2 med. med. 4 2 13 high med. 7 5 94 med. low 1 3 55 low low 3 1 26 low med 4 3 2

Parallel Coordinates Visualization (Parabox)

High High 7 5 9

Med. Med.

Low Low

0 0 0Dimensions: A B C D E

_________________________________________________________________

Circular coordinates method is a simple variation of parallel coordinates, in which the axes radiate from the center of a circle and extend to the perimeter.

Page 227: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 228: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Radial Visualization

Radial visualization represents a non-linear transformation of the data, which preserves certain symmetries.

Data dimensions are laid out as points equally spaced around the perimeter of a circle.

For example, in a case of a eight-dimensional space:

D7

D6 D8

D5 D1

D4

D2

D3

Model of springs is used for point representation.

One end of n springs (one spring for each of n dimensions) is attached to the n perimeter points, and the other ends of the springs are attached to a data point.

Spring constants can be used to represent values of dimensions for a given point

Values for all dimensions are normalized to the interval between 0 and 1.

Page 229: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 230: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Radial Visualization

Radial visualization of 4-dimensional point P(K1, K2, K3, K4) with corresponding spring force:

D4(0, 1)

D3(-1, 0) D1(1, 0 D1(1, 0)

F3

P(x, y)

D2(0,-1)

Sum of the spring forces for the given point is equal to 0:

F1 + F2 + F3 + F4 = 0

F = K d (For example: F1 = K1 [ (x –1) i + y j] )

K1[ (x –1) i + y j] + K2[ x i + (y + 1) j] + K3[ (x +1) i + y j] + K4[ x i + (y-1) j] = 0

K1 (x –1) + K2 x + K3 (x +1) + K4 x = 0

K1 y + K2 (y + 1) + K3 y + K4 (y-1) = 0or

x = (K1 – K3) / (K1 + K2 + K3 + K4)

y = (K4 – K2) / (K1 + K2 + K3 + K4)

4-dimensional point P*(K1,K2,K3,K4) 2D space point P(x, y)

K4

F4

K3 K1

F3

F1 F2 K2

Page 231: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Radial Visualization

If all n coordinates have the same value, the data point will lie exactly in the center of the circle.

P1*(0.6, 0.6, 0.6, 0.6) will be represented as P1(0, 0)

If the n-dimensional point is unit vector for one dimension, then the projected point will lie exactly at the fixed point on the edge of the circle (where the spring for that dimension is fixed):

Point P2*(0, 0, 1, 0) will be represented as P2( -1, 0).

Points with approximately equal coordinate values will lie close to the center of the representational circle:

P3*(0.5, 0.6, 0.4, 0.5) will have 2D coordinates: P3(0.05, -0.05).

Points, which have one or two coordinate values greater than the others, lie closer to origins of those dimensions:

P4*(0.1, 0.8, 0.6, -0.1) will have 2D representation P4( -0.36, -0.64).

An n-dimensional line will map to the line or in some cases to the point:

P5*(0.3, 0.3, 0.3, 0.3), P6*(0.6, 0.6, 0.6, 0.6), P7*(0.9, 0.9, 0.9, 0.9)

P567(0, 0).

A sphere will map to an ellipse.

An n-dimensional plane maps to a bounded polygon.

____________________________________________________________________

Page 232: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Gradviz method is a simple extension of a radial visualization that places the dimensional anchors on a rectangular grid instead of the perimeter of a circle.

Page 233: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Kohonen Self-Organized Maps

Kohonen neural networks, also called self-organized maps (SOM), are used as a clustering technique based on n-dimensional visualization.

The Kohonen neural network can be considered as a type of nonlinear data projection onto two dimensions, while trying to preserve the distances between all initially given n-dimensional samples

The output nodes of the network generate x and y coordinates for each input vector and they can be used for a 2D display: similar data samples are mapped to similar x and y coordinates.

The n dimensions of samples are used as n input nodes to the network.

The output nodes of the net are arranged in a rectangular grid (for example a 56 grid would contain 30 output nodes).

The weights of the network are adjusted through the training process so that only one output node is turned on for a given input vector (n-dimensional sample). Input vectors that are “closer” to an output node will reinforce the weights to the given output.

Page 234: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Kohonen Self-Organized Maps

EXAMPLE:

Trained Kohonen SOM (119 samples) with 9 outputs, represented as 33 grid.

Values in nodes are the number of input samples triggered the given output.

y Close points (one cluster)

3 26 22 4

Different clusters 2 3 2 0

3 overlap points

1 1 45 16 Close points

(one cluster)

1 2 3 x

Page 235: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 236: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Visualization Systems for Data Mining

Principles:

Simplicity,

Visibility,

User autonomy,

Reliability,

Reusability,

Availability, and

Security.

Page 237: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Visualization Systems for Data Mining

Requirements for a new generation of visualization systems:

1. Presentation graphics:

The next generation of presentation graphics enriches the static displays with 3D or projected n-dimensional information landscape. User can then navigate through the landscape and animate it to display time-oriented information.

2. Visual interfaces for information access:

They are focused on enabling users to navigate through complex information spaces, to locate and retrieve information.

Supported user tasks involve searching, back tracking, and history logging. User interface techniques attempt to preserve user context and support smooth transitions between locations.

3. Full visual discovery and analysis:

Manipulate the display to answer the “why” question as well as “what” question.

The difference between answering a “what” and a ”why” question involves an interactive operation. Therefore, it requires using:

interaction techniques (interactive mapping, projection, filtering, zooming, and interactive linking and brushing) and

distortion techniques (focusing while preserving an overview of the data).

Page 238: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright
Page 239: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

Data Exploration Tasks with New Visualization Tools:

1. Finding Gestalt: Local and global linearities and nonlinearities, discontinuities, clusters, outliers, unusual groups, and so on, are examples of Gestalts features that can be of interest.

Focusing through individual views is the basic requirement to obtain qualitative data exploration using visualization of data.

Focusing determines what gestalt of the data is seen.

2. Posing queries: This is a natural task after initial Gestalt features have been found, and query identification and characterization is desired.

Queries can concern individual cases as well as subsets of cases. In graphical data analysis it is natural to pose queries graphically.

For example, familiar brushing techniques such as coloring or otherwise highlighting a subset of data means issuing a query about this subset. Ideally, responses to queries are instantaneous.

3. Making comparison:

a) Comparison of variables or projections, where one compares views “from different angles”, and

b) Comparison of subsets of data. It is based on views “of different slices” of the data.

In either case it is likely that large number of plots are generated, and therefore it is challenge to organize the plots in such a way that meaningful comparisons are possible.

Page 240: read.pudn.comread.pudn.com/.../DATA-MINING-BOOK-Transparences.doc  · Web viewConcepts, Models, Methods & Algorithms. TRANSPARENCES. Mehmed Kantardzic. Louisville, 2003. Copyright

VISUALIZATION SYSTEMS FOR DATA MINING

A stronger strategy lies in tightly coupling the visualization and analytical processes into one data-mining tool.

Letting human visualization participate in an analytical process’ decision-making remains a major challenge.

_________________________________________________________

An example of the need for general projections, which are not parallel to axes, to improve clustering process:

B

yA

Potential clusters

x

Based on the visual representation of the projections, it is possible to find clusters with unexpected characteristics (shapes, dependencies) very difficult or impossible to find by tuning the parameter settings of automatic clustering algorithms.