Prezentacja programu PowerPoint - Uniwersytet...

55
MODA

Transcript of Prezentacja programu PowerPoint - Uniwersytet...

Page 1: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

MODA

Page 2: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 3: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Data – what are they?

Page 4: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

TYPES OF DATA (1)

•Generally we distinguish:

Quantitative Data

Qualitative Data

•Bivaluated:often very useful

•Remember: Null Values are not applicable

•Missing data usually not acceptable

Page 5: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Types of Attribute Values: Levels of Measurement

Page 6: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 7: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 8: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Types of Attribute Values: Discrete and Continuous Attributes

Page 9: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Missing Values

Page 10: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Handling Missing values by Eliminating Data

objects

Page 11: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Handling Missing values by Eliminating attributes

Page 12: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Handling Missing values by Estimating missing values

Page 13: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 14: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 15: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 16: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 17: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 18: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 19: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 20: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 21: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 22: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 23: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 24: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 25: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 26: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 27: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Simple DiscretizationMethods: Binning

•Equal-width(distance) partitioning:

–It divides the range (values of a given attribute)

–into N intervals of equal size: uniform grid

–if A and B are the lowest and highest values of the attribute, the width of intervals will be: W = (B-A)/N.

–The most straightforward

–But outliers may dominate presentation

–Skewed data is not handled well.

Page 28: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Simple DiscretizationMethods: Binning

•Equal-depth(frequency) partitioning:

–It divides the range (values of a given attribute)

–into N intervals, each containing approximately same number of samples (elements)

–Good data scaling

–Managing categorical attributes can be tricky.

Page 29: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Binning Methods for Data Smoothing (book example)

•Sorted data (attribute values ) for price (attribute: price in dollars): 4, 8, 9, 15, 21, 21, 24, 25, 26, 28, 29, 34 •Partition into (equal-depth) bins: •Bin 1: 4, 8, 9, 15 •Bin 2: 21, 21, 24, 25 •Bin 3: 26, 28, 29, 34 •Smoothing by bin means: •Bin 1: 9, 9, 9, 9 •Bin 2: 23, 23, 23, 23 •Bin 3: 29, 29, 29, 29 •Smoothing by bin boundaries: •Bin 1: 4, 4, 4, 15 •Bin 2: 21, 21, 25, 25 •Bin 3: 26, 26, 26, 34 •Replace all values in a BIN by ONE value (smoothing values)

Page 30: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 31: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Iris Sample Data Set

• Many of the exploratory data techniques are illustrated with the Iris Plant data set.

– Can be obtained from the UCI Machine Learning Repository http://www.ics.uci.edu/~mlearn/MLRepository.html

– From the statistician Douglas Fisher

– Three flower types (classes):

• Setosa

• Virginica

• Versicolour

– Four (non-class) attributes

• Sepal width and length

• Petal width and length

Virginica. Robert H. Mohlenbrock.

USDA NRCS. 1995. Northeast

wetland flora: Field office guide to

plant species. Northeast National

Technical Center, Chester, PA.

Courtesy of USDA NRCS Wetland

Science Institute.

Page 32: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 33: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 34: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Summary Statistics • Summary statistics are numbers that

summarize properties of the data

– Summarized properties include frequency, location and spread

• Examples: location - mean spread - standard deviation

– Most summary statistics can be calculated in a single pass through the data

Page 35: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Frequency and Mode • The frequency of an attribute value is the

percentage of time the value occurs in the data set

– For example, given the attribute ‘gender’ and a representative population of people, the gender ‘female’ occurs about 50% of the time.

• The mode of a an attribute is the most frequent attribute value

• The notions of frequency and mode are typically used with categorical data

Page 36: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Percentiles • For continuous data, the notion of a percentile

is more useful.

Given an ordinal or continuous attribute x and a number p between 0 and 100, the pth percentile is a value of x such that p% of the observed values of x are less than .

• For instance, the 50th percentile is the value such that 50% of all values of x are less than .

xp

xp

xp

x50%

x50%

Page 37: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Measures of Location: Mean and Median

• The mean is the most common measure of the location of a set of points.

• However, the mean is very sensitive to outliers.

• Thus, the median or a trimmed mean is also commonly used.

Page 38: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Measures of Spread: Range and Variance

• Range is the difference between the max and min

• The variance or standard deviation is the most common measure of the spread of a set of points.

• However, this is also sensitive to outliers, so that other measures are often used.

Page 39: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Visualization Visualization is the conversion of data into a visual

or tabular format so that the characteristics of the data and the relationships among data items or attributes can be analyzed or reported.

• Visualization of data is one of the most powerful and appealing techniques for data exploration. – Humans have a well developed ability to analyze large

amounts of information that is presented visually

– Can detect general patterns and trends

– Can detect outliers and unusual patterns

Page 40: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Arrangement • Is the placement of visual elements within a

display

• Can make a large difference in how easy it is to understand the data

• Example:

Page 41: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Selection • Is the elimination or the de-emphasis of certain objects and

attributes

• Selection may involve the chossing a subset of attributes

– Dimensionality reduction is often used to reduce the number of dimensions to two or three

– Alternatively, pairs of attributes can be considered

• Selection may also involve choosing a subset of objects

– A region of the screen can only show so many points

– Can sample, but want to preserve points in sparse areas

Page 42: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Visualization Techniques: Histograms • Histogram

– Usually shows the distribution of values of a single variable

– Divide the values into bins and show a bar plot of the number of objects in each bin.

– The height of each bar indicates the number of objects

– Shape of histogram depends on the number of bins

• Example: Petal Width (10 and 20 bins, respectively)

Page 43: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Two-Dimensional Histograms • Show the joint distribution of the values of two

attributes • Example: petal width and petal length

– What does this tell us?

Page 44: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Visualization Techniques: Box Plots • Box Plots

– Invented by J. Tukey – Another way of displaying the distribution of data – Following figure shows the basic part of a box plot

outlier

10th percentile

25th percentile

75th percentile

50th percentile

10th percentile

Page 45: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Example of Box Plots • Box plots can be used to compare attributes

Page 46: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

v

Page 47: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 48: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 49: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 50: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 51: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 52: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25
Page 53: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

• The four sets of data that make up the quartet are similar in many respects. For all four:

• mean of the x values = 9.0 • mean of the y values = 7.5 • equation of the least-squared regression line is: y = 3 + 0.5x • sums of squared errors (about the mean) = 110.0 • regression sums of squared errors (variance accounted for

by x) = 27.5 • residual sums of squared errors (about the regression line)

= 13.75 • correlation coefficient = 0.82 • coefficient of determination = 0.67

Page 54: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

• However, when the data are plotted, the differences among the data sets are revealed.

Page 55: Prezentacja programu PowerPoint - Uniwersytet Śląskizsi.tech.us.edu.pl/~nowak/bien/MODA.pdfPrezentacja programu PowerPoint Author Kowalski Ryszard Created Date 10/7/2013 10:45:25

Sources:

Edward R. Tufte, The Visual Display of Quantitative Information (Cheshire, Connecticut: Graphics

Press, 1983), pp. 14-15.

F.J. Anscombe, "Graphs in Statistical Analysis," American Statistician, vol. 27 (Feb 1973), pp. 17-21.