Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misorder labels from contructed tensor after tensor factorization #41

Open
lam-c opened this issue Jan 18, 2021 · 0 comments
Open

Misorder labels from contructed tensor after tensor factorization #41

lam-c opened this issue Jan 18, 2021 · 0 comments

Comments

@lam-c
Copy link

lam-c commented Jan 18, 2021

Hey @cameronmartino, @gwarmstrong,
Thanks for this awesome tool.

I was concerned about the sorting procedure for loadings when fitting tensor factorization, would it cause misorder of loading labels in the label step?

Codes of sorting procedure excerpted from factorization.py line 219 - 224 in _fit function

# save array of loadings for subjects
self.subjects = loads[0].copy()
self.subjects = self.subjects[self.subjects[:, 0].argsort()]
# save array of loadings for features
self.features = loads[1].copy()
self.features = self.features[self.features[:, 0].argsort()]

Codes of labeling step excerpted from factorization.py since line 335 in label function

# DataFrame single non-condition dependent loadings
self.subjects = pd.DataFrame(self.subjects,
                             columns=self.biplot_labels,
                             index=construct.subject_order)  # self.subjects reordered, but construct.subject_order didn't
self.features = pd.DataFrame(self.features,
                             columns=self.biplot_labels,
                             index=construct.feature_order)  # self.features reordered, but construct.feature_order didn't
......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant