Skip to main content

Python module for multilinear algebra and tensor factorizations

Project description

scikit-tensor is a Python module for multilinear algebra and tensor factorizations. Currently, scikit-tensor supports basic tensor operations such as folding/unfolding, tensor-matrix and tensor-vector products as well as the following tensor factorizations:

  • Canonical / Parafac Decomposition

  • Tucker Decomposition




Moreover, all operations support dense and tensors.


This is a Python 3 only compatible maintenance release. It appears the development for scikit-tensor has stalled, and the project has been abandoned. This fork only supports Python 3.5 and later, and is available on PyPI as scikit-tensor-py3, for easier installation.

Issues and pull requests are welcomed, but issues relating algorithms and requests for additional algorithms may be postponed or ignored altogether. Technical (code) issues are welcomed.


The required dependencies to build the software are Numpy and SciPy.


Example script to decompose sensory bread data (available from using CP-ALS:

import logging
from import loadmat
from sktensor import dtensor, cp_als

# Set logging to DEBUG to see CP-ALS information

# 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')


This package uses distutils, which is the default way of installing python modules. The use of virtual environments is recommended:

pip install scikit-tensor-py3

To install in development mode:

git clone
pip install -e scikit-tensor

Contributing & Development

scikit-tensor is still an extremely young project, and I’m happy for any contributions (patches, code, bugfixes, documentation, whatever) to get it to a stable and useful point. Feel free to get in touch with me via email (mnick at AT mit DOT edu) or directly via github. See also the note above.

Development is synchronized via git. Feel free to fork this project and make pull requests from that fork.


  • Maximilian Nickel: Web, Email <mailto://mnick AT mit DOT edu>, Twitter

  • Evert Rol (maintenance for Python 3 version): Email


scikit-tensor-py3 is licensed under the GPLv3

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit-tensor-py3-0.4.1.tar.gz (39.0 kB view hashes)

Uploaded source

Built Distribution

scikit_tensor_py3-0.4.1-py3-none-any.whl (48.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page