Data Mining. Concepts and Techniques, 3rd Edition


HAN 09-ch02-039-082-9780123814791



Yüklə 7,95 Mb.
Pdf görüntüsü
səhifə33/343
tarix08.10.2017
ölçüsü7,95 Mb.
#3817
1   ...   29   30   31   32   33   34   35   36   ...   343

HAN

09-ch02-039-082-9780123814791

2011/6/1

3:15

Page 45

#7

2.2 Basic Statistical Descriptions of Data



45

packages include bar charts, pie charts, and line graphs. Other popular displays of data

summaries and distributions include quantile plotsquantile–quantile plotshistograms,

and scatter plots.

2.2.1

Measuring the Central Tendency: Mean, Median, and Mode

In this section, we look at various ways to measure the central tendency of data. Suppose

that we have some attribute X, like salary, which has been recorded for a set of objects.

Let x

1

x



2

,

...,x



N

be the set of observed values or observations for X. Here, these val-

ues may also be referred to as the data set (for X). If we were to plot the observations

for salary, where would most of the values fall? This gives us an idea of the central ten-

dency of the data. Measures of central tendency include the mean, median, mode, and

midrange.

The most common and effective numeric measure of the “center” of a set of data is

the (arithmetic) mean. Let x

1

x



2

,

...,x



N

be a set of values or observations, such as for

some numeric attribute X, like salary. The mean of this set of values is

¯=



N

i=1

x

i

N

=

x

1

x



2

+ · · · + x



N

N

.

(2.1)



This corresponds to the built-in aggregate function, average (

avg()


in SQL), provided in

relational database systems.



Example 2.6

Mean. Suppose we have the following values for salary (in thousands of dollars), shown

in increasing order: 30, 36, 47, 50, 52, 52, 56, 60, 63, 70, 70, 110. Using Eq. (2.1), we have

¯=

30 + 36 + 47 + 50 + 52 + 52 + 56 + 60 + 63 + 70 + 70 + 110

12

=

696



12

= 58.


Thus, the mean salary is $58,000.

Sometimes, each value x



i

in a set may be associated with a weight w



i

for = 1, . . . , N.

The weights reflect the significance, importance, or occurrence frequency attached to

their respective values. In this case, we can compute

¯=

N

i=1

w

i

x

i

N

i=1

w

i

=

w

1

x

1

w



2

x

2

+ · · · + w



N

x

N

w

1

w



2

+ · · · + w



N

.

(2.2)



This is called the weighted arithmetic mean or the weighted average.


HAN

09-ch02-039-082-9780123814791

2011/6/1

3:15

Page 46

#8

46

Chapter 2 Getting to Know Your Data

Although the mean is the singlemost useful quantity for describing a data set, it is not

always the best way of measuring the center of the data. A major problem with the mean

is its sensitivity to extreme (e.g., outlier) values. Even a small number of extreme values

can corrupt the mean. For example, the mean salary at a company may be substantially

pushed up by that of a few highly paid managers. Similarly, the mean score of a class in

an exam could be pulled down quite a bit by a few very low scores. To offset the effect

caused by a small number of extreme values, we can instead use the trimmed mean,

which is the mean obtained after chopping off values at the high and low extremes. For

example, we can sort the values observed for salary and remove the top and bottom 2%

before computing the mean. We should avoid trimming too large a portion (such as

20%) at both ends, as this can result in the loss of valuable information.

For skewed (asymmetric) data, a better measure of the center of data is the median,

which is the middle value in a set of ordered data values. It is the value that separates the

higher half of a data set from the lower half.

In probability and statistics, the median generally applies to numeric data; however,

we may extend the concept to ordinal data. Suppose that a given data set of values

for an attribute is sorted in increasing order. If is odd, then the median is the

middle value of the ordered set. If is even, then the median is not unique; it is the two

middlemost values and any value in between. If is a numeric attribute in this case, by

convention, the median is taken as the average of the two middlemost values.

Example 2.7

Median. Let’s find the median of the data from Example 2.6. The data are already sorted

in increasing order. There is an even number of observations (i.e., 12); therefore, the

median is not unique. It can be any value within the two middlemost values of 52 and

56 (that is, within the sixth and seventh values in the list). By convention, we assign the

average of the two middlemost values as the median; that is,

52+56


2

=

108



2

= 54. Thus,

the median is $54,000.

Suppose that we had only the first 11 values in the list. Given an odd number of

values, the median is the middlemost value. This is the sixth value in this list, which has

a value of $52,000.

The median is expensive to compute when we have a large number of observations.

For numeric attributes, however, we can easily approximate the value. Assume that data

are grouped in intervals according to their x

i

data values and that the frequency (i.e.,

number of data values) of each interval is known. For example, employees may be

grouped according to their annual salary in intervals such as $10–20,000, $20–30,000,

and so on. Let the interval that contains the median frequency be the median inter-

val. We can approximate the median of the entire data set (e.g., the median salary) by

interpolation using the formula



median L

1

+



N

/2 −


freq

l

freq

median

width,

(2.3)


where L

1

is the lower boundary of the median interval, is the number of values in



the entire data set,

freq

l

is the sum of the frequencies of all of the intervals that are




Yüklə 7,95 Mb.

Dostları ilə paylaş:
1   ...   29   30   31   32   33   34   35   36   ...   343




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə