Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^9: Random sampling a variable length file.

by pajout (Curate)
on Dec 30, 2009 at 11:29 UTC ( [id://814915]=note: print w/replies, xml ) Need Help??


in reply to Re^8: Random sampling a variable length file.
in thread Random sampling a variable record-length file.

If you assume any correlation in the ordering of the records, why not to pick, for instance, the first 1000 records?
  • Comment on Re^9: Random sampling a variable length file.

Replies are listed 'Best First'.
Re^10: Random sampling a variable length file.
by BrowserUk (Patriarch) on Dec 30, 2009 at 11:51 UTC

    Because there might be (for example) a time-related correlation. If the file in question were a log file running midnight to midnight, it's possible that there might be less activity at either end of the day than in the middle.

    Or (for example), the file might have been previously ordered in some way that means the longer records are at the front and shorter at the end.

    Whilst it is possible that a random selection picked across the length of any given file might pick all the longest (or shortest), it is far,far less likely, than likely. That's why you pick a random sample.

    It is the whole basis of normal distributions, the 68-95-99.7 rule, and the associated statistics.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://814915]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-06-12 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.