gemmr.sample_analysis.addon.loadings_true_pearson¶
-
gemmr.sample_analysis.addon.loadings_true_pearson(estr, X, Y, Xorig, Yorig, x_align_ref, y_align_ref, results, **kwargs)¶ Calculates Pearson correlations between estimated and true test loadings.
Requires results:
x_test_scoresx_test_scores
These are available if
addana_scores_true_spearman()was run before.Requires keyword arguments:
- kwargs[‘true_loadings’] - which is a
dictconstructed withccapwr.sample_analysis.analyzers._calc_true_loadings(). - Xtest, Ytest
Provides outcome metrics
x_loadings_true_pearson,y_loadings_true_pearson,x_crossloadings_true_pearsonandy_crossloadings_true_pearsonParameters: - estr (sklearn-style estimator) – fitted estimator
- X (np.ndarray (n_samples, n_features)) – dataset X
- Y (np.ndarray (n_samples, n_features)) – dataset Y
- Xorig (
Noneor np.ndarray (n_samples, n_orig_features)) – ifNoneset toX. Allows to provide an alternative set of X features for calculating loadings. I.e. an implicit assumption is that the rows inXandXorigcorrespond to the same samples (subjects). - Yorig (
Noneor np.ndarray (n_samples, n_orig_features)) – ifNoneset toY. Allows to provide an alternative set of Y features for calculating loadings. I.e. an implicit assumption is that the rows inYandYorigcorrespond to the same samples (subjects). - x_align_ref ((n_features,)) – the sign of X weights is chosen such that the cosine-distance between
fitted X weights and
x_align_refis positive - y_align_ref ((n_features,)) – the sign of Y weights is chosen such that the cosine-distance between
fitted Y weights and
y_align_refis positive - results (xr.Dataset) – containing outcome features computed so far, and is modified with outcomes of this function
- kwargs (dict) – keyword arguments