Observed since 20 Oct, 19:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
adnmtf
Non-negative Matrix and Tensor Factorization
Non-Negative Matrix and Tensor Factorizations
Developped in collaboration with Advestis (Github)
from adnmtf import NMF
import numpy as np
w = np.array([[1, 2],
[3, 4],
[5, 6],
[7, 8],
[9, 10],
[11, 12]])
h = np.array([[0.1, 0.2, 0.3, 0.4, 0.5, 0.6],
[0.9, 0.8, 0.7, 0.6, 0.5, 0.4]])
m0 = w.dot(h)
my_nmfmodel = NMF(n_components=2)
estimator_ = my_nmfmodel.fit_transform(m0)
estimator_ = my_nmfmodel.predict(estimator_)
In this example, the matrix to be factorized is generated by the dot product of:
| W | |
|---|---|
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
| 7 | 8 |
| 9 | 10 |
| 11 | 12 |
| and |
| H | |||||
|---|---|---|---|---|---|
| 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 |
| 0.9 | 0.8 | 0.7 | 0.6 | 0.4 | 0.4 |
from adnmtf import NTF
import pandas as pd
DATA_PATH = ...
df = pd.read_csv(DATA_PATH)
m0 = df.values
n_blocks = 5
my_ntfmodel = NTF(n_components=5)
estimator_ = my_ntfmodel.fit_transform(m0, n_blocks)
estimator_ = my_ntfmodel.predict(estimator_)
In this example, the tensor to be factorized is read in file data_ntf.csv. The tensor has 5 layers in the 3rd dimension and is formatted as a table with 5 blocks concatenated horizontally.
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
sdist · 1,556.53 KB · Python source
Observed since 20 Oct, 19:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:f6e6f7141808bb7fcdf5c09897c0326f2f9adfc4397ae2a89453bf9bbbd28f98