-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
9dc2484
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this simple example in the README:
import adilsm.adilsm as ilsm
import pandas as pd
import numpy as np
Generate a random non-negative matrix with 100 rows and 10 columns
A = np.random.rand(100, 10)
A += np.random.uniform(low=0, high=0.01, size=A.shape)
B = np.random.permutation(A.T).T + np.random.uniform(low=0, high=0.01, size=A.shape)
m0 = np.hstack((A, B))
n_items = [A.shape[1], B.shape[1]]
n_scores = len(n_items)
n_embedding, n_themes = [10,10]
h4_updated, h4_updated_sparse, w4_ism, h4_ism, q4_ism, tensor_score, m0_norm = ilsm.ism(m0, n_embedding, n_themes, n_scores, n_items, norm_m0=True, update_h4_ism=True,
max_iter_mult=200, sparsity_coeff=.8)
error = np.linalg.norm(m0_norm - w4_ism @ h4_updated_sparse.T) / np.linalg.norm(m0_norm)
print('error: ',round(error, 2))
and cite this reference:
Fogel, P., Boldina, G., Augé, F., Geissler, C., & Luta, G. (2024). ISM: A New Space-Learning Model for Heterogenous Multi-view Data Reduction, Visualization and Clustering. Preprints. https://doi.org/10.20944/preprints202402.1001.v1