Package jazzparser :: Package data :: Package input :: Class BulkInput
[hide private]
[frames] | no frames]

Class BulkInput

source code

 object --+    
          |    
InputReader --+
              |
             BulkInput
Known Subclasses:

Ways of accepting multiple inputs at once. These types can be used by the parser script, whch will iterate over the component inputs.

The classes should be iterable and iterate over the inputs.

Instance Methods [hide private]
 
__iter__(self) source code
 
__len__(self) source code
 
__getitem__(self, i) source code
 
subset(self, *ranges)
Returns an object of the same type containing the data points in the given ranges, given as [start,end) pairs.
source code
 
get_partitions(self, num_partitions)
Generate an n-way partition and the corresponding heldout sets for the data set.
source code
 
get_identifiers(self)
Returns a list containing a string identifier for each input.
source code

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

Class Methods [hide private]

Inherited from InputReader: process_option_dict

Static Methods [hide private]

Inherited from InputReader: from_file

Class Variables [hide private]
  INPUT_TYPE = None
hash(x)

Inherited from InputReader: FILE_INPUT_OPTIONS, SHELL_TOOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

subset(self, *ranges)

source code 

Returns an object of the same type containing the data points in the given ranges, given as [start,end) pairs. Give multiple ranges as successive arguments.

A default implementation is provided, but subclasses may want to provide their own if this is not appropriate.

get_partitions(self, num_partitions)

source code 

Generate an n-way partition and the corresponding heldout sets for the data set. The objects returned are of the same bulk input type.

Returns:
([part0, part1, ...], [rest0, rest1, ...])

get_identifiers(self)

source code 

Returns a list containing a string identifier for each input. What this is depends on the input type. At its simplest it may be just an integer. In cases where something more informative is available (e.g. a filename), this will be returned instead.

Whatever happens, each input will have a unique identifier. This is useful, for example, for creating an output file for each input.