Skip to content

Commit

Permalink
[add] some corection
Browse files Browse the repository at this point in the history
  • Loading branch information
vchemla committed Mar 18, 2024
1 parent 5cd8105 commit 9dc2484
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ clean:
@find . -name '__pycache__' |xargs rm -fr {} \;
@rm -fr build dist .eggs .pytest_cache
@rm -fr adilsm-*.dist-info
@rm -fr adilsm.egg-info
@rm -fr adilsm.egg-info examples/.ipynb_checkpoints/

install: clean wheel
@pip3 install -U dist/*.whl --cache-dir /pip_cache
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ pip install adilsm

ILSM is Integrated Longitudinal Multi Source Model.

# Usage

```python
import adilsm.adilsm as ilsm
```


38 changes: 19 additions & 19 deletions examples/abis_biomed.ipynb

Large diffs are not rendered by default.

39 changes: 17 additions & 22 deletions examples/uci_digits_biomed.ipynb

Large diffs are not rendered by default.

1 comment on commit 9dc2484

@paulfogeladvestis
Copy link
Contributor

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

Please sign in to comment.