How to input Matrix in graphlab neuralnet_classifier

User 3843 | 4/4/2016, 5:26:12 PM

Hi,

I have formatted input data under a series of matrix such Minput= (32 * 64), we have nSample matrix Minput How can I input the series into a sframe for neural_net input ? (this is clear if sframe can get a listof matrix....)

graphlab.neuralnetclassifier.create(dataset, target, features=None, maxiterations=10, network=None, validationset='auto', verbose=True, classweights=None, **kwargs)

dataset : SFrame

Comments

User 91 | 4/4/2016, 9:39:21 PM

The input format for the neural net classifier is an SFrame. You can convert the Matrix to SFrame as follows:

` import numpy as np import graphlab as gl

M = np.matrix([[1, 2], [3, 4]])

sf = gl.SFrame({'data': M.tolist()}) `


User 3843 | 4/11/2016, 4:48:09 PM

What about tensor, ie dimension 3 3 2 ?

Also, there is only one matrix, how to get a series of matrix ?


User 4 | 4/13/2016, 12:29:08 AM

@brookm297 SFrame supports recursive types inside (columns of type list or dict), so within a column of SFrame, you can have effectively multiple dimensions -- this can help you represent an arbitrarily high-dimensional dataset in a single table. The process to get to this state is a combination of packing extra dimensions into their own columns (with row redundancy) or packing extra dimensions into a single column (as a recursive structure), similar to denormalization in a database.

You can use unpack to create multiple columns from a packed column, or stack to create multiple rows from a packed column, to represent the data differently.

The classifier will operate on the 2d table, using potentially each column (other than the target column) of the SFrame as a feature.


User 3843 | 4/13/2016, 9:01:16 AM

Thanks for your reply. Wil try to have a look into.