gemmr.sample_analysis.addon.cv
- gemmr.sample_analysis.addon.cv(estr, X, Y, Xorg, Yorig, x_align_ref, y_align_ref, results, **kwargs)
Calculates cross-validated outcome metrics.
Required keyword-arguments:
kwargs[‘cvs’]: list of (label, cross-validator)
kwargs[‘scorers’]: can be created by
mk_scorers_for_cv()
Optional keyword-arguments:
- kwargs[‘fit_params’]: dict
passed to cross_validate
Provides outcome metrics
between_covs_cv,between_corrs_cv,x_weights_cv,y_weights_cv,x_loadings_cvandy_loadingscv.- Parameters:
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)) – can beNone. 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)) – can beNone. 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 positivey_align_ref ((n_features,)) – the sign of Y weights is chosen such that the cosine-distance between fitted Y weights and
y_align_refis positiveresults (xr.Dataset) – containing outcome features computed so far, and is modified with outcomes of this function
kwargs (dict) – keyword arguments