Drugs and Cosmetics Act, 1940 - Overview and Regulations

Drugs and Cosmetics Act, 1940 - Overview and Regulations
Slide Note
Embed
Share

The Drugs and Cosmetics Act of 1940 regulates the import, manufacture, distribution, and sale of drugs and cosmetics in India. It aims to prevent the entry of substandard or spurious drugs and ensures that only qualified individuals handle these products. The Act establishes regulatory boards and committees, mandates inspections of licensed premises, and sets standards for labeling and packing of products.

  • Drugs
  • Cosmetics
  • Regulations
  • India
  • Standards

Uploaded on Apr 04, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. DATA MINING LECTURE 10 Classification Basic Concepts Decision Trees

  2. Catching tax-evasion Tid Refund Marital Status Taxable Income Cheat No 1 Yes Single 125K Tax-return data for year 2011 No 2 No Married 100K No 3 No Single 70K No 4 Yes Married 120K A new tax return for 2012 Is this a cheating tax return? Yes 5 No Divorced 95K No 6 No Married 60K Refund Marital Taxable Income Cheat No 7 Yes Divorced 220K Status Yes 8 No Single 85K No Married 80K ? No 9 No Married 75K 10 Yes 10 No Single 90K 10 An instance of the classification problem: learn a method for discriminating between records of different classes (cheaters vs non-cheaters)

  3. What is classification? Classification is the task of learning a target function f that maps attribute set x to one of the predefined class labels y Tid Refund Marital Status Taxable Income One of the attributes is the class attribute In this case: Cheat Cheat No 1 Yes Single 125K No 2 No Married 100K Two class labels (or classes): Yes (1), No (0) No 3 No Single 70K No 4 Yes Married 120K Yes 5 No Divorced 95K No 6 No Married 60K No 7 Yes Divorced 220K Yes 8 No Single 85K No 9 No Married 75K Yes 10 No Single 90K 10

  4. Why classification? The target function f is known as a classification model Descriptive modeling: Explanatory tool to distinguish between objects of different classes (e.g., understand why people cheat on their taxes) Predictive modeling: Predict a class of a previously unseen record

  5. Examples of Classification Tasks Predicting tumor cells as benign or malignant Classifying credit card transactions as legitimate or fraudulent Categorizing news stories as finance, weather, entertainment, sports, etc Identifying spam email, spam web pages, adult content Understanding if a web query has commercial intent or not

  6. General approach to classification Training set consists of records with known class labels Training set is used to build a classification model A labeled test set of previously unseen data records is used to evaluate the quality of the model. The classification model is applied to new records with unknown class labels

  7. Illustrating Classification Task Attrib1 Attrib2 Attrib3 Class Tid Learning algorithm No 1 Yes Large 125K No 2 No Medium 100K No 3 No Small 70K No 4 Yes Medium 120K Induction Yes 5 No Large 95K No 6 No Medium 60K Learn Model No 7 Yes Large 220K Yes 8 No Small 85K No 9 No Medium 75K Yes 10 No Small 90K Model 10 Training Set Apply Model Attrib1 Attrib2 Attrib3 Class Tid ? 11 No Small 55K ? 12 Yes Medium 80K Deduction ? 13 Yes Large 110K ? 14 No Small 95K ? 15 No Large 67K 10 Test Set

  8. Evaluation of classification models Counts of test records that are correctly (or incorrectly) predicted by the classification model Confusion matrix Actual Class Predicted Class Class = 1 f11 f01 Class = 0 f10 f00 Class = 1 Class = 0 + correct # prediction s 11 f f = = 00 Accuracy + + + total # of prediction s 11 f 10 f f f 01 00 + wrong # prediction s 10 f f = = 01 Error rate + + + total # of prediction s 11 f 10 f f f 01 00

  9. Classification Techniques Decision Tree based Methods Rule-based Methods Memory based reasoning Neural Networks Na ve Bayes and Bayesian Belief Networks Support Vector Machines

  10. Classification Techniques Decision Tree based Methods Rule-based Methods Memory based reasoning Neural Networks Na ve Bayes and Bayesian Belief Networks Support Vector Machines

  11. Decision Trees Decision tree A flow-chart-like tree structure Internal node denotes a test on an attribute Branch represents an outcome of the test Leaf nodes represent class labels or class distribution

  12. Example of a Decision Tree Splitting Attributes Tid Refund Marital Status Taxable Income Cheat No 1 Yes Single 125K Refund No 2 No Married 100K Yes No Test outcome No 3 No Single 70K No 4 Yes Married 120K NO MarSt Yes 5 No Divorced 95K Married Single, Divorced No 6 No Married 60K TaxInc NO No 7 Yes Divorced 220K < 80K > 80K Yes 8 No Single 85K No 9 No Married 75K YES NO Yes 10 No Single 90K Class labels 10 Model: Decision Tree Training Data

  13. Another Example of Decision Tree Single, Divorced MarSt Married Tid Refund Marital Status Taxable Income Cheat NO Refund No 1 Yes Single 125K No Yes No 2 No Married 100K NO TaxInc No 3 No Single 70K < 80K > 80K No 4 Yes Married 120K Yes 5 No Divorced 95K YES NO No 6 No Married 60K No 7 Yes Divorced 220K Yes 8 No Single 85K There could be more than one tree that fits the same data! No 9 No Married 75K Yes 10 No Single 90K 10

  14. Decision Tree Classification Task Tree Induction algorithm Attrib1 Attrib2 Attrib3 Class Tid No 1 Yes Large 125K No 2 No Medium 100K No 3 No Small 70K Induction No 4 Yes Medium 120K Yes 5 No Large 95K No 6 No Medium 60K Learn Model No 7 Yes Large 220K Yes 8 No Small 85K No 9 No Medium 75K Yes 10 No Small 90K Model 10 Training Set Apply Model Decision Tree Attrib1 Attrib2 Attrib3 Class Tid ? 11 No Small 55K ? 12 Yes Medium 80K Deduction ? 13 Yes Large 110K ? 14 No Small 95K ? 15 No Large Test Set 67K 10

  15. Apply Model to Test Data Test Data Start from the root of tree. Refund Marital Taxable Income Cheat Status No Married 80K ? Refund 10 Yes No NO MarSt Married Single, Divorced TaxInc NO < 80K > 80K YES NO

  16. Apply Model to Test Data Test Data Refund Marital Taxable Income Cheat Status No Married 80K ? Refund 10 Yes No NO MarSt Married Single, Divorced TaxInc NO < 80K > 80K YES NO

  17. Apply Model to Test Data Test Data Refund Marital Taxable Income Cheat Status No Married 80K ? Refund 10 Yes No NO MarSt Married Single, Divorced TaxInc NO < 80K > 80K YES NO

  18. Apply Model to Test Data Test Data Refund Marital Taxable Income Cheat Status No Married 80K ? Refund 10 Yes No NO MarSt Married Single, Divorced TaxInc NO < 80K > 80K YES NO

  19. Apply Model to Test Data Test Data Refund Marital Taxable Income Cheat Status No Married 80K ? Refund 10 Yes No NO MarSt Married Single, Divorced TaxInc NO < 80K > 80K YES NO

  20. Apply Model to Test Data Test Data Refund Marital Taxable Income Cheat Status No Married 80K ? Refund 10 Yes No NO MarSt Assign Cheat to No Married Single, Divorced TaxInc NO < 80K > 80K YES NO

  21. Decision Tree Classification Task Tree Induction algorithm Attrib1 Attrib2 Attrib3 Class Tid No 1 Yes Large 125K No 2 No Medium 100K No 3 No Small 70K Induction No 4 Yes Medium 120K Yes 5 No Large 95K No 6 No Medium 60K Learn Model No 7 Yes Large 220K Yes 8 No Small 85K No 9 No Medium 75K Yes 10 No Small 90K Model 10 Training Set Apply Model Decision Tree Attrib1 Attrib2 Attrib3 Class Tid ? 11 No Small 55K ? 12 Yes Medium 80K Deduction ? 13 Yes Large 110K ? 14 No Small 95K ? 15 No Large 67K 10 Test Set

  22. Tree Induction Finding the best decision tree is NP-hard Greedy strategy. Split the records based on an attribute test that optimizes certain criterion. Many Algorithms: Hunt s Algorithm (one of the earliest) CART ID3, C4.5 SLIQ,SPRINT

  23. General Structure of Hunts Algorithm Let Dt be the set of training records that reach a node t Tid Refund Marital Taxable Income Cheat Status 1 Yes Single 125K No 2 No Married 100K No General Procedure: If Dt contains records that belong the same class yt, then t is a leaf node labeled as yt If Dt contains records with the same attribute values, then t is a leaf node labeled with the majority class yt If Dt is an empty set, then t is a leaf node labeled by the default class, yd If Dt contains records that belong to more than one class, use an attribute test to split the data into smaller subsets. Recursively apply the procedure to each subset. 3 No Single 70K No 4 Yes Married 120K No 5 No Divorced 95K Yes 6 No Married 60K No 7 Yes Divorced 220K No 8 No Single 85K Yes 9 No Married 75K No 10 No Single 90K Yes 10 Dt ?

  24. Tid Tid Refund Marital Tid Refund Marital Taxable Taxable Refund Marital Status Status Status Taxable Income Income Cheat Income Cheat Cheat Hunt s Algorithm 1 1 1 Yes Yes Yes Single Single Single 125K 125K 125K No No No 2 4 4 No Yes Yes Married Married Married 100K 120K 120K No No No 3 7 7 No Yes Yes Single Divorced 220K Divorced 220K 70K No No No Refund Don t Cheat 4 2 2 Yes No No Married Married Married 120K 100K 100K No No No Yes No 5 3 6 No No No Divorced 95K Single Married Yes No No 70K 60K Don t Cheat Don t Cheat 6 5 9 No No No Married Divorced 95K Married 60K 75K No Yes No 7 6 3 Yes No No Divorced 220K Married Single No No No 60K 70K 8 8 5 No No No Single Single Divorced 95K 85K 85K Yes Yes Yes 9 9 8 No No No Married Married Single 75K 75K 85K No No Yes Refund Refund 10 10 10 No No No Single Single Single 90K 90K 90K Yes Yes Yes Yes No Yes No 10 10 10 Don t Cheat Single, Divorced Don t Cheat Single, Divorced Marital Status Marital Status Married Married Don t Cheat Don t Cheat Taxable Income Cheat < 80K >= 80K Don t Cheat Cheat

  25. Constructing decision-trees (pseudocode) GenDecTree(Sample S, Features F) 1. If stopping_condition(S,F) = true then a. leaf = createNode() b. leaf.label= Classify(S) c. return leaf 2. root =createNode() 3. root.test_condition = findBestSplit(S,F) 4. V = {v| v a possible outcome of root.test_condition} 5. foreach value v V: a. Sv: = {s | root.test_condition(s) = v and s S}; b. child = GenDecTree(Sv ,F) ; c. Add child as a descent of root and label the edge (root 6. return root child) as v

  26. Tree Induction Issues How to Classify a leaf node Assign the majority class If leaf is empty, assign the default class the class that has the highest popularity. Determine how to split the records How to specify the attribute test condition? How to determine the best split? Determine when to stop splitting

  27. How to Specify Test Condition? Depends on attribute types Nominal Ordinal Continuous Depends on number of ways to split 2-way split Multi-way split

  28. Splitting Based on Nominal Attributes Multi-way split: Use as many partitions as distinct values. CarType Family Luxury Sports Binary split: Divides values into two subsets. Need to find optimal partitioning. CarType CarType OR {Sports, Luxury} {Family, Luxury} {Family} {Sports}

  29. Splitting Based on Ordinal Attributes Multi-way split: Use as many partitions as distinct values. Size Small Large Medium Binary split: Divides values into two subsets respects the order. Need to find optimal partitioning. Size Size OR {Small, Medium} {Medium, Large} {Large} {Small} Size What about this split? {Small, Large} {Medium}

  30. Splitting Based on Continuous Attributes Different ways of handling Discretization to form an ordinal categorical attribute Static discretize once at the beginning Dynamic ranges can be found by equal interval bucketing, equal frequency bucketing (percentiles), or clustering. Binary Decision: (A < v) or (A v) consider all possible splits and finds the best cut can be more compute intensive

  31. Splitting Based on Continuous Attributes Taxable Income > 80K? Taxable Income? < 10K > 80K Yes No [10K,25K) [25K,50K) [50K,80K) (i) Binary split (ii) Multi-way split

  32. How to determine the Best Split Before Splitting: 10 records of class 0, 10 records of class 1 Own Car? Car Type? Student ID? Family Luxury c1 c20 No Yes c10 c11 Sports ... ... C0: 6 C1: 4 C0: 4 C1: 6 C0: 1 C1: 3 C0: 8 C1: 0 C0: 1 C1: 7 C0: 1 C1: 0 C0: 1 C1: 0 C0: 0 C1: 1 C0: 0 C1: 1 Which test condition is the best?

  33. How to determine the Best Split Greedy approach: Nodes with homogeneous class distribution are preferred Need a measure of node impurity: C0: 5 C1: 5 C0: 9 C1: 1 Non-homogeneous, Homogeneous, High degree of impurity Low degree of impurity Ideas?

  34. Measuring Node Impurity p(i|t): fraction of records associated with node t belonging to class i = i 1 c = Entropy ( ) ( | ) log ( | ) t p i t p i t Used in ID3 and C4.5 i c 2 = Gini ( ) 1 ( | ) t p i t = 1 Used in CART, SLIQ, SPRINT. ) t = Classifica tion error ( ) 1 max ( | t p i i

  35. Gain Gain of an attribute split: compare the impurity of the parent node with the average impurity of the child nodes ( ) N v k = j j = ( ) ( ) I parent I v j N 1 Maximizing the gain Minimizing the weighted average impurity measure of children nodes If I() = Entropy(), then infois called information gain

  36. Example P(C1) = 0/6 = 0 P(C2) = 6/6 = 1 C1 C2 0 6 Gini = 1 P(C1)2 P(C2)2 = 1 0 1 = 0 Entropy = 0 log 0 1 log 1 = 0 0 = 0 Error = 1 max (0, 1) = 1 1 = 0 P(C1) = 1/6 P(C2) = 5/6 C1 C2 1 5 Gini = 1 (1/6)2 (5/6)2 = 0.278 Entropy = (1/6) log2 (1/6) (5/6) log2 (1/6) = 0.65 Error = 1 max (1/6, 5/6) = 1 5/6 = 1/6 P(C1) = 2/6 P(C2) = 4/6 C1 C2 2 4 Gini = 1 (2/6)2 (4/6)2 = 0.444 Entropy = (2/6) log2 (2/6) (4/6) log2 (4/6) = 0.92 Error = 1 max (2/6, 4/6) = 1 4/6 = 1/3

  37. Impurity measures All of the impurity measures take value zero (minimum) for the case of a pure node where a single value has probability 1 All of the impurity measures take maximum value when the class distribution in a node is uniform.

  38. Comparison among Splitting Criteria For a 2-class problem: The different impurity measures are consistent

  39. Categorical Attributes For binary values split in two For multivalued attributes, for each distinct value, gather counts for each class in the dataset Use the count matrix to make decisions Multi-way split Two-way split (find best partition of values) CarType CarType CarType {Sports, Luxury} 3 2 {Sports}{Family, Family Sports Luxury 1 2 4 1 0.393 {Family} Luxury} 2 5 1 1 C1 C2 Gini 1 4 2 1 C1 C2 Gini C1 C2 Gini 0.400 0.419

  40. Continuous Attributes Use Binary Decisions based on one value Tid Refund Marital Taxable Income Cheat Status 1 Yes Single 125K No 2 No Married 100K No Choices for the splitting value Number of possible splitting values = Number of distinct values 3 No Single 70K No 4 Yes Married 120K No 5 No Divorced 95K Yes 6 No Married 60K No Each splitting value has a count matrix associated with it Class counts in each of the partitions, A < v and A v 7 Yes Divorced 220K No 8 No Single 85K Yes 9 No Married 75K No 10 No Single 90K Yes 10 Exhaustive method to choose best v For each v, scan the database to gather count matrix and compute the impurity index Computationally Inefficient! Repetition of work. Taxable Income > 80K? Yes No

  41. Continuous Attributes For efficient computation: for each attribute, Sort the attribute on values Linearly scan these values, each time updating the count matrix and computing impurity Choose the split position that has the least impurity Cheat No No No Yes Yes Yes No No No No Taxable Income 60 70 75 85 90 95 100 120 125 220 Sorted Values 55 65 72 80 87 92 97 110 122 172 230 Split Positions > <= > <= > <= > <= > <= > <= > <= > <= > <= > <= > <= Yes 0 3 0 3 0 3 0 3 1 2 2 1 3 0 3 0 3 0 3 0 3 0 No 0 7 1 6 2 5 3 4 3 4 3 4 3 4 4 3 5 2 6 1 7 0 0.300 Gini 0.420 0.400 0.375 0.343 0.417 0.400 0.343 0.375 0.400 0.420

  42. Splitting based on impurity Impurity measures favor attributes with large number of values A test condition with large number of outcomes may not be desirable # of records in each partition is too small to make predictions

  43. Splitting based on INFO

  44. Gain Ratio Splitting using information gain GAIN n n split= = k GainRATIO log SplitINFO Split = i i i SplitINFO n n 1 Parent Node, p is split into k partitions ni is the number of records in partition i Adjusts Information Gain by the entropy of the partitioning (SplitINFO). Higher entropy partitioning (large number of small partitions) is penalized! Used in C4.5 Designed to overcome the disadvantage of impurity

  45. Stopping Criteria for Tree Induction Stop expanding a node when all the records belong to the same class Stop expanding a node when all the records have similar attribute values Early termination (to be discussed later)

  46. Decision Tree Based Classification Advantages: Inexpensive to construct Extremely fast at classifying unknown records Easy to interpret for small-sized trees Accuracy is comparable to other classification techniques for many simple data sets

  47. Example: C4.5 Simple depth-first construction. Uses Information Gain Sorts Continuous Attributes at each node. Needs entire data to fit in memory. Unsuitable for Large Datasets. Needs out-of-core sorting. You can download the software from: http://www.cse.unsw.edu.au/~quinlan/c4.5r8.tar.gz

  48. Other Issues Data Fragmentation Expressiveness

  49. Data Fragmentation Number of instances gets smaller as you traverse down the tree Number of instances at the leaf nodes could be too small to make any statistically significant decision You can introduce a lower bound on the number of items per leaf node in the stopping criterion.

  50. Expressiveness A classifier defines a function that discriminates between two (or more) classes. The expressiveness of a classifier is the class of functions that it can model, and the kind of data that it can separate When we have discrete (or binary) values, we are interested in the class of boolean functions that can be modeled If the data-points are real vectors we talk about the decision boundary that the classifier can model

Related


More Related Content