Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data dan Eksplorasi Data Kuliah 2 dan 3 1. What is Data?  Collection of data objects and their attributes  An attribute is a property or characteristic.

Similar presentations


Presentation on theme: "Data dan Eksplorasi Data Kuliah 2 dan 3 1. What is Data?  Collection of data objects and their attributes  An attribute is a property or characteristic."— Presentation transcript:

1 Data dan Eksplorasi Data Kuliah 2 dan 3 1

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 Objects

3 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  ID has no limit but age has a maximum and minimum value 3

4 4 Tipe atributDeskripsiContoh Kategori (kualitatif) ‏ NominalNilai dari atribut nominal adalah nama- nama yang berbeda, yaitu nilai nominal hanya menyediakan informasi yang cukup untuk membedakan satu objek dengan objek yang lain. (= dan  ) ‏ Kode pos, ID Number karyawan, warna mata, jenis kelamin OrdinalNilai dari atribut ordinal menyediakan informasi yang cukup mengurutkan objek. ( ) ‏ Nomor jalan, grade Numerik (Kuantitatif) ‏ IntervalUntuk atribut interval, perbedaan antarnilai adalah sesuatu yang berarti, adanya unit pengukuran. (+,  ) ‏ Tanggal pada kalender RatioUntuk variabel rasio, perbedaan dan rasio merupakan hal yang berarti. (*, /) ‏ Kuantitas moneter, count, umur, panjang, arus listrik Tipe-tipe atribut yang berbeda

5 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 variables. 5

6 Types of data sets  Record  Data Matrix  Document Data  Transaction Data  Graph  World Wide Web  Molecular Structures  Ordered  Spatial Data  Temporal Data  Sequential Data  Genetic Sequence Data 6

7 Record Data  Data that consists of a collection of records, each of which consists of a fixed set of attributes 7

8 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. 8

9 Ordered Data Temporal Data Temporal data is data whose objects have attributes that represent measurements taken over time. For example, financial data set are time series that give the daily prices of various stocks. A time series is a sequence of measurements of some attribute e.g., stock price or rainfall, taken at (usually regular) points in time.)‏ 9

10 Ordered Data  Sequences of transactions An element of the sequence Items/Events The data still consists of a set of transactions and items, but time and customer ID attributes are associated with each transaction. 10

11 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 11

12 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 Two Sine WavesTwo Sine Waves + Noise 12

13 Outliers  Outliers are data objects with characteristics that are considerably different than most of the other data objects in the data set 13

14 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  the missing values can be estimated (interpolated) by using the remaining values.  Ignore the Missing Value During Analysis  e.g., suppose that objects are being clustered and the similarity between pairs of data objects.  the similarity can be calculated by using only the non-missing attributes 14

15 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  That care needs to be taken to avoid accidentally combining data objects that are similar, but not duplicates.  Data cleaning  Process of dealing with duplicate data issues 15

16 Data Preprocessing  Aggregation  Sampling  Dimensionality Reduction  Feature subset selection  Feature creation  Discretization and Binarization  Attribute Transformation 16

17 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  Aggregated data tends to have less variability 17

18 Several motivations for aggregation  Smaller data sets require less memory and processing time.  if the aggregation is done properly then the aggregation can act as a change of scope or scale, providing a high level view of the data instead of a low level view.  the behavior of groups of objects or attributes is often more ‘stable’ that that of individual objects or attributes. 18

19 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 set of data of interest is too expensive or time consuming. 19

20 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  if the standard deviation is the property of interest, then a sample is representative if the sample has a standard deviation that is close to that of the original data 20

21 Types of Sampling  Simple Random Sampling  There is an equal probability of selecting any particular item  Sampling without replacement  As each item is selected, it is removed from the population  Sampling with replacement  Objects are not removed from the population as they are selected for the sample.  In sampling with replacement, the same object can be picked up more than once 21

22 Sample Size 8000 points 2000 Points500 Points Larger sample sizes increase the probability that a sample will be representative, but also eliminate much of the advantage of sampling. Conversely, with smaller sample sizes, patterns may be missed or erroneous patterns detected. 22

23 Dimensionality Reduction  Purpose:  Reduce amount of time and memory required by data mining algorithms  Allow data to be more easily visualized  May help to eliminate irrelevant features or reduce noise  Techniques  Principle Component Analysis 23

24 Feature Subset Selection  Another way to reduce dimensionality of data  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 students' GPA 24

25 Feature Creation  Create new attributes that can capture the important information in a data set much more efficiently than the original attributes  Three general methodologies:  Feature Extraction  domain-specific  the creation of a new, smaller set of features from the original set of features.  E.g., consider a set of photographs, where each photograph is to be classified according to whether it contains a human face or not  Mapping Data to New Space  e.g. for each time series, the Fourier transform produces a new data object, whose attributes are related to frequencies.  Feature Construction  combining features  one or more new features constructed out of the original features may be more useful 25

26 Attribute Transformation  A function that maps the entire set of values of a given attribute to a new set of replacement values such that each old value can be identified with one of the new values  Simple functions: x k, |x|  Standardization and Normalization 26

27 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

28 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

29 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.

30 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.

31 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.  Can detect general patterns and trends  Can detect outliers and unusual patterns

32 Example: Sea Surface Temperature  The following shows the Sea Surface Temperature (SST) for July 1982  Tens of thousands of data points are summarized in a single figure

33 Representation  Is the mapping of information to a visual format  Data objects, their attributes, and the relationships among data objects are translated into graphical elements such as points, lines, shapes, and colors.  Example:  Objects are often represented as points  Their attribute values can be represented as the position of the points or the characteristics of the points, e.g., color, size, and shape  If position is used, then the relationships of points, i.e., whether they form groups or a point is an outlier, is easily perceived.

34 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:

35 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)

36 Two-Dimensional Histograms  Show the joint distribution of the values of two attributes  Example: petal width and petal length  What does this tell us?

37 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 10 th percentile 25 th percentile 75 th percentile 50 th percentile 10 th percentile

38 Example of Box Plots  Box plots can be used to compare attributes

39 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  See example on the next slide

40 Scatter Plot Array of Iris Attributes

41 OLAP  On-Line Analytical Processing (OLAP) was proposed by E. F. Codd, the father of the relational database.  Relational databases put data into tables, while OLAP uses a multidimensional array representation.  Such representations of data previously existed in statistics and other fields  There are a number of data analysis and data exploration operations that are easier with such a data representation.

42 Creating a Multidimensional Array  Two key steps in converting tabular data into a multidimensional array.  First, identify which attributes are to be the dimensions and which attribute is to be the target attribute whose values appear as entries in the multidimensional array.  The attributes used as dimensions must have discrete values  The target value is typically a count or continuous value, e.g., the cost of an item  Can have no target variable at all except the count of objects that have the same set of attribute values  Second, find the value of each entry in the multidimensional array by summing the values (of the target attribute) or count of all objects that have the attribute values corresponding to that entry.

43 Example: Iris data  We show how the attributes, petal length, petal width, and species type can be converted to a multidimensional array  First, we discretized the petal width and length to have categorical values: low, medium, and high  We get the following table - note the count attribute

44 Example: Iris data (continued)‏  Each unique tuple of petal width, petal length, and species type identifies one element of the array.  This element is assigned the corresponding count value.  The figure illustrates the result.  All non-specified tuples are 0.

45 Example: Iris data (continued)‏  Slices of the multidimensional array are shown by the following cross-tabulations  What do these tables tell us?

46 OLAP Operations: Data Cube  The key operation of a OLAP is the formation of a data cube  A data cube is a multidimensional representation of data, together with all possible aggregates.  By all possible aggregates, we mean the aggregates that result by selecting a proper subset of the dimensions and summing over all remaining dimensions.  For example, if we choose the species type dimension of the Iris data and sum over all other dimensions, the result will be a one-dimensional entry with three entries, each of which gives the number of flowers of each type.

47  Consider a data set that records the sales of products at a number of company stores at various dates.  This data can be represented as a 3 dimensional array  There are 3 two-dimensional aggregates (3 choose 2 ), 3 one-dimensional aggregates, and 1 zero-dimensional aggregate (the overall total)‏ Data Cube Example

48  The following figure table shows one of the two dimensional aggregates, along with two of the one- dimensional aggregates, and the overall total Data Cube Example (continued)‏

49 OLAP Operations: Slicing and Dicing  Slicing is selecting a group of cells from the entire multidimensional array by specifying a specific value for one or more dimensions.  Dicing involves selecting a subset of cells by specifying a range of attribute values.  This is equivalent to defining a subarray from the complete array.  In practice, both operations can also be accompanied by aggregation over some dimensions.

50 OLAP Operations: Roll-up and Drill-down  Attribute values often have a hierarchical structure.  Each date is associated with a year, month, and week.  A location is associated with a continent, country, state (province, etc.), and city.  Products can be divided into various categories, such as clothing, electronics, and furniture.  Note that these categories often nest and form a tree or lattice  A year contains months which contains day  A country contains a state which contains a city

51 OLAP Operations: Roll-up and Drill-down  This hierarchical structure gives rise to the roll-up and drill- down operations.  For sales data, we can aggregate (roll up) the sales across all the dates in a month.  Conversely, given a view of the data where the time dimension is broken into months, we could split the monthly sales totals (drill down) into daily sales totals.  Likewise, we can drill down or roll up on the location or product ID attributes.

52 Rujukan  Tan P., Michael S., & Vipin K. 2006. Introduction to Data mining. Pearson Education, Inc.  Han J & Kamber M. 2006. Data mining – Concept and Techniques.Morgan-Kauffman, San Diego 52


Download ppt "Data dan Eksplorasi Data Kuliah 2 dan 3 1. What is Data?  Collection of data objects and their attributes  An attribute is a property or characteristic."

Similar presentations


Ads by Google