In How can the accuracy of the dictionary-based approach be measured and improved?, one user says that:

dictionary-based approach is a heuristic method

Isn't that this approach is a type of rule-based approach, which on its turn is simply catching keywords using regex? Then shouldn't it be the most accurate approach, comparing to statistic-based approaches?

Research on the internet give me mixed results:

So which one is correct?


2 Answers 2


My opinion is that besides intellectual gymnastics, the difference between the two doesn't matter much in practice. To me, it's mostly semantics as I would and have used the two interchangeably.

The main "difference" I could see would be that rules implies that they are stricter than heuristics. For instance:

  • "If this rule applies, then I know that I must act like this."
  • "If this heuristic applies, then I have some decent amount of confidence that I should act like this"

But let's give some intuition with an example. Let's say that you want to detect e-mail addresses in text.

  • A learned approach would probably used some sort of (named-)entity recognition.
  • A rule-based approach would use a regular expression of what an e-mail address is known to be (i.e. something like ^[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*@[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*$ )
  • A heuristic approach could be, if a token has a "@" character in it, and a ".", and is longer than 5 characters, then it is probably an e-mail.

So, rules imply that the rules used are "complete" and cover the entire set of possibilities, and heuristics are "approximations" or "educated guesses." But as I said previously, I struggle to see, besides a university exam, where this might be relevant to differentiate.

Computer vision is an area where the difference between the two is quite obvious. Indeed, it would be very difficult to build strict rules about what a cat looks like, for instance. But if you say: "If I see a blob of roughly this shape and this color, I'll assume it's a cat," that's a heuristic.

  • $\begingroup$ I think I see your point. Do you mean that there are people referring to "heuristic" as "incomplete set of strict rules"? $\endgroup$
    – Ooker
    Commented Feb 7 at 9:09
  • 1
    $\begingroup$ I think so. I think people see an if-statement structure and think "rules" right away. And then others say: "these aren't rules, they are heuristics". Where they see heuristics as either an incomplete set of the strict rules, or an approximation of unknown rules $\endgroup$ Commented Feb 7 at 9:43
  • $\begingroup$ I understand that if these are regular words then this phenomenon happens all the time. But as jargon of the field why do people still have different definitions on them? $\endgroup$
    – Ooker
    Commented Feb 7 at 11:58
  • $\begingroup$ Being precise with words and their meaning is important in any field. But a) it's not like there is an accepted dictionary of ML terms and their definitive meaning b) differentiating two terms isn't always crucial, which is the case here. Besides being pedantic about their definition, I don't see what one would gain by correctly using heuristic or rule. $\endgroup$ Commented Feb 7 at 12:06
  • $\begingroup$ Well, the point of having a precise meaning means that you can communicate effectively, doesn't it? $\endgroup$
    – Ooker
    Commented Feb 7 at 12:30

I think of the word heuristics as the intellectual’s version of rules of thumb or “percentage shots” or even Bayesian priors. These are all ways of expressing implicit knowledge.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.