• No results found

INTRODUCTION TO DATA MINING: DATA

N/A
N/A
Protected

Academic year: 2020

Share "INTRODUCTION TO DATA MINING: DATA"

Copied!
59
0
0

Loading.... (view fulltext now)

Full text

(1)

INTRODUCTION TO DATA MINING:

DATA

AND

DATA EXPLORATION

(2)

WHAT IS DATA?

● Collection of data objects and their

attributes

● An attribute is a property or

characteristic of an object

– Examples: eye color of a person,

temperature, etc.

– Attribute is also known as

variable, field, characteristic, or feature

● A collection of attributes describe

an object

– Object is also known as record,

point, case, sample, entity, or instance

Attributes

(3)

TYPES OF ATTRIBUTES

● There are different types of attributes

– Nominal

◆ Examples: ID numbers, eye color, zip codes

– Ordinal

◆ Examples: rankings (e.g., taste of potato chips on a scale from 1-10), grades, height in {tall, medium, short}

– Interval

◆ Examples: calendar dates, temperatures in Celsius or Fahrenheit.

– Ratio

(4)

DISCRETE AND CONTINUOUS ATTRIBUTES

● Discrete Attribute

– Has only a finite or countably infinite set of values

– Examples: zip codes, counts, or the set of words in a collection of

documents

– Often represented as integer variables.

– Note: binary attributes are a special case of discrete attributes

● Continuous Attribute

– Has real numbers as attribute values

– Examples: temperature, height, or weight.

– Practically, real values can only be measured and represented using a

finite number of digits.

– Continuous attributes are typically represented as floating-point

(5)

TYPES OF DATA SETS

Record

Data Matrix Document Data Transaction Data

Graph

World Wide Web Molecular Structures

Ordered

Spatial Data

Temporal Data

Sequential Data

(6)

IMPORTANT CHARACTERISTICS OF STRUCTURED

DATA

Dimensionality

Curse of Dimensionality

Sparsity

Only presence counts

Resolution

(7)

RECORD DATA

● Data that consists of a collection of records, each of which

(8)

DATA MATRIX

● If data objects have the same fixed set of numeric attributes,

then the data objects can be thought of as points in a

multi-dimensional space, where each dimension represents a distinct attribute

● Such data set can be represented by an m by n matrix, where

there are m rows, one for each object, and n columns, one for each attribute

(9)

DOCUMENT DATA

● Each document becomes a `term' vector,

– each term is a component (attribute) of the vector,

– the value of each component is the number of times the

(10)

TRANSACTION DATA

● A special type of record data, where

– each record (transaction) involves a set of items.

– For example, consider a grocery store. The set of products

purchased by a customer during one shopping trip constitute a transaction, while the individual products that were purchased are the items.

item

(11)

GRAPH DATA

● Examples: Generic graph and HTML Links

<a href="papers/papers.html#bbbb"> Data Mining </a>

<li> <a href="papers/papers.html#aaaa"> Graph Partitioning </a>

<li> <a href="papers/papers.html#aaaa"> Parallel Solution of Sparse Linear System of Equations </a>

<li> <a href="papers/papers.html#ffff"> N-Body Computation and Dense Linear System Solvers

(12)

CHEMICAL DATA

● Benzene Molecule: C

(13)

ORDERED DATA

● Sequences of transactions

An element of the sequence

(14)

ORDERED DATA

(15)

ORDERED DATA

● Spatio-Temporal Data

Average Monthly Temperature of land and ocean

(16)

DATA QUALITY

● What kinds of data quality problems?

● How can we detect problems with the data? ● What can we do about these problems?

● Examples of data quality problems:

– Noise and outliers – missing values – duplicate data

(17)

NOISE

● Noise refers to modification of original values

– Examples: distortion of a person’s voice when talking on a poor

phone and “snow” on television screen

(18)

OUTLIERS

● Outliers are data objects with characteristics that are

considerably different than most of the other data objects in the data set

(19)

MISSING VALUES

● Reasons for missing values

– Information is not collected

(e.g., people decline to give their age and weight)

– Attributes may not be applicable to all cases

(e.g., annual income is not applicable to children)

● Handling missing values

– Eliminate Data Objects – Estimate Missing Values

– Ignore the Missing Value During Analysis

(20)

DUPLICATE DATA

● Data set may include data objects that are duplicates, or almost

duplicates of one another

– Major issue when merging data from heterogeous sources

● Examples:

– Same person with multiple email addresses

● Data cleaning

(21)

DATA PREPROCESSING

● Aggregation ● Sampling

● Dimensionality Reduction ● Feature subset selection ● Feature creation

● Discretization and Binarization ● Attribute Transformation

(22)

AGGREGATION

● Combining two or more attributes (or objects) into a single

attribute (or object)

● Purpose

– Data reduction

◆ Reduce the number of attributes or objects

– Change of scale

◆ Cities aggregated into regions, states, countries, etc

– More “stable” data

(23)

SAMPLING

● Sampling is the main technique employed for data selection.

– It is often used for both the preliminary investigation of the

data and the final data analysis.

● Statisticians sample because obtaining the entire set of data of

interest is too expensive or time consuming.

● Sampling is used in data mining because processing the entire

(24)

SAMPLING …

● The key principle for effective sampling is the following:

– using a sample will work almost as well as using the entire data sets,

if the sample is representative

– A sample is representative if it has approximately the same property (of interest) as the original set of data

(25)

SAMPLE SIZE

(26)

CURSE OF DIMENSIONALITY

● When dimensionality increases, data becomes increasingly

sparse in the space that it occupies

● Definitions of density and distance between points, which is

critical for clustering and outlier detection, become less meaningful

(27)

DIMENSIONALITY REDUCTION

● Purpose:

– Avoid curse of dimensionality

– Reduce amount of time and memory required by data mining

algorithms

– Allow data to be more easily visualized

(28)

FEATURE SUBSET SELECTION

● Reduce dimensionality of data

Remove:

● Redundant features

– duplicate much or all of the information contained in one or more

other attributes

– Example: purchase price of a product and the amount of sales tax

paid

● Irrelevant features

– contain no information that is useful for the data mining task at hand – Example: students' ID is often irrelevant to the task of predicting

(29)

FEATURE SUBSET SELECTION

● Techniques:

– Brute-force approch:

◆Try all possible feature subsets as input to data mining algorithm

– Embedded approaches:

◆ Feature selection occurs naturally as part of the data mining algorithm

– Filter approaches:

(30)
(31)

WHAT IS DATA EXPLORATION?

Key motivations of data exploration include

⚫ Helping to select the right tool for preprocessing or analysis

⚫ Making use of humans’ abilities to recognize patterns

People can recognize patterns not captured by data analysis tools

Related to the area of Exploratory Data Analysis (EDA)

A preliminary exploration of the data to better

understand its characteristics.

(32)

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

(33)

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.

(34)

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

(35)

VISUALIZATION TECHNIQUES: SCATTER PLOTS

Scatter plots

⚫ Attributes values determine the position

⚫ Two-dimensional scatter plots most common, but can have three-dimensional scatter plots

⚫ Often additional attributes can be displayed by using the size, shape, and color of the markers that represent the objects

⚫ It is useful to have arrays of scatter plots can compactly summarize the relationships of several pairs of attributes

(36)
(37)

PRACTICE!

The use the WEKA software. It is opensource (GNU) freely downloadable from

http://www.cs.waikato.ac.nz/ml/weka/

Weka 3.6 is the latest stable version of Weka.

Weka is a collection of algorithms for data mining tasks and contains tools for data pre-processing, classification, regression, clustering, association rules, and

visualization.

(38)

38

MACHINE LEARNING WITH WEKA

Comprehensive set of tools:

⚫ Pre-processing and data analysis

⚫ Mining algorithms

(for classification, clustering, etc.)

⚫ Evaluation metrics

Three modes of operation:

⚫ GUI

⚫ command-line (not discussed)

(39)

ARFF FILES

ARFF files have two distinct sections.

Header information: The Header of the ARFF file

contains the name of the relation, a list of the attributes (the columns in the data), and their types.

(40)

40

ATTRIBUTE-RELATION FILE FORMAT

(ARFF)

Weka reads ARFF files:

@relation adult

@attribute age numeric @attribute name string

@attribute education {College, Masters, Doctorate} @attribute class {>50K,<=50K}

@data

50,Leslie,Masters,>50K ?,Morgan,College,<=50K

Supported attributes:

⚫ numeric, nominal, string, date

Comma Separated Values (CSV)

(41)

ARFF FILE: EXAMPLE

@RELATION iris

@ATTRIBUTE sepallength NUMERIC @ATTRIBUTE sepalwidth NUMERIC @ATTRIBUTE petallength NUMERIC @ATTRIBUTE petalwidth NUMERIC @ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica} @DATA 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0.2,Iris-setosa 4.7,3.2,1.3,0.2,Iris-setosa 4.6,3.1,1.5,0.2,Iris-setosa 5.0,3.6,1.4,0.2,Iris-setosa 5.4,3.9,1.7,0.4,Iris-setosa 4.6,3.4,1.4,0.3,Iris-setosa 5.0,3.4,1.5,0.2,Iris-setosa

(42)

EXERCISE 1

Download and install Weka 3.6

Open Weka, select the Explorer button and load the IRIS dataset

⚫ How many records are in this dataset?

⚫ How many attributes? And classes?

⚫ Which are the types of the attribute?

⚫ Which is the attribute with greatest standard deviation? Which is the interpretation of this value?

(43)

EXERCISE 2

Preprocessing on the Iris dataset:

Discretize the numeric attributes of the Iris dataset using the unsupervised Discretize filter into 5 bins.

Notice the obtained discretization. How many elements in each interval? Is this discretization well balanced?

Now “undo” and try supervised discretization: how many bins you have now? Are the intervals well balanced?

Which are the attributes most relevant respect to the class?

(44)

EXERCISE 3

Load the dataset old_faithful

Use the visualization tab to perform visual inspection Visualize the scatter plot for the combinations of: F1 vs F2. Are these attributes related or not?

Determine visually the data points that are the outliers (extreme high or low values).

From the preprocessing tab, normalize the attributes to be in the [0,1] interval – use of the Normalize filter

(45)

EXERCISE 4

Load the breast cancer dataset

Remove the ID using the Remove filter

(46)

EXERCISE 5

Prepare data for Weka: edit the car dataset to be read by Weka.

Remind you need the CSV format, therefore the name of the attributes must appear in the first row. You can use Excel or a text editor.

(47)
(48)

ATTRIBUTE VALUES

● Attribute values are numbers or symbols assigned to an attribute

● Distinction between attributes and attribute values

– Same attribute can be mapped to different attribute values

◆ Example: height can be measured in feet or meters

– Different attributes can be mapped to the same set of values

◆ Example: Attribute values for ID and age are integers

◆ But properties of attribute values can be different

(49)

PROPERTIES OF ATTRIBUTE VALUES

● The type of an attribute depends on which of the following

properties it possesses:

– Distinctness: = ≠ – Order: < >

– Addition: + - – Multiplication: * /

– Nominal attribute: distinctness

– Ordinal attribute: distinctness & order

– Interval attribute: distinctness, order & addition – Ratio attribute: all 4 properties

(50)

Attribute Level

Transformation Comments

Nominal Any permutation of values If all employee ID numbers were reassigned, would it make any difference?

Ordinal An order preserving change of values, i.e.,

new_value = f(old_value)

where f is a monotonic function.

An attribute encompassing the notion of good, better best can be represented equally well by the values {1, 2, 3} or by { 0.5, 1, 10}.

Interval new_value =a * old_value + b

where a and b are constants

Thus, the Fahrenheit and Celsius temperature scales differ in terms of where their zero value is and the size of a unit (degree).

Ratio new_value = a * old_value Length can be measured in meters or feet.

(51)

TECHNIQUES USED IN DATA EXPLORATION

In EDA, as originally defined by Tukey

⚫ The focus was on visualization

⚫ Clustering and anomaly detection were viewed as exploratory techniques

⚫ In data mining, clustering and anomaly detection are major areas of interest, and not thought of as just exploratory

(52)

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

(53)

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

(54)

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 .

(55)

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.

(56)

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.

(57)

EXAMPLE: SEA SURFACE

TEMPERATURE

The following shows the Sea Surface Temperature (SST) for July 1982

(58)

SELECTION

Is the elimination or the de-emphasis of certain objects and attributes

Selection may involve the choosing 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

(59)

TWO-DIMENSIONAL HISTOGRAMS

Show the joint distribution of the values of two attributes Example: petal width and petal length

References

Related documents

GAAP and IFRS have general requirements for hedge accounting as well as requirements for specifi c types of hedging relationships (i.e., a fair value hedge or a cash fl ow

Density: Figure 1 shows the results of the density tests conducted on the concrete cubes prepared using sawdust as partial replacement of sand from all the three species of

Attorney Rogers filed a motion for a change of venue for Bob White’s second trial from Livingston, Polk County to Conroe, Montgomery County.. 36 Rogers hoped that he would have a

Players can create characters and participate in any adventure allowed as a part of the D&amp;D Adventurers League.. As they adventure, players track their characters’

Schools who cancel reservations within 10 working days of course commencement WILL BE INVOICED for fees, unless the STAR Office is able to find a replacement student

There were no differences in growth rate between mutants D FgCYP51A , D FgCYP51B , D FgCYP51C , D FgCYP51AC and D FgCYP51BC (Table 4) and the wild-type parental strain PH-1 in PDB

112 / جنگ ی بذ ، ی ح ی وقت ، ی هرود ،يراتفر مولع هلجم 9 هرامش ، 2 ، ناتسبات 9394 2 - پ شهوژ شور زا یکی اب اه ای /و یشیامزآ یاه یشیامزآ هبش .دنشاب هدش ماجنا 5 - شهوژپ

Whether grown as freestanding trees or wall- trained fans, established figs should be lightly pruned twice a year: once in spring to thin out old or damaged wood and to maintain