Package gmisclib :: Module blue_data_attributes :: Class blue_attributes
[frames] | no frames]

Class blue_attributes

source code


Instance Methods
 
__init__(self, inspector, data)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
pick(self, n) source code
 
pick_one(self)
Pick one item from the data set.
source code
whatever (not a list!)
peek(self)
Inspect (but do not remove) the next item to be picked.
source code
 
add(self, datum)
Add another datum to be sampled.
source code
 
__len__(self) source code
 
reset(self)
Forget prior history of usage.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, inspector, data)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • inspector - a function on a datum that returns a list of attributes.
Overrides: object.__init__

peek(self)

source code 

Inspect (but do not remove) the next item to be picked.

Returns: whatever (not a list!)
the next item to be picked.

add(self, datum)

source code 

Add another datum to be sampled.

Parameters:
  • datum (whatever) - thing to be added. It has a probability of 1/len(self) of being the next sample.

reset(self)

source code 

Forget prior history of usage. Choices after this call are uncorrelated with choices before this call.