Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bayesian Classification Using P-tree  Classification –Classification is a process of predicting an – unknown attribute-value in a relation –Given a relation,

Similar presentations


Presentation on theme: "Bayesian Classification Using P-tree  Classification –Classification is a process of predicting an – unknown attribute-value in a relation –Given a relation,"— Presentation transcript:

1 Bayesian Classification Using P-tree  Classification –Classification is a process of predicting an – unknown attribute-value in a relation –Given a relation, R(k 1..k n, A 1, …, A n, C), where k i ’s are the structural attribute A 1, …, A n, C are attributes and C is the class label attribute. Given an unclassified data sample (no C-value present), classification predicts the C-value for the given sample and thus determine its class.  There are two types of classification techniques –Eager classifier: Build a classifier from training sample ahead of classifying a new sample. –Lazy classifier: No classifier is built ahead of time, training data is used directly to classify new sample.  Stream Data: comes continuously or in fixed time intervals. –E.g., weather data for a particular area or images taken from a satellite within fixed intervals. These notes contain NDSU confidential & Proprietary material. Patents pending on bSQ, Ptree technology

2 Preparing the data for Classification  Data Cleaning –Involves the handling of noisy data and missing values. –Noise could be removed or reduce by applying "smoothing" and missing values could be replaced with most common or some statistically determined value.  Relevance Analysis –In the given data not all its attributes are relevant to the classification task. –To reduce the task of classification these attribute should be identified and remove from classification task.  Data transformation –Data can be generalized using a concept hierarchy from low level to high level. –For spatial data, values of different bands are continuous numerical values. We may intervalize them as high, medium, low etc. using the concept hierarchy.

3 Bayesian Classification A Bayesian classifier is a statistical classifier, which is based on following theorem known as Bayes theorem: Bayes theorem: Let X be a data sample whose class label is unknown. Let H be a hypothesis (i.e., X belongs to class, C). P(H|X) is the posterior probability of H given X. P(H) is the probability of H, then P(H|X) = P(X|H)P(H)/P(X) Where P(X|H) is the posterior probability of X given H and P(X) is the probability of X.

4 Naïve Bayesian Classification  Given a relation R(K, A 1..A n, C) where K is the structure attribute and A i and C are feature attributes. Also C is the class label attribute.  Each data sample is represented by feature vector, X=(x 1..,x n ) depicting the measurements made on the sample from A 1,..A n, respectively.  Given classes, C 1,...C m, the naive Bayesian Classifier will predict the class of unknown data sample, X, to be class, C j having the highest posterior probability, conditioned on X P(C j |X) > P(C i |X), where i  j. (called the maximum posteriori hypothesis),  From the Bayes theorem: P(C j |X) = P(X|C j )P(C j )/P(X) –P(X) is constant for all classes so we maximize P(X|C j )P(C j ). If we assume equal likelihood of classes, maximize P(X|C j ) otherwise we maximize the whole product. –To reduce the computational complexity of calculating all P(X|C j )'s the naive assumption of class conditional independence of values is used.

5 Naïve Bayesian Classification Class Conditional Independence:  This assumption says that the values of the attributes are conditionally independent of one another. So, P(X|C j )=P(X 1 |C j )*..*P(X n |C j ).  Now the P(X i |C j )’s can be calculated directly from data sample. Calculating P(X i |C j ) from P-trees : P(X i |C j ) = s j x i /s j where s j = # of samples in class C j and s j x i = # of training samples of class C j, having A i -value x i. These values can be calculated by: s j x i = RootCount [ (P i (x i ) ^ (P C (C j ) ], s j = RootCount [ P C (C j )]

6  One problem with Non-Naïve-Bayesian P-tree classifiers: If the rc(Ptree(X))=0 then we will not get a class label for that tuple.  It could happen if the whole tuple is not present in the training data Non-Naive Bayesian Classifier (Cont.) X 1 X 2 … X k-1 X k X k+1 … X n Whole tuple  Solution (Partial Naïve): So in that case we can divide the whole tuple into two parts separating one attribute from the whole tuple. e.g. X 1 X 2 … X k-1 X k X k+1 … X n XkXk X 1 X 2 … X k-1 X k+1 … X n Whole tuple Separated tuple X’ P(X|C i )=rc[Ptree( X’) ^ P C (C i )] * rc[P k ( X k ) ^ P C (C i )]  Now the problem is how to select the attribute X k  One way to use the information gain theory.  Calculate the info gain of all the attributes X i then X k is the one having lowest information gain

7 Information Gain Let C have m different classes, C 1 to C m The information needed to classify a given sample is: I(s 1..s m ) = -  (i =1..m)[p i *log 2 (p i )] where p i =s i /s is the probability that a sample belongs to C i. A, an attrib, having values, {a 1...a v }. The entropy of A is E(A) = (  j=1..v  i=1..m s ij / s ) * I(s 1j..s mj ) I(s 1j..s mj ) = -  i=1..m p ij *log 2 (p ij ) where p ij =s ij /S j is the probability that a sample in C i belongs to A i Information gain of A: Gain(A) = I(s 1..s m ) - E(A) s i = rc(P C (c i ) S j = rc(P A (a j ) s ij = rc( P C (c i ) ^ P A (a j ) )

8 Performance of Ptree AND operation Performance of Classification: Comparison Performance for 4 classification classes BitsNBCBCIG Succ IG Use 2.14.48.40 3.19.50.34 4.27.51.32 5.26.52.31 6.24.51.27 7.23.51.20 IG Use - Proportion of the number of times the information gain was used for successful classification. Performance of Classification: Classification success rate comparisons

9 Performance in Data Stream Application  Data Stream mining should have the following criteria –It must require a small constant time per record. –It must use only a fixed amount of main memory –It must be able to build a model at most one scan of the data –It must make a usable model available at any point of time. –It should produce a model that is equivalent to the one that would be obtained by the corresponding database-mining algorithm. –When the data-generating phenomenon is changing over time, the model at any time should be up- to-date but also include the past information.  Data Stream mining Using P-tree –It must require a small constant time per record. P-tree require small and constant time. –It must use only a fixed amount of main memory Ok for P-tree –It must be able to build a model at most one scan of the data To build the P-tree only one scan is required –It must make a usable model available at any point of time. Ok for P-tree –It should produce a model that is equivalent to the one that would be obtained by the corresponding database-mining algorithm. Any conventional algorithm is also implementable with P-tree –When the data-generating phenomenon is changing over time, the model at any time should be up-to-date but also include the past information. Ok for P-tree


Download ppt "Bayesian Classification Using P-tree  Classification –Classification is a process of predicting an – unknown attribute-value in a relation –Given a relation,"

Similar presentations


Ads by Google