Coverage for langbrainscore/utils/preprocessing.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v6.4, created at 2022-06-07 21:22 +0000

1from sklearn.preprocessing import ( 

2 MinMaxScaler, 

3 StandardScaler, 

4 KBinsDiscretizer, 

5 RobustScaler, 

6) 

7from sklearn.random_projection import GaussianRandomProjection 

8from sklearn.decomposition import PCA 

9 

10# TODO: decide whether hardocded n_bins, n_components should be kept that way 

11# or allowed to be changed 

12preprocessor_classes = { 

13 "demean": StandardScaler(with_std=False), 

14 "demean_std": StandardScaler(with_std=True), 

15 "minmax": MinMaxScaler, 

16 "discretize": KBinsDiscretizer(n_bins=10, encode="ordinal", strategy="uniform"), 

17 "robust_scaler": RobustScaler(), 

18 "pca": PCA(n_components=10), 

19 "gaussian_random_projection": GaussianRandomProjection(n_components=10), 

20}