liveBook · Manning

Simple rule

As explained in Fight Fraud with Machine Learning

A simple rule is a rule that evaluates a single condition without combining multiple rules.

A simple rule evaluates one condition from one feature and returns a binary fraud decision. It can use a binary feature directly or compare a numeric feature against a threshold. section 2.2.1 section 2.4

Use simple rules as an interpretable baseline before combining rules:

  • Measure each rule against the fraud label with accuracy, while recognizing that baseline performance depends on class balance. section 2.2.1 section 2.4
  • Treat feature direction carefully: one feature may indicate fraud at 1, while an inversely related feature indicates fraud at 0. section 2.2.1
  • Combine simple rules with logical operators only after evaluating them individually; combinations become compound rules and can increase system complexity exponentially. section 2.2.1 section 2.4

Phishing URL baseline

Define rule_1 as FrequentDomainNameMismatch == 1. On the phishing dataset, this simple rule reaches 69.07% accuracy, compared with a 50% baseline for the balanced fraud and genuine classes. A second rule, SubmitInfoToEmail == 0, reaches 61.98%. section 2.2.1

rule_1 = FrequentDomainNameMismatch == 1

Inspect the minimal Python expression that turns FrequentDomainNameMismatch into a simple rule. section 2.2.1

How Fight Fraud with Machine Learning covers it

How deep it goes
Defines binary and numeric rules, evaluates accuracy, and stops short of the logical combinations that form compound rules.
Examples
Uses FrequentDomainNameMismatch and SubmitInfoToEmail on a phishing dataset, with Python and pandas accuracy calculations.
What you can do after
Build it from scratch as a Python rule and evaluate its fraud-detection accuracy against labeled data.
How it connects
Connects binary features, numeric features, compound rules, logical operators, accuracy, precision, and recall.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fight Fraud with Machine Learning. The section links point to the parts of the book it draws on.