Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D array in example code #15

Open
Marco-Santoni opened this issue Oct 5, 2015 · 0 comments
Open

2D array in example code #15

Marco-Santoni opened this issue Oct 5, 2015 · 0 comments

Comments

@Marco-Santoni
Copy link
Contributor

I'm going through the cp_sensory_bread_data.py example:

import logging
from scipy.io.matlab import loadmat
from sktensor import dtensor, cp_als

# Set logging to DEBUG to see CP-ALS information
logging.basicConfig(level=logging.DEBUG)

# Load Matlab data and convert it to dense tensor format
mat = loadmat('../data/sensory-bread/brod.mat')
T = dtensor(mat['X'])

# Decompose tensor using CP-ALS
P, fit, itr, exectimes = cp_als(T, 3, init='random')

If I try:

mat['X'].shape
--> (10, 88)
T.shape
--> (10, 88)

Shouldn't the tensor have a third dimension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant