Skip to content

Ejmric/triFastSTMF

Repository files navigation

DOI Binder DOI

triFastSTMF: Matrix tri-factorization over the tropical semiring

triFastSTMF is a tri-factorization approach for matrix approximation and prediction based on Fast Sparse Tropical Matrix Factorization (FastSTMF).

For details, please refer to Amra Omanović, Polona Oblak, and Tomaž Curk (2023). Matrix tri-factorization over the tropical semiring. The preprint is available in arXiv:2305.06624. If you use this work, please cite:

@misc{omanovic2023triFastSTMF,
      title={Matrix tri-factorization over the tropical semiring}, 
      author={Amra Omanović and Polona Oblak and Tomaž Curk},
      year={2023},
      eprint={2305.06624},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

Real data

We downloaded the real-world interaction dataset of an ant colony named "insecta-ant-colony3" [1] from "Animal Social Networks" data collection on http://networkrepository.com [2]. Additional preprocessing before running our experiments is explained in the paper.

Jupyter notebooks

The notebooks are independent and can be run in any order.

Use

import numpy.ma as ma
import numpy as np
from triFastSTMF import triFastSTMF

data = ma.array(np.random.rand(100,100), mask=np.zeros((100,100)))
model = triFastSTMF(rank_1 = 5, rank_2 = 3, initialization="random_vcol", threshold=100)
model.fit(data)
approx = model.predict_all()

References

[1] D. P. Mersch, A. Crespi, and L. Keller (2013). Tracking individuals shows spatial fidelity is a key regulator of ant social organization. Science, vol. 340, no. 6136, pp. 1090–1093.

[2] R. A. Rossi and N. K. Ahmed (2015). The network data repository with interactive graph analytics and visualization. AAAI. [Online]. Available: http://networkrepository.com