Data Mining-Knowledge Presentation 2: Prof. Sin-Min Lee
Data Mining-Knowledge Presentation 2: Prof. Sin-Min Lee
Presentation 2
Prof. Sin-Min Lee
Overview
●data mining from FNA test results and visual inspection (65%-98%)
Bhandary et al (1997)
●Credit card fraud detection
●Stranieri/Zeleznikow (1997) predict family law property outcomes
●Rissland and Friedman (1997) discovers a change in the concept of ‘good faith’
in US Bankruptcy cases
● Pannu (1995) discovers a prototypical case from a library of cases
• Wilkins and Pillaipakkamnatt (1997) predicts the time a case takes to be heard
• Veliev et al (1999) association rules for economic analaysis
Overview of process of knowledge discovery in
databases ?
Pre-proces Transform
Raw data Target data patterns knowledge
sed data ed data
Categories of techniques
●
●
Predictive (classification: neural networks, rule induction,
linear, multiple regression)
●
Segmentation (clustering, k-means, k-median)
●
Summarisation (associations, visualisation)
●
Change detection/modelling
What Is Association
Mining?
• Association rule mining:
– Finding frequent patterns, associations, correlations, or
causal structures among sets of items or objects in
transaction databases, relational databases, and other
information repositories.
• Applications:
– Basket data analysis, cross-marketing, catalog design, loss-
leader analysis, clustering, classification, etc.
• Examples.
– Rule form: “Body → Ηead [support, confidence]”.
– buys(x, “diapers”) → buys(x, “beers”) [0.5%, 60%]
– major(x, “CS”) ^ takes(x, “DB”) → grade(x, “A”) [1%,
75%]
More examples
For rule A ⇒ C:
support = support({A C}) = 50%
confidence = support({A C})/support({A}) = 66.6%
Two Step Association Rule
Mining
• In 73.4% of cases where the wife's needs are some to high then the
husband's future needs are few to some.
• Prompts an analyst to posit plausible hypothesis e.g. it may be the case
that the rule reflects the fact that more women remain custodial parents of
the children following divorce than men do. The women that have some to
high needs may do so because of their obligation to children.
Mining Frequent Itemsets:
the Key Step
• Find the frequent itemsets: the sets of items that
have minimum support
– A subset of a frequent itemset must also be a frequent
itemset – Apriori principle
• i.e., if {AB} is a frequent itemset, both {A} and {B} should be a
frequent itemset
– Iteratively find frequent itemsets with cardinality from 1
to k (k-itemset)
• Use the frequent itemsets to generate association
rules.
The Apriori Algorithm
• Join Step: C is generated by joining L with itself
k k-1
L1 = {frequent items};
for (k = 1; Lk !=∅; k++) do begin
Ck+1 = candidates generated from Lk;
for each transaction t in database do
increment the count of all candidates in Ck+1
that are contained in t
Lk+1 = candidates in Ck+1 with min_support
end
return ∪k Lk;
Association rules in law
• Association rules generators are typically packaged with very expensive
data mining suites. We developed A-Miner (available from authors) for a
PC platform.
• Typically, too many association rules are generated for feasible analysis.
So, our current research involves exploring metrics of interesting to restrict
numbers of rules that might be interesting
• In general, structured data is not collected in law as it is in other domains
so very large databases are rare
• Our current research involves 380,000 records from a Legal Aid
organization data base that contains data on client features.
• ArgumentDeveloper shell that can be used by judges to structure their
reasoning in a way that will facilitate data collection and reasoning
The Apriori Algorithm —
Example Support = 2
Database D itemset sup.
L1 itemset sup.
TID Items C1 {1} 2 {1} 2
100 134 {2} 3 {2} 3
200 235 Scan D {3} 3 {3} 3
300 1235 {4} 1 {5} 3
400 25 {5} 3
• Step 2: pruning
forall itemsets c in Ck do
forall (k-1)-subsets s of c do
if (s is not in Lk-1) then delete c from Ck
Example of Generating
Candidates
• L3={abc, abd, acd, ace, bcd}
• Self-joining: L3*L3
Problem of
– abcd from abc and abd
generate-&-test
– acde from acd and ace heuristic
• Pruning:
– acde is removed because ade is not in L3
• C4={abcd}
extremely serious pattern of priors
very serious pattern of priors
Severity of prior
I.3 serious pattern of priors
convictions constellation
not so serious pattern of priors
no prior convictions
serious offender status yes
no
I.2 major psychiatric illness
Offender's health some psychiatric illness
drug dependency
extreme
inferences in the
Degree of remorse high
displayed by offender some
little I.1
I.5 Offender lone
none penalty
robbery
Extent to which retribution is an very appropriate Discharge offender
appropriate purpose somewhat appropriate Dismiss offence
not appropriate at all Defer sentence
Extent to which specific deterrence very appropriate
somewhat appropriate
is an appropriate purpose not appropriate at all
Extent to which general deterrence very appropriate
is an appropriate purpose somewhat appropriate
not appropriate at all
Extent to which rehabilitation is an very appropriate
somewhat appropriate
appropriate purpose not appropriate at all
Extent to which community very appropriate
protection is an appropriate somewhat appropriate
purpose not appropriate at all
:
not an issue offense relative to other offenses from parity
trifling
extreme addiction with co-
serious addiction very high
Drug dependence high offender
some addiction Moral culpability of
none average penalty
I.4 offender low
extremely pertinent very low
Intellectual disability somewhat pertinent
not an issue guilt plea early
extreme
guilty plea during
Plea Degree of remorse high
not guilty throughout
displayed by offender some
Remarks to police indicate remorse little I.1
neutral I.5 Offender lone
indicate no remorse none Penalty
penalty
Apology offered yes
no extreme serious
Restitution made yes seriousness of the offence very serious Imprisonment
extremely significant
Degree of no relative to other armed serious Combined custody and treatment order
significant
I.B violence not so significant I.6 robberies not so serious
not significant at all trifling Hospital security order
Intensive correction order
extremely significant verry highe extreme Suspended sentence
Degree of significant Degree of assistence high I.7
I.C planning high Youth training centre detention
not so significant offered to police by the average Co-operation
not significant at all low some Community based order
offender very low little Fine
extremely significant none
Extent to which significant full admission Adjournment on conditions
Assisted victim not so significant Police interview partial admission Extent to which retribution is an very appropriate Discharge offender
not significant at all complete denial appropriate purpose somewhat appropriate Dismiss offence
positive defense offerred not appropriate at all Defer sentence
Impact of the extreme Extent to which specific deterrence very appropriate
crime on high no instructions somewhat appropriate
I.C some is an appropriate purpose not appropriate at all Co-
victims little Assistance to Crown very important offender's
none important Extent to which general deterrence very appropriate penalty
Impact of the extreme provided but not important is an appropriate purpose somewhat appropriate
high not appropriate at all
I.D crime on the some not provided None
Extent to which rehabilitation is an very appropriate
community little somewhat appropriate
none appropriate purpose not appropriate at all Imprisonment
Value of major psychiatric illness Extent to which community Combined custody and treatment order
Offender's health very appropriate
property stolen drug dependency protection is an appropriate somewhat appropriate Hospital security order
purpose not appropriate at all Intensive correction order
over many days/months or years no major health issues
Duration of Suspended sentence
over many hours
offence over many minutes guilt plea early Youth training centre detention
Offender's plea guilty plea during Community based order
not guilty throughout Fine
Adjournment on conditions
Discharge offender
Dismiss offence
Defer sentence
Forward inference: confidence
extremely serious pattern of priors
I.3
Severity of prior
convictions constellation
very serious pattern of priors
serious pattern of priors
not so serious pattern of priors
• In the sentence actual argument
no prior convictions
I.2
serious offender status yes
no
major psychiatric illness
database the following outcomes
some psychiatric illness
I.7 extreme
Intensive correction order
Suspended sentence
Youth training centre detention
Youth training centre detention 10%
high
Co-operation some
little
Community based order
Fine Community based order 16%
Fine 0%
none Adjournment on conditions
Extent to which retribution is an very appropriate Discharge offender
somewhat appropriate Dismiss offence
appropriate purpose
Extent to which specific deterrence
not appropriate at all
very appropriate
Defer sentence Adjournment on conditions 0%
Discharge offender
somewhat appropriate
is an appropriate purpose not appropriate at all
0%
Dismiss offence
Extent to which general deterrence very appropriate
is an appropriate purpose somewhat appropriate
not appropriate at all
Extent to which rehabilitation is an
appropriate purpose
very appropriate
somewhat appropriate
not appropriate at all Defer sentence
Extent to which community very appropriate
protection is an appropriate somewhat appropriate
purpose not appropriate at all
●
Data mining or Knowledge discovery from databases has not been
appropriately exploited in law to date.
●
Association rules are useful in that they suggest hypotheses for
future research
●
Association rules integrated into the generic actual argument model
can assist in identifying the most plausible claim from given data items
in a forward inference way or the likelihood of missing data values in
a backward inference way
Generating Association Rules
• For each nonempty subset s of l, output the rule:
s => (l - s)
if support_count(l) / support_count(s) >= min_conf
l threshold.
= {2 3 5}, s of l are {2 3}, {3 5}, {2 5}, {2}, {3}, & {5}.
Candidate rules:
{2 3} => {5} {2} => {3 5}
{3 5} => {2} {3} => {2 5}
{2 5} => {3} {5} => {2 3}
Generating Association Rules
if support_count(l) / support_count(s) >= min_conf
(e.g,75%),
itemset sup
then introduce the rule s => (l - s).
{1 2} 1 itemset sup.
{1 3} 2 {1} 2 itemset sup
{1 5} 1 {2} 3 {2 3 5} 2
{2 3} 2 {3} 3
{2 5} 3 {4} 1
{3 5} 2 {5} 3
Is unemployment high?
YES: The London market will rise today
NO: Is the New York market rising today?
YES: The London market will rise today
NO: The London market will not rise today.
Decision tree induction is a typical inductive approach to learn
knowledge on classification. The key requirements to do mining
with decision trees are:
• Attribute-value description: object or case must be
expressible in terms of a fixed collection of properties or attributes.
• Predefined classes: The categories to which cases are to be
assigned must have been established beforehand (supervised
data).
• Discrete classes: A case does or does not belong to a
particular class, and there must be for more cases than classes.
• Sufficient data: Usually hundreds or even thousands of
training cases.
• “Logical” classification model: Classifier that can be only
expressed as decision trees or set of production rules
An appeal of market analysis comes from the clarity and
utility of its results, which are in the form of association
rules. There is an intuitive appeal to a market analysis
because it expresses how tangible products and services
relate to each other, how they tend to group together. A
rule like, “if a customer purchases three way calling, then
that customer will also purchase call waiting” is clear.
Even better, it suggests a specific course of action, like
bundling three-way calling with call waiting into a single
service package. While association rules are easy to
understand, they are not always useful.
The following three rules are examples of real rules
generated from real data:
∀• On Thursdays, grocery store consumers often
purchase diapers and beer together.
∀• Customers who purchase maintenance agreements
are very likely to purchase large appliances.
∀• When a new hardware store opens, one of the most
commonly sold items is toilet rings.
These three examples illustrate the three common types
of rules produced by association rule analysis: the useful,
the trivial, and the inexplicable.
OLAP (Summarization) Display Using MS/Excel 2000
Market-Basket-Analysis (Association)—Ball graph
Display of Association Rules in Rule Plane Form
Display of Decision Tree (Classification Results)
Display of Clustering (Segmentation) Results
3D Cube Browser