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

Variance explained by the factors #34

Open
yoga-varatha opened this issue Oct 15, 2021 · 5 comments
Open

Variance explained by the factors #34

yoga-varatha opened this issue Oct 15, 2021 · 5 comments

Comments

@yoga-varatha
Copy link

yoga-varatha commented Oct 15, 2021

Could someone please clarify how I can calculate the total variance explained by the factors after decomposing?

I am currently using the following code:
`
U = tt.ncp_hals(my_data, rank=6, verbose=False)

factors = U.factors.factors
`

my data is a 3-dimensional tensor.

@ahwillia
Copy link
Collaborator

U.obj gives the final objective value, norm(residuals) / norm(my_data). If you square this quantity, it is more-or-less one minus the variance explained. (Note, however, that the data aren't mean-centered, so this is like the uncentered variance explained.)

Unlike PCA, there is no good way to quantify the variance explained on a factor-by-factor basis, because the factors aren't orthogonal to each other.

@yoga-varatha
Copy link
Author

Excellent. Thank you so much.

@yoga-varatha
Copy link
Author

Hello, another quick question. How can I use the factors I obtained above to project a new tensor onto the space spanned by the factors? Basically, I want to find the weight vector for a new set of inputs. Is there a function implemented for this purpose?
Thank you in advance.

@ahwillia
Copy link
Collaborator

ahwillia commented Nov 23, 2021 via email

@yoga-varatha
Copy link
Author

I see, thanks.

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

2 participants