go ahead... be a heretic PerlMonks

Re^2: Useful heuristics for analyzing arrays of data to determine column header

by nysus (Vicar)
 on Feb 17, 2019 at 10:44 UTC ( #1230028=note: print w/replies, xml ) Need Help??

Making some progress on the module. So here's some sample data for a column with the raw count and cardinality value for each unique value in the column:

```        \$VAR1 = {
'ACTIVE' => {
'count' => 1941,
'value_card' => '0.631630328669053'
},
'INACTIVE' => {
'value_card' => '0.233322486169867',
'count' => 717
},
'RETIRED' => {
'count' => 414,
'value_card' => '0.134721770257078'
},
'STATUS' => {
'count' => 1,
'value_card' => '0.000325414904002603'
}
};

So in this simple case, the 'STATUS' value is unique to this column and is clearly an outlier from the other three possible values. But in fuzzier situations, how would I determine whether 'STATUS' is "1 standard deviation" away from the other value cardinality values?

\$PM = "Perl Monk's";
\$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
\$nysus = \$PM . ' ' . \$MCF;

• Comment on Re^2: Useful heuristics for analyzing arrays of data to determine column header

Replies are listed 'Best First'.
Re^3: Useful heuristics for analyzing arrays of data to determine column header
by bliako (Prior) on Feb 18, 2019 at 13:16 UTC
`how would I determine whether 'STATUS' is "1 standard deviation" away from the other value cardinality values? `

Find the mean (m) and standard deviation (s) over all the "value_card" values from that column (or the combined-over-single-row "value_card" values). The distance of "STATUS"'s "value_card" from another entry's value card, say 'ACTIVE' is their absolute difference. The distance in terms of standard deviations is the previous value divided by the standard deviation. That will tell you how many standard deviations apart they are.

But this gets less and less trustworthy as the number of value_cards gets smaller. For example, this online outlier tool sees 1 outlier but it is not what we think it is!!! https://www.graphpad.com/quickcalcs/grubbs2/ (got it from How to best eliminate values in a list that are outliers which maybe relevant to your problem)

bw, bliako

Re^3: Useful heuristics for analyzing arrays of data to determine column header
by soonix (Canon) on Feb 17, 2019 at 14:34 UTC
Headers are usually in the first line, so if that sigle "STATUS" is on another line than the first, it isn't a header...

Create A New User
Node Status?
node history
Node Type: note [id://1230028]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2020-10-24 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My favourite web site is:

Results (247 votes). Check out past polls.

Notices?