7.Decision Analytic Thinking I: What Is a Good Model? - 6bolin9/Data-Science-For-Business-Foster-Provost-and-Tom-Fawcett- GitHub Wiki
-
Fundamental concepts: Careful consideration of what is desired from data science results; Expected value as a key evaluation framework; Consideration of appropriate comparative baselines.
-
Exemplary techniques: Various evaluation metrics; Estimating costs and benefits; Calculating expected profit; Creating baseline methods for comparison.
It's very important to connect the results of mining data back to the goal of the undertaking. It is crucial to think carefully about what we’d really like to measure.
Evaluating Classifiers
In discussing classifiers, we often refer to a bad outcome as a “positive” example, and a normal or good outcome as “negative. It is useful to think of a positive example as one worthy of attention or alarm, and a negative example as uninteresting or benign. Medical test (classifier) performed on a biological sample tries to detect disease or an unusual condition by examining certain aspects of the sample.
PLAIN ACCURACY AND ITS PROBLEMS
The term “classifier accuracy” is sometimes used informally to mean any general measure of classifier performance. Here we reserve accuracy as the proportion of correct decisions:

Accuracy (1–error rate) is a common evaluation metric that is often used in data mining studies because it reduces classifier performance to a single number and is very easy to measure.
Unfortunately, it is simplistic and has some well-known problems (Provost, Fawcett, & Kohavi, 1998). To understand these problems we need a way to decompose and count the different types of correct and incorrect decisions made by a classifier.
THE CONFUSION MATRIX
2 × 2 confusion matrices:
A confusion matrix separates out the decisions made by the classifier, making explicit how one class is being confused for another. We will consider two-class problems and will denote the true classes as p(positive) and n(negative), and the classes predicted by the model (the “predicted” classes) as Y(es) and N(o), respectively.
The main diagonal contains the counts of correct decisions. The errors of the classifier are the false positives (negative instances classified as positive) and false negatives (positives classified as negative).
PROBLEMS WITH UNBALANCED CLASSES
Consider a classification problem where one class is rare.Because the unusual or interesting class is rare among the general population, the class distribution is unbalanced or skewed(Ezawa, Singh, & Norton, 1996; Fawcett & Provost, 1996; Japkowicz & Stephen, 2002). As the class distribution becomes more skewed, evaluation based on accuracy breaks down. With such skewed domains the base rate for the majority class could be very high, so a report of 99.9% accuracy may tell us little about what data mining has really accomplished.
- 比如predict chur: In these data the baseline churn rate is approximately 10% per month.
- Let’s consider a customer who churns to be a positive example, so within our population of customers we expect a positive to negative class ratio of 1:9.
- So if we simply classify everyone as negative we could achieve a base rate accuracy of 90%!
A:representative sample from the population (skew), B:Balanced sample
到底运用什么样的数据建立模型? 是选择代表population但是skew的数据,还是将skew数据修改为balanced数据。

Another problem with simple classification accuracy:makes no distinction between false positive and false negative errors.
By counting them together, it makes the tacit assumption that both errors are equally important. With real-world domains this is rarely the case. These are typically very different kinds of errors with very different costs because the classifications have consequences of differing severity.
- False positive error: a patient is wrongly informed he has cancer when he does not.
- False negative error: a patient who has cancer but she is wrongly told she does not.(more serious consequences.).
- Consider the cost of giving a customer a retention incentive which still results in departure (a false positive error). Compare this with the cost of losing a customer because no incentive was offered (a false negative). Whatever costs you might decide for each, it is unlikely they would be equal; and the errors should be counted separately regardless. We should estimate the cost or benefit of each decision a classifier can make. Once aggregated, these will produce an expected profit (or expected benefit or expected cost) estimate for the classifier.
A Key Analytical Framework: Expected Value
Decomposes data-analytic thinking into
- (i) the structure of the problem
- (ii) the elements of the analysis that can be extracted from the data
- (iii) the elements of the analysis that need to be acquired from other sources (e.g., business knowledge of subject matter experts).
In an expected value calculation the possible outcomes of a situation are enumerated. The expected value is then the weighted average of the values of the different possible outcomes, where the weight given to each value is its probability of occurrence. For example, if the outcomes represent different possible levels of profit, an expected profit calculation weights heavily the highly likely levels of profit, while unlikely levels of profit are given little weight. We will assume that we are considering repeated tasks (like targeting a large number of consumers or diagnosing a large number of problems) and we are interested in maximizing expected profit.The probabilities often can be estimated from the data (ii), but the business values often need to be acquired from other sources (iii).

USING EXPECTED VALUE TO FRAME CLASSIFIER USE
Target marketing: the probability of response for any individual consumer is very low (1 or 2%), so no consumer may seem like a likely responder. If we choose a “common sense” threshold of 50% for deciding what a likely responder is, we would probably not target anyone. New data miners find results in everybody being classified as not likely responder (or a similar negative class).
For example: use decision tree to predict Posibility of response given historical data and feature vector x.