Clear questions and runnable code
get the best and fastest answer
how to generate confidence / weight score for a match?by chexmix (Hermit)
|on Oct 10, 2012 at 22:48 UTC||Need Help??|
chexmix has asked for the
wisdom of the Perl Monks concerning the following question:
Good evening Monks --
I am trying to partly 'backfill' or 'backrepair' a database of information about transactions wherein a user has downloaded a piece (or pieces) of data from one of our servers. More specifically, I am trying to repair some partial information, if possible.
The problem: the information in this database has been generated from a motley variety of logfiles, etc. over the past dozen years or so -- the hostname of the download-er is usually captured, to some degree, but it is sometimes only a partial hostname.
Ultimately we'd like to gather geographical information about where users are from, etc., for generating usage statistics, and so on.
What I am struggling to do currently is to match these partial hostnames (I'm working on identifying them _as_ partials, too) against a large text file of hostnames I have gathered from all the available relevant logfiles -- specifically, ones where the hostnames _don't_ have the 'partial' problem.
So, for example, if I have an entry where the host is recorded as 'blahdee.etcet' I'd like to match this to 'blahdee.etcetera.rome.it' or whatever, from my list of complete hostnames, and be able to assign a measure of 'confidence' that it is correct.
I'd guess this would be at least partly based on the number of characters in the partial hostname vs the number in the candidate full hostname ... but my maths aren't really up to* designing such a 'confidence algorithm.'
I can't show code for this part because I'm trying to plan it first -- the rest of the application this is part of is rather vanilla and dull. :) If anyone knows what sort of algorithm I should be looking for here, or whether what I'm trying to do is even feasible, I'd be grateful for a nudge in the right direction.
* I should say they aren't bad, but I have never taken a stats course, for example. I guess I am looking for formulae I might be able to grok without too awful much trouble.