Presentation is loading. Please wait.

Presentation is loading. Please wait.

STUDI KASUS MACHINE LEARNING DAN DATA MINING

Similar presentations


Presentation on theme: "STUDI KASUS MACHINE LEARNING DAN DATA MINING"— Presentation transcript:

1 STUDI KASUS MACHINE LEARNING DAN DATA MINING
SUPENO MARDI

2 Kelas Logistik dan Jadwal
36 Pertemuan Software yang digunakan Python 3 TensorFlow (TF) + Keras Final Project + Presentasi

3 Daftar isi Terminologi AI, Machine Learning dan data mining
Learning data untuk model Tipe-tipe Tugas Belajar (Learning Tasks) Pendefinisian tugas belajar (Learning Task) Contoh-contoh kasus machine Learning Data Mining

4 Terminologi Sinonim Artificial Intelligence Machine Learning
Data mining Pattern recognition Probability and Statistics Information theory Numerical optimization Computational complexity theory Control theory (adaptive)

5 Machine Learning,Statistics dan Data Mining
Differences in terminology: Ridge regression = weight-decay Fitting = learning Held-out data = test data The emphasis is very different: A good piece of statistics: Clever proof that a relatively simple estimation procedure is asymptotically unbiased. A good piece of machine learning: Demonstration that a complicated algorithm produces impressive results on a specific task. Data-mining: Using machine learning techniques on very large databases.

6 DATA MINING

7 “Learning” Data Learning general models dari a data of particular examples Data tersedia banyak dan murah(data warehouses, data marts); knowledge mahal dan jarang. Contoh dalam retail: Customer transactions to consumer behavior: People who bought “Da Vinci Code” also bought “The Five People You Meet in Heaven” ( Pembuatan model yang a good and useful approximation to the data.

8 Tipe-tipe Tugas Belajar (Learning Tasks)
Association Supervised learning Learn to predict output when given an input vector Reinforcement learning Learn action to maximize payoff Payoff is often delayed Exploration vs. exploitation Online setting Unsupervised learning Create an internal representation of the input e.g. form clusters; extract features How do we know if a representation is good? Big datasets do not come with labels.

9 Learning Associations
Basket analysis: P (Y | X ) probability that somebody who buys X also buys Y where X and Y are products/services. Example: P ( chips | beer ) = 0.7

10 Classification Example: Credit scoring
Differentiating between low-risk and high-risk customers from their income and savings Discriminant: IF income > θ1 AND savings > θ2 THEN low-risk ELSE high-risk

11 Aplikasi-aplikasi Classification
Aka Pattern recognition Face recognition: Pose, lighting, occlusion (glasses, beard), make-up, hair style Character recognition: Different handwriting styles. Speech recognition: Temporal dependency. Use of a dictionary or the syntax of the language. Sensor fusion: Combine multiple modalities; eg, visual (lip image) and acoustic for speech Medical diagnosis: From symptoms to illnesses ...

12 Training examples of a person
Face Recognition Training examples of a person Test images

13 The Role of Learning

14 Penggunaan Supervised Learning
Prediction of future cases: Use the rule to predict the output for future inputs Knowledge extraction: The rule is easy to understand Compression: The rule is simpler than the data it explains Outlier detection: Exceptions that are not covered by the rule, e.g., fraud

15 Penggunaan Unsupervised Learning
Learning “what normally happens” Clustering: Grouping similar instances Example applications Customer segmentation in CRM (customer relationship management) Image compression: Color quantization Bioinformatics: Learning motifs

16 Displaying the structure of a set of documents

17 Contoh: Cancer Diagnosis
Application: automatic disease detection Importance: this is modern/future medical diagnosis. Prediction goal: Based on past patients, predict whether you have the disease Data: Past patients with and without the disease Target: Cancer or no-cancer Features: Concentrations of various proteins in your blood

18 Contoh: Zipcodes Application: automatic zipcode recognition
Importance: this is modern/future delivery of small goods. Goal: Based on your handwritten digits, predict what they are and use them to route mail Data: Black-and-white pixel values Target: Which digit Features: ?

19 What makes a 2?

20 Contoh: Google Application: automatic ad selection
Importance: this is modern/future advertising. Prediction goal: Based on your search query, predict which ads you might be interested in Data: Past queries Target: Whether the ad was clicked Features: ?

21 Contoh: Call Centers Application: automatic call routing
Importance: this is modern/future customer service. Prediction goal: Based on your speech recording, predict which words you said Data: Past recordings of various people Target: Which word was intended Features: ?

22 Contoh: Stock Market Application: automatic program trading
Importance: this is modern/future finance. Prediction goal: Based on past patterns, predict whether the stock will go up Data: Past stock prices Target: Up or down Features: ?

23 Contoh :Web-based The web contains a lot of data. Tasks with very big datasets often use machine learning especially if the data is noisy or non-stationary. Spam filtering, fraud detection: The enemy adapts so we must adapt too. Recommendation systems: Lots of noisy data. Million dollar prize! Information retrieval: Find documents or images with similar content.

24 What is a Learning Problem?
Learning involves performance improving at some task T with experience E evaluated in terms of performance measure P Example: learn to play checkers Task T: playing checkers Experience E: playing against itself Performance P: percent of games won What exactly should be learned? How might this be represented? What specific algorithm should be used? Develop methods, techniques and tools for building intelligent learning machines, that can solve the problem in combination with an available data set of training examples. When a learning machine improves its performance at a given task over time, without reprogramming, it can be said to have learned something.

25 Pendefinisian tugas belajar (Learning Task)
Improve on task, T, with respect to performance metric, P, based on experience, E. T: Playing checkers P: Percentage of games won against an arbitrary opponent E: Playing practice games against itself T: Recognizing hand-written words P: Percentage of words correctly classified E: Database of human-labeled images of handwritten words T: Driving on four-lane highways using vision sensors P: Average distance traveled before a human-judged error E: A sequence of images and steering commands recorded while observing a human driver. T: Categorize messages as spam or legitimate. P: Percentage of messages correctly classified. E: Database of s, some with human-given labels

26 Desain sebuah Learning System
Pilih : training experience Pilih : what is too be learned, i.e. the target function. Pilih: how to represent the target function. Pilih: a learning algorithm to infer the target function from the experience. Learner Environment/ Experience Knowledge Performance Element

27 Komponen-komponen sebuah Learning Problem
Task: the behavior or task that’s being improved, e.g. classification, object recognition, acting in an environment. Data: the experiences that are being used to improve performance in the task. Measure of improvements: How can the improvement be measured? Examples: Provide more accurate solutions (e.g. increasing the accuracy in prediction) Cover a wider range of problems Obtain answers more economically (e.g. improved speed) Simplify codified knowledge New skills that were not presented initially

28 What Experience E to Use?
Direct or indirect? Direct: feedback on individual moves Indirect: feedback on a sequence of moves e.g., whether win or not Teacher or not? Teacher selects board states Tailored learning Can be more efficient Learner selects board states No teacher Questions Is training experience representative of performance goal? Does training experience represent distribution of outcomes in world?

29 What Exactly Should be Learned?
Playing checkers: Alternating moves with well-defined rules Choose moves using some function Call this function the Target Function Target function (TF): function to be learned during a learning process ChooseMove: Board  Move ChooseMove is difficult to learn, e.g., with indirect training examples A key to successful learning is to choose appropriate target function: Strategy: reduce learning to search for TF Alternative TF for checkers: V : Board  R Measure “quality” of the board state Generate all moves choose move with largest value

30 A Possible Target Function V For Checkers
In checkers, know all legal moves From these, choose best move in any situation Possible V function for checkers: if b is a final board state that is win, then V(b) = 100 if b is a final board state that is loss, then V(b) = -100 if b is a final board state that is draw, then V(b) = 0 if b is a not a final state in the game, then V(b) = V(b), where b is the best final board state that can be achieved starting from b and playing optimally until the end of the game This gives correct values, but is not operational So may have to find good approximation to V Call this approximation V

31 How Might Target Function be Represented?
Many possibilities (subject of course) As collection of rules ? As neural network ? As polynomial function of board features ? Example of linear function of board features: w0+ w1bp(b) + w2rp(b) + w3bk(b)+w4rk(b)+w5bt(b)+w6rt(b) bp(b) : number of black pieces on board b rp(b) : number of red pieces on b bk(b) : number of black kings on b rk(b) : number of red kings on b bt(b) : number of red pieces threatened by black (i.e., which can be taken on black's next turn) rt(b) : number of black pieces threatened by red Generally, the more expressive the representation, the more difficult it is to estimate

32 Inductive and Deductive Learning
Inductive Learning: Reasoning from a set of examples to produce a general rules. The rules should be applicable to new examples, but there is no guarantee that the result will be correct. Deductive Learning: Reasoning from a set of known facts and rules to produce additional rules that are guaranteed to be true.

33 Assessment of Learning Algorithms
The most common criteria for learning algorithms assessments are: Accuracy (e.g. percentages of correctly classified +’s and –’s) Efficiency (e.g. examples needed, computational tractability) Robustness (e.g. against noise, against incompleteness) Special requirements (e.g. incrementality, concept drift) Concept complexity (e.g. representational issues – examples & bookkeeping) Transparency (e.g. comprehensibility for the human user)

34 DATA MINING

35 DATA SCIENCE

36

37 Data mining dan algorithms
The desired outcome from data mining is to create a model from a given dataset that can have its insights generalized to similar datasets. A real-world example of a successful data mining application can be seen in automatic fraud detection from banks and credit institutions. Data mining is the process of discovering predictive information from the analysis of large databases. For a data scientist, data mining can be a vague and daunting task – it requires a diverse set of skills and knowledge of many data mining techniques to take raw data and successfully get insights from it.  You’ll want to understand the foundations of statistics, and different programming languages that can help you with data mining at scale.  

38 Teknik-teknik Data mining
Regression – Estimating the relationships between variables by optimizing the reduction of error. Classification – Identifying what category an object belongs to. An example is classifying as spam or legitimate, or looking at a person’s credit score and approving or denying a loan request. Cluster Analysis – Finding natural groupings of data objects based upon the known characteristics of that data. An example could be seen in marketing, where analysis can reveal customer groupings with unique behavior – which could be applied in business strategy decisions. Association and Correlation Analysis – Looking to see if there are unique relationships between variables that are not immediately obvious. An example would be the famous case of beer and diapers: men who bought diapers at the end of the week were much more likely to buy beer, so stores placed them close to each other to increase sales. Outlier analysis – Examining outliers to examine potential causes and reasons for said outliers. An example of which is the use of outlier analysis in fraud detection, and trying to determine if a pattern of behavior outside the norm is fraud or not. 

39 Contoh pemakaian panda pada model regresi pada Python
Menghitung relasi linear diantara variabel yang tersedia, menggunakan data dari House Sales in King’s County data set from Kaggle.

40 Python script import pandas as pd import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats import seaborn as sns from matplotlib import rcParams df = pd.read_csv('/Users/python/kc_house_data.csv') df.head()

41 Tampilan Hasil id date price bedrooms bathrooms sqft_living sqft_lot
T000000 3 1.00 1180 5650 1 T000000 2.25 2570 7242 2 T000000 770 10000 4 3.00 1960 5000 T000000 2.00 1680 8080

42 df.describe() price bedrooms bathrooms sqft_living count 21613 mean
3.37 2.11 std 0.93 0.77 918.44 min 0.00 290.00 25% 3.00 1.75 50% 2.25 75% 4.00 2.50 max 33.00 8.00


Download ppt "STUDI KASUS MACHINE LEARNING DAN DATA MINING"

Similar presentations


Ads by Google