Skip to main content

Python module for multilinear algebra and tensor factorizations

Project description

# scikit-tensor
![Travis CI](https://travis-ci.org/evertrol/scikit-tensor-py3.svg?branch=master)

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
* RESCAL
* DEDICOM
* INDSCAL

Moreover, all operations support dense and tensors.

## Note

This is a Python 3 only compatible maintenance release. It appears the
development for scikit-tensor has stalled, and the project has been
abondoned. This fork only supports Python 3.4 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.

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

## Usage
Example script to decompose sensory bread data (available from http://www.models.life.ku.dk/datasets) using CP-ALS

```python
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')
```

## Installation

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 https://github.com/evertrol/scikit-tensor-py3.git
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.

## Authors

- Maximilian Nickel: [Web](http://web.mit.edu/~mnick/www), [Email](mailto://mnick AT mit DOT edu), [Twitter](http://twitter.com/mnick)
- Evert Rol (maintenance for Python 3 version): [Email](mailto:evert.rol@gmail.com)

## License

scikit-tensor-py3 is licensed under the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt)

## Related Projects

* [Matlab Tensor Toolbox](http://www.sandia.gov/~tgkolda/TensorToolbox/index-2.5.html):
A Matlab toolbox for tensor factorizations and tensor operations freely available for research and evaluation.
* [Matlab Tensorlab](http://www.tensorlab.net/)
A Matlab toolbox for tensor factorizations, complex optimization, and tensor optimization freely available for
non-commercial academic research.


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.2.1.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

scikit_tensor_py3-0.2.1-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file scikit-tensor-py3-0.2.1.tar.gz.

File metadata

  • Download URL: scikit-tensor-py3-0.2.1.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.2

File hashes

Hashes for scikit-tensor-py3-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f929510f901b2c2cc9a8884685b01968c5a95c75e7a345ebc87a6de0df5306bd
MD5 264cd483c6d84b7e6898f17c8b72a8f1
BLAKE2b-256 bea00374cdf47ce3997c5744a3ef2dd2f66aecea0b8fa7761fe0f769a36f2a6d

See more details on using hashes here.

File details

Details for the file scikit_tensor_py3-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: scikit_tensor_py3-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.2

File hashes

Hashes for scikit_tensor_py3-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b5b1cb5fbed6203009ff3a24c9efb2b6ce9dcaaf7556d0c7cdc337cbb1bb599
MD5 2e1f2916e2a38f9e83d2c7f3a2de2f3f
BLAKE2b-256 3b8691141214f4d72a1beef771701530b8070d3caecdaa9edfd3f284a816d092

See more details on using hashes here.

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