Data Mining: Practical Machine Learning Tools and Techniques, Second Edition

(Brent) #1

4.6 LINEAR MODELS 119


through the dataset for each different size of item set. Sometimes the dataset is
too large to read in to main memory and must be kept on disk; then it may be
worth reducing the number of passes by checking item sets of two consecutive
sizes in one go. For example, once sets with two items have been generated, all
sets of three items could be generated from them before going through the
instance set to count the actual number of items in the sets. More three-item
sets than necessary would be considered, but the number of passes through the
entire dataset would be reduced.
In practice, the amount of computation needed to generate association rules
depends critically on the minimum coverage specified. The accuracy has less
influence because it does not affect the number of passes that we must make
through the dataset. In many situations we will want to obtain a certain num-
ber of rules—say 50—with the greatest possible coverage at a prespecified
minimum accuracy level. One way to do this is to begin by specifying the cov-
erage to be rather high and to then successively reduce it, reexecuting the entire
rule-finding algorithm for each coverage value and repeating this until the
desired number of rules has been generated.
The tabular input format that we use throughout this book, and in particu-
lar a standard ARFF file based on it, is very inefficient for many association-rule
problems. Association rules are often used when attributes are binary—either
present or absent—and most of the attribute values associated with a given
instance are absent. This is a case for the sparse data representation described
in Section 2.4; the same algorithm for finding association rules applies.

4.6 Linear models


The methods we have been looking at for decision trees and rules work most
naturally with nominal attributes. They can be extended to numeric attributes
either by incorporating numeric-value tests directly into the decision tree or rule
induction scheme, or by prediscretizing numeric attributes into nominal ones.
We will see how in Chapters 6 and 7, respectively. However, there are methods
that work most naturally with numeric attributes. We look at simple ones here,
ones that form components of more complex learning methods, which we will
examine later.

Numeric prediction: Linear regression


When the outcome, or class, is numeric, and all the attributes are numeric, linear
regression is a natural technique to consider. This is a staple method in statis-
tics. The idea is to express the class as a linear combination of the attributes,
with predetermined weights:
x w=+ + ++ 01122 wa wa ... wakk
Free download pdf