Skip to main content
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 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.

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:

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, Email <mailto://mnick AT mit DOT edu>, Twitter

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

License

scikit-tensor-py3 is licensed under the GPLv3

Release files for scikit-tensor-py3 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scikit-tensor-py3 0.4.1
File Size Uploaded
scikit-tensor-py3-0.4.1.tar.gz 39.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scikit-tensor-py3 0.4.1
File Interpreter ABI Platform
scikit_tensor_py3-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size:87.4 kB

Release files / scikit-tensor-py3-0.4.1.tar.gz

Download URL scikit-tensor-py3-0.4.1.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b45de97ebd57e0213f54e891bf9a0549957eb2387f4df9f3dc3f7a50f8818b0a
BLAKE2b-256 checksum
How to use checksums
cbb208cbfbd076b159de353c745e0faef51d3512998b017a37a019943fcfd187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

Release files / scikit_tensor_py3-0.4.1-py3-none-any.whl

Download URL scikit_tensor_py3-0.4.1-py3-none-any.whl
Size 48.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27e9b576c712fbc0101244b33ea412fc7f5dbf0774003e6a21f7d38f6b0c6df3
BLAKE2b-256 checksum
How to use checksums
339128aa13c7c056c37d53677881cdff1c7e8da097aea5c0e4cb4faafb44ce4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.2.1

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page