Data Mining Introduction Prof. Dr. T. Nouri 18.12.14

Slides:



Advertisements
Ähnliche Präsentationen
Die deutsche Satzstellung
Advertisements

Die Schulregeln (the school rules) Kein Graffiti in der Schule!
Verbs Used Impersonally With Dative Deutsch I/II Fr. Spampinato.
Ich bau eine Stadt für dich “I am building a city for you”
You need to use your mouse to see this presentation © Heidi Behrens.
AufwÄrmung A look at the future…..Match the German phrases on the left to the English ones on the right. Do your best; I am grading on participation! Wie.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation © Heidi Behrens.
You need to use your mouse to see this presentation © Heidi Behrens.
Montag, den Hausaufgabe für Dienstag den LB 10.3 E-G; LB 10.3 H oder J (Aufsatz) Quiz 10.3 Guten Tag!
Prädiktion und Klassifikation mit Random Forest
Engineering tools for the NEO engineer
You need to use your mouse to see this presentation
Universität StuttgartInstitut für Wasserbau, Lehrstuhl für Hydrologie und Geohydrologie Copulas (1) András Bárdossy IWS Universität Stuttgart.
Coordinating Conjunctions Why we need them & how to use them deutschdrang.com.
Hast du einen Nebenjob?.
Qualitätssicherung von Software Prof. Dr. Holger Schlingloff Humboldt-Universität zu Berlin und Fraunhofer FIRST.
Heute lernen wir: Unser Tagesablauf.
Die Fragen Wörter Wer? Was? Wann?.
Nominative & Accusative Basic Rules for Relative Pronouns in German:
Literary Machines, zusammengestellt für ::COLLABOR:: von H. Mittendorfer Literary MACHINES 1980 bis 1987, by Theodor Holm NELSON ISBN
Akkusativ Präpositionen
Rules of Play - Game Design Fundamentals by Katie Salen and Eric Zimmerman Universität zu Köln Historisch-Kulturwissenschaftliche Informationsverarbeitung.
What is a “CASE”? in English: pronouns, certain interrogatives
Ordering Food A Guide. Im Restaurant An actual restaurant is the chance to use more formal ordering. “Ich hätte gern eine Pizza.” “Ich möchte eine Cola.”
How does the Summer Party of the LMU work? - Organizations and Networks -
The Journey to America… The Immigrant Experience.
COMMANDS imperative 1. you (formal): Sie 2. you (familiar plural): ihr
Unterwegs.
Probesystem Gym 4 Prüfungen pro Schuljahr, in der 2. Klasse 4 ½ Prüfungen. Jeweils ganze Lektion, keine Fragemöglichkeit am Anfang der Prüfungslektion.
© Crown copyright 2011, Department for Education These materials have been designed to be reproduced for internal circulation, research and teaching or.
Kapitel 4 Grammar INDEX 1.Ordinal Numbers 2.Relative Pronouns and Relative Clauses 3.Conditional Sentences 4.Posessive: Genitive Case.
EUROPÄISCHE GEMEINSCHAFT Europäischer Sozialfonds EUROPÄISCHE GEMEINSCHAFT Europäischer Fonds für Regionale Entwicklung Workpackage 5 – guidelines Tasks.
Imperfekt (Simple Past) Irregular or strong verbs
Phonics Lessons Grade 1 Adapted from: Phonics Lessons by Gay Su Pinnell & Irene C. Fountas Grade 1, page 431 caatt If you knowIt helps you know.
Kapitel 2 Grammar INDEX 1.Subjects & Verbs 2.Conjugation of Verbs 3.Subject Verb Agreement 4.Person and Number 5.Present Tense 6.Word Order: Position of.
Kapitel 7 Grammar INDEX 1.Comparison 2.Adjectives 3.Adjective Endings Following Ein-Words.
Memorisation techniques
Reflexiv-Verben Deutsch 2/AC.
Rotkäppchen: Wie sieht sie aus? Richtig oder falsch?
Kapitel 9 Grammar INDEX 1.Formal Sie- Command 2.There Is/There Are 3.Negation: Nicht/Klein.
Das Wetter Lernziele: Heute: The „Wenn“ clause! - To describe and report the weather - To discuss activities done in different types of weather - To compare.
VERBEN KONJUGIEREN. What is a verb? An ________ _______, mental __________ or ________.  Examples of verbs:  __________________________ actionword state.
Word order: 1.In a main clause the VERB is the second idea: Helgakommteben aus der Bäckerei This may not be the second word Meiner Meinung nachsind Hobbys.
On the case of German has 4 cases NOMINATIVE ACCUSATIVE GENITIVE DATIVE.
Adjektiven und Adverbien Endungen. Das prädikativ gebrauchte Adjektiv Predicate adjectives follow the verbs sein, werden or bleiben. The modify the subject.
How to play: Students are broken up into 2-3 teams (depending on class size). Students can see the game board and the categories, but not point values.
Essay structure Example: Die fetten Jahre sind vorbei: Was passiert auf der Almhütte? Welche Bedeutung hat sie für jede der vier Personen? Intro: One or.
What’s the weather like?. Look at the question above Turn it around and you have Das Wetter ist.... The phrase Das Wetter ist.... or Es ist.... can be.
LLP DE-COMENIUS-CMP Dieses Projekt wurde mit Unterstützung der Europäischen Kommission finanziert. Die Verantwortung für den Inhalt dieser.
Thema: Umwelt: Was könnte man tun, um der Umwelt zu helfen?
Freizeit Thema 5 Kapitel 1 (1)
Du bist am dicksten und am dümmsten.
Sentence Structure Connectives
The Dative Indirect Objects.
Deutsch 1 Die Familie Frau Spampinato
Jetzt machen Venues aufmachen!!! Geh zu
Jetzt machen Venues aufmachen!!! Geh zu
Process and Impact of Re-Inspection in NRW
Synonyms are two or more words belonging to the same part of speech and possessing one or more identical or nearly identical denotational meanings, interchangeable.
Das Taschentuch-Spiel
Telling Time in German Deutsch 1 Part 1.
THE PERFECT TENSE IN GERMAN
To English Translations
THE PAST TENSE (Part 3) VERBS WHICH TAKE SEIN
Integrating Knowledge Discovery into Knowledge Management
School supplies.
- moodle – a internet based learning platform
Zhunussova G., AA 81. Linguistic communication, i.e. the use of language, is characteristically vocal and verbal behaviour, involving the use of discrete.
 Präsentation transkript:

Data Mining Introduction Prof. Dr. T. Nouri

2/ Entscheidungsbaum, supervised ntrain = Anzahl Objekte Hier: ntrain = 10 (Die Trainingsdaten sollten repräsentativ für alle möglichen Daten sein.) Wähle zufällig ntrain Objekte aus den InputDaten (Wiederholungen sind erlaubt) TrainingSet Trn 1 TrainingSet Trn 2 Obj. Nbr Allgemeine DB, Muster

3/ Baum erstellen 1.Zufällig mtry Variablen aus den mdim Variablen aussuchen. mtry wird mit den Startparametern angegeben. Als gute Zahl für mtry wird empfohlen. Hier wird mtry = 2 verwendet. Var 1 Var 2 Var 3 Var 4 Var 5 2.Für die mtry Variablen wird berechnet, welche von ihnen die Trn i -Daten am besten aufteilt. (find best split) Dies kann mit dem Gini-Index, Entropie, usw. berechnet werden. In diesem Fall wurde folgende Entropieformel verwendet: p + = Anz. richtig klassifizierte p - = Anz. falsch klassifizierte n = Anzahl Objekte ln=Logarithmus basis 2

4/ Node 1 Im Node 1 wird der Best Split bei Var 1 und Var 4 gesucht. Var 1 hat den kleineren „Entropie“-Wert Var 1 ist der best Split. Obj. Nbr

5/ Node 1 Rule 1: Wenn Var 1 <= 2.5 dann Class = 1, Gehe zu Node 2 Die Daten werden mit der Rule 1 aufgeteilt. 2,4,6,97,8

6/ Node 2 Im Node 2 wird der Best Split bei Var 1 und Var 2 gesucht. Var 2 hat den kleineren „Entropie“-Wert Var 2 ist der best Split. Obj. Nbr

7/ Node 2 Rule 2: Wenn Var 2 <= 1.5 dann Class = 2, Gehe zu Node 4 Die Daten werden mit der Rule 2 aufgeteilt. 2,4,6,97,892,4,6

8/ Node 3 Im Node 3 befinden sich nur noch Objekte mit Class = 2, der Knoten ist daher rein und muss nicht mehr weiter gesplittet werden. Obj. Nbr

9/ Node 3 2,4,6,97,892,4,6

10/ Node 4 Im Node 5 befinden sich nur noch Objekte mit Class = 2, der Knoten ist daher rein und muss nicht mehr weiter gesplittet werden. Obj. Nbr

11/ Node 4 2,4,6,97,892,4,6

12/ Node 5 Im Node 4 befinden sich nur noch Objekte mit Class = 1, der Knoten ist daher rein und muss nicht mehr weiter gesplittet werden. Obj. Nbr

13/ Node 5 Der Fertig entwickelte Baum 92,4,62,4,6,97,8

Example1: Decision Tree classification

From Tree to Rules:

Example2: Decision Tree classification 1. Extrahieren Sie eine Rule von diesem Baum! 2. Ryan hat NO refund, Married, Income 120K Cheatet er oder nicht?

Association Rules, unsupervised Warenkorbanalyse (Beispiel für das Auffinden von Assoziationsregeln): Unter einem Warenkorb versteht man dabei eine Sammlung von Dingen, die ein Kunde etwa in einem Supermarkt in einer Transaktion erworben hat. Lieferanten oder Ladeninhaber sowie Supermarktbetreiber möchten nun herausfinden, welche Dinge zusammen gekauft werden, etwa um deren Platzierung im Regal oder in der Werbung zu verbessern. Idee der Assoziationsregel: informal erkennen des Zusammenhangs zwischen verschiedenen Teilen: => z.B. gemeinsam in Kundentransaktionen erscheinende Teil: "Füller => Tinte" Ziel: einen gewissen Rahmen zu schaffen, in welchem sich derartige Aussagen (oder Vermutungen) einerseits erhärten und andererseits sogar systematisch ermitteln lassen. Assoziationsregel: LS => RS

TIDKundenIDDatumTeilPreisQty Füller Tinte Heft Seife Füller Tinte Heft Füller Heft Füller Tinte Seife14 (Warenkorb-) Tabelle

wobei LS (linke Seite) und RS (rechte Seite) disjunkte Mengen von Dingen („Itemsets11) sind und die Bedeutung analog zum Beispiel lautet: Wird jedes Teil in der linken Seite LS gekauft, so wird (wahrscheinlich) auch jedes Teil in der rechten Seite RS gekauft. Wir gehen damit also aus von einer Menge I = {i i... i m } von Dingen oder Items und bezeichnen Mengen von Dingen, also Teilmengen T  I, als Transaktionen. Der Gegenstand der Analyse ist eine "Datenbank" D = {T i... T k } von Transaktionen. formale Beschreibung von Warenkorb: Die betrachtete Menge D umfasst vier Transaktionen, die jeweils durch einen Identifikator eindeutig gekennzeichnet sind. Die Transaktionen sind über einer Menge I = {Füller, Tinte, Heft, Seife,...} von Teilen gebildet. Assoziationsregeln schreiben wir dann auch in der Form R : LS => RS

Support einer Menge von Dingen: Die „Wichtigkeit" oder Bedeutung einer Menge von Dingen. Je höher der durch das Mass zugeordnete Wert, desto wichtiger die betreffende Menge. Confidence: Die „Stärke" einer Regel. Die Confidence einer Regel R: LS => RS: bezeichnet man der Prozentsatz der Transaktionen, die RS umfassen, falls sie auch alle Elemente von LS enthalten Die Confidence einer Regel deutet damit den Grad der Korrelation zwischen Verkäufen von Mengen von Dingen (in der Datenbank) an. Diese Definition von Confidence benutzt den Support, d.h. sie sind aus mathematischer Sicht nicht unabhängig voneinander. Man kann dies durchaus als eine gewisse Kritik an diesen beiden Massen ansehen

Betrachten wir hierzu einige Beispiele: Die oben bereits betrachtete Regel R : „Füller => Tinte" lässt sich wie folgt bewerten: Da die Teile Füller und Tinte in drei der vier in Transaktionen gemeinsam vorkommen, gilt supp(R) = 3/4 = 0,75 Weiter gilt supp(Füller) = 4/4 = 1, also erhält man conf(R) = 0,75/1 = 0,75 Es enthalten also 3/4 der Transaktionen Tinte, sofern sie bereits Füller enthalten. Die Regel laute „Bier =>Chips": Ein Support von 0,8 bedeutet dann, dass in 80 % der Transaktionen Bier und Chips gemeinsam vorkommen; unabhängig davon bedeutet eine Confidence von 0,5, dass die Hälfte der Leute, die Bier gekauft haben, auch Chips (dazu) gekauft haben. Ist der Support gering, kann es sich um einen zufälligen Zusammenhang handeln (z.B. "Heft => Seife") Iist die Confidence einer Regel gering, so ist die linke Seite nicht stark mit der rechten korreliert (z.B. bei "Heft => Seife"). In realen Anwendungen wird man meistens so vorgehen, dass man einen Mindest-Support sowie eine Minimal-Confidence vorgibt und sich dann nur für Regeln interessiert, welche beides enthalten.

Beispiel Warenkorbtabelle mit  = 0.7 und  = 0.8 : I = {Füller, Tinte, Heft, Seife} häufige Einermenge: {{Füller}, {Tinte}, {Heft}} häufige Zweiermenge: {{Füller, Tinte}, {{Füller, Heft}} potenziellen Regeln: Füller => Tinte Tinte => Füller Füller => Heft Heft => Füller Überprüfen mit Confidence: conf(1) = 0.75 conf(2) = 1 conf(1) = 0.75 conf(4) = 1

LSRSsuppconf FüllerTinte TinteFüller0.71 FüllerHeft HeftFüller0.71 Lösungsansätze:

Beispiel

Having the following Rule: Rule: Who visit New York, visit London too. New York=>London. Calculate the support and the Confidence of this Rule? Exercice

Clustering: Unsupervised, Descriptif What is clustering? Clustering is a non supervised technique!!!(Decision tree is a supervised algorithm). Clustering involves grouping data into several new classes. It is a common descriptive task where one seeks to identify a finite set of categories or clusters to describe the data. For example, we may want to cluster houses to find distribution patterns. Clustering is the process of grouping a set of physical or abstract objects into classes of similar objects. A cluster is a collection of data objects that are similar to one another within the same cluster and are dissimilar to the objects in other clusters. Clustering analysis helps construct meaningful partitioning of a large set of objects. The task of clustering is to maximize the intra-class similarity and minimize the interclass similarity.

Euclidean Distance Based Clustering in 3-D space. Clustering schemes Distance-based ( Numeric: Euclidean distance (root of sum of squared differences along each dimension or Angle between two vectors ). Categorical ( Number of common features (categorical)) Partition-based (Enumerate partitions and score each) Model-based Estimate a density (e.g., a mixture of gaussians) Compute P(Feature Vector i | Cluster j) Finds overlapping clusters too

The k-means algorithm 1.Specify ‘k’, the number of clusters 2.Guess ‘k’ seed cluster centers 3.Look at each example and assign it to the center that is closest 4.Recalculate the center Iterate on steps 3 and 4 till centers converge or for a fixed number of times

Deviation/outlier detection Find points that are very different from the other points in the dataset Could be "noise", that causes problems for classification or clustering Could be the really "interesting" points, for example, in fraud detection, we are mainly interested in finding the deviations from the norm

K-nearest neighbors Classification technique to assign a class to a new example Find k-nearest neighbors, i.e., most similar points in the dataset (compare against all points!) Assign the new case to the same class to which most of its neighbors belong

DesignMemorisation Product A 11 Product B 12 Product C 43 Product D 45 Product E 24 Clustering Example There is many way to build cluster and to calculate distances. We take the most commun technique: eucledian distance.

ABCDE A B C D E - ABCDE C D E - The distance between A and B is 1 (2-1). The distance between B and E can be calculated using the following rule: d(B,E) 2 = d(B,F) 2 + d(F,E) 2 = (4-2) 2 + (2-1) 2 = 5  d(B,E) = Also, we are ready to calculate the other distances: Off course this matrix is symetric. d(A,B)=d(B,A). We start to group the nearest to each other points. The first group AB is created. The matrix will look like this: The way to calculate the distance C, D, E to AB is important. Of course there are many calculation way. One of them is to consider the mean distance between AB and C or to consider the distance between C and the gravity center of AB. Other way is to take the shortest distance AB and C, that means B to C. The choose of the calculation’s algorithm make the difference between different classification tools. It has a big influence of the calculation in the next iteration.

ABCDE C D E - ABCDE AB CD E - ABCDE AB-5 CDE - To continue our example, we consider the highest distance. The highest distance AB to C is d(A,C) = d(B,C) = We report 3.61 in the following matrix. We regroup C and D, they have the shorts distance 2. The matrix look like this: Now we regroup CD and E, they have the shortest distance 2.24, and again the matrix look like this: The grouping work is finished, now we are ready to build the classification tree based on the calculate distance. In the following graphic (called dendogramm) the x-axis are the product and y-axis are the distances. Dendogramm based on the minimal euclide-distance.

Based on this calculation, we are ready to build our cluster: If there is more than two variable, the distance can be calculate according to the following rule: This is an extension of the Pythagore theorem. The distance is used as grouping factor of the population. If the distance is short, the population is considered to be homogen.