This is an old revision of the document!
Fuzzy Matching
Fuzzy Matching is used when you want to search your captures for the closest match across several different properties.
Because perfect matches are unlikely in real-world scenarios, the fuzzy matching system instead produces a score for each possible match and selects the capture with the lowest overall score.
See AI vs Fuzzy Matching for a discussion on some key benefits and down-sides of fuzzy matching vs using AI.
To do this, you'll often need to adjust the weighting factors that control matching, because in most cases there will be vital priorities to which of the various things you're searching for are the most important.
Example
For example, let's look at a system that is producing cupcakes.
We're capturing how our system is set up (including line speed, oven temperature, colour tolerance etc.) for every different batch of cupcakes we produce, so we can automatically set up our system correctly for new product runs in the future.
First, we identify which attributes we are going to know (or be able to easily get) before our production run begins.
These include…
- Product Weight,
- Product Type (ie. Blueberry, Chocolate, Bananna).
- Product Style (ie, Plain, Deluxe, Fudgy, Gluten Free),
- Ambient Temperature
- Ambient Humidity
Setting Priorities
If we want to search for the closest match (rather than using AI), we need to set some priorities in the configuration file.
We might decide that size is the most critical factor, followed by type and style. Temperature and humidity are useful, but not as important as any of the others.
For each attribute we're going to match, we can set up a multiplier and a type or closeness threshold.
Multiplier
The multiplier is applied to the difference between the attributes when comparing the value you searched for against
For example, we want a 10g difference in weight to be penalised much more than a 10% difference in humidity.
So we can give weight differences a large multiplier, or humidity differences a small multiplier.
"matching": { "Weight": { "mult": 10, "close": 0.002 }, "Type": { "mult": 1, "type": "equalonly" }, "Style": { "mult": 1, "type": "equalonly" }, "Temperature": { "mult": 0.5, "close": 2 }, "Humidity": { "mult": 0.1, "close": 10 } },
Closeness
The 'close' value defines how much difference is considered 'good enough' to be a match. If the difference between the search value and the captured value is less than this amount, it will be considered an exact match.
Type
The 'type' value defines how the comparison should be performed.
The only currently supported value for this property is equalonly. In this case, the condition is simply a yes/no condition rather than a multiplier - the score will be 0 for an exact match, or the 'mult' value if it's not an exact match.