Observed since 20 Oct, 19:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
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.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.165 | 29 Apr 2024 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:625387e3eaefbde7c89efb19b18c67a9e636a113fa492b2f5f910aad15821b66