hpelm.modules package¶
Submodules¶
hpelm.modules.hdf5_tools module¶
Different tools to work with datasets in HDF5 file format.
Created on Thu Apr 2 21:12:46 2015
@author: akusok

hpelm.modules.hdf5_tools.
make_hdf5
(data, h5file, dtype=<type 'numpy.float64'>, delimiter=' ', skiprows=0, comp_level=0)[source]¶ Makes an HDF5 file from whatever given data.
Parameters:  data –
 input data in Numpy.ndarray or filename, or a shape tuple
 h5file –
 name (and path) of the output HDF5 file
 delimiter –
 data delimiter for text, csv files
 comp_level –
 compression level of the HDF5 file
 data –

hpelm.modules.hdf5_tools.
normalize_hdf5
(h5file, mean=None, std=None, batch=None)[source]¶ Calculates and applies normalization to data in HDF5 file.
Parameters:  mean –
 known vector of mean values
 std –
 known vector of standard deviations
 batch –
 number of rows to read at once, default is a native batch size
 mean –
hpelm.modules.mrsr module¶

hpelm.modules.mrsr.
mrsr
(X, T, kmax)[source]¶ Multiresponse Sparse Regression (MRSR) algorithm in Python, accelerated by Numpy.
Finds most relevant inputs for a regression problem with multiple outputs, returns these inputs onebyone. Fast implementation, but has complexity O(2^m) for m features in output.
Parameters:  T (matrix) – an (n x p) matrix of targets. The columns of T should have zero mean and same scale (e.g. equal variance).
 X (matrix) – an (n x m) matrix of regressors. The columns of X should have zero mean and same scale (e.g. equal variance).
 kmax (int) – an integer fixing the number of steps to be run, which equals to the maximum number of regressors in the model.
Returns: i1 – a (1 x kmax) vector of indices revealing the order in which the regressors enter model.
Return type: vector
 Reference:
 Timo Simila, Jarkko Tikka. Multiresponse sparse regression with application to multidimensional scaling. International Conference on Artificial Neural Networks (ICANN). Warsaw, Poland. September 1115, 2005. LNCS 3697, pp. 97102.
hpelm.modules.mrsr2 module¶

hpelm.modules.mrsr2.
mrsr2
(X, T, kmax, norm=2)[source]¶ MultiResponce Sparse Regression implementation with linear scaling in number of outputs.
Basically an L1regularized regression with multiple outputs, regularization considers all outputs together, method returns the best input features one by one and can be stopped early. Compared to an original MRSR this method is slower for small problems, but has a linear complexity in the number of outputs instead of exponential one, so it is suitable for autoencoders and other tasks with large output dimensionality.
Parameters:  T (matrix) – an (n x p) matrix of targets. The columns of T should have zero mean and same scale (e.g. equal variance).
 X (matrix) – an (n x m) matrix of regressors. The columns of X should have zero mean and same scale (e.g. equal variance).
 kmax (int) – an integer fixing the number of steps to be run, which equals to the maximum number of regressors in the model.
 norm (from Numpy.linalg.norm) – norm to use in MRSR2, can be 1 for L1 or 2 for L2 norm, default 2.
Returns: i1 – a (1 x kmax) vector of indices revealing the order in which the regressors enter model.
Return type: vector
 Reference:
 Better MRSR implementation according to: “Common subset selection of inputs in multiresponse regression” by Timo Similä and Jarkko Tikka, International Joint Conference on Neural Networks 2006
Created on Sun Jan 26 13:48:54 2014 @author: Anton Akusok