Package pylearn :: Package sandbox :: Module sparse_instance
[hide private]

Module sparse_instance

source code

Sparse instances. Each instance is represented as dict with key dimension. Dimensions not present in the dict have value 0.

Functions [hide private]
numpy matrix (instances x dimensions)
to_vector(instances, dimensions)
Convert sparse instances to vectors.
source code

Imports: zeros


Function Details [hide private]

to_vector(instances, dimensions)

source code 

Convert sparse instances to vectors.

Parameters:
  • dimensions - The number of dimensions in each instance.
  • instances (list of sparse instances)
Returns: numpy matrix (instances x dimensions)

To Do: Allow this function to convert SINGLE instances (not lists).