return [x_r[0]]
// dictionary of modelsmodels = {
"PCA" : PCA,
"FastICA" : FastICA,
"TSNE" : TSNE,
"Isomap" : Isomap,
"SpectralEmbedding" : SpectralEmbedding,
"LocallyLinearEmbedding" : LocallyLinearEmbedding
}// main
x = format_data(x)
assertall([i.shape[1]>ndims for i in x]), "In order to reduce the data, ndims must be less than the number of dimensions"
// if there are any nans in any of the lists, use ppcaif np.isnan(np.vstack(x)).any():
warnings.warn("Missing data: Inexact solution computed with PPCA (see https://github.com/allentran/pca-magic for details)")
x = fill_missing(x)
// normalizeif normalize:
x = normalizer(x, normalize=normalize)
// build model params dictif model_params=={}:
model_params = {
"n_components" : ndims
}
elif "n_components" in model_params:
pass
else:
model_params["n_components"]=ndims