Mercurial > repos > bgruening > sklearn_train_test_eval
annotate pca.py @ 12:443471b0a27a draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit d970dae980fbe349414fc0889f719d875d999c5b"
author | bgruening |
---|---|
date | Fri, 27 Aug 2021 09:42:06 +0000 |
parents | ead7adad8d0e |
children |
rev | line source |
---|---|
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
1 import argparse |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
2 |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
3 import numpy as np |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
4 from galaxy_ml.utils import read_columns |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
5 from sklearn.decomposition import IncrementalPCA, KernelPCA, PCA |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
6 |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
7 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
8 def main(): |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
9 parser = argparse.ArgumentParser(description="RDKit screen") |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
10 parser.add_argument("-i", "--infile", help="Input file") |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
11 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
12 "--header", action="store_true", help="Include the header row or skip it" |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
13 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
14 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
15 "-c", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
16 "--columns", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
17 type=str.lower, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
18 default="all", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
19 choices=[ |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
20 "by_index_number", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
21 "all_but_by_index_number", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
22 "by_header_name", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
23 "all_but_by_header_name", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
24 "all_columns", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
25 ], |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
26 help="Choose to select all columns, or exclude/include some", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
27 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
28 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
29 "-ci", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
30 "--column_indices", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
31 type=str.lower, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
32 help="Choose to select all columns, or exclude/include some", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
33 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
34 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
35 "-n", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
36 "--number", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
37 nargs="?", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
38 type=int, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
39 default=None, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
40 help="Number of components to keep. If not set, all components are kept", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
41 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
42 parser.add_argument("--whiten", action="store_true", help="Whiten the components") |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
43 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
44 "-t", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
45 "--pca_type", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
46 type=str.lower, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
47 default="classical", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
48 choices=["classical", "incremental", "kernel"], |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
49 help="Choose which flavour of PCA to use", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
50 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
51 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
52 "-s", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
53 "--svd_solver", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
54 type=str.lower, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
55 default="auto", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
56 choices=["auto", "full", "arpack", "randomized"], |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
57 help="Choose the type of svd solver.", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
58 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
59 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
60 "-b", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
61 "--batch_size", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
62 nargs="?", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
63 type=int, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
64 default=None, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
65 help="The number of samples to use for each batch", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
66 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
67 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
68 "-k", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
69 "--kernel", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
70 type=str.lower, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
71 default="linear", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
72 choices=["linear", "poly", "rbf", "sigmoid", "cosine", "precomputed"], |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
73 help="Choose the type of kernel.", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
74 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
75 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
76 "-g", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
77 "--gamma", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
78 nargs="?", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
79 type=float, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
80 default=None, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
81 help="Kernel coefficient for rbf, poly and sigmoid kernels. Ignored by other kernels", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
82 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
83 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
84 "-tol", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
85 "--tolerance", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
86 type=float, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
87 default=0.0, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
88 help="Convergence tolerance for arpack. If 0, optimal value will be chosen by arpack", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
89 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
90 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
91 "-mi", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
92 "--max_iter", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
93 nargs="?", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
94 type=int, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
95 default=None, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
96 help="Maximum number of iterations for arpack", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
97 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
98 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
99 "-d", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
100 "--degree", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
101 type=int, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
102 default=3, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
103 help="Degree for poly kernels. Ignored by other kernels", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
104 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
105 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
106 "-cf", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
107 "--coef0", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
108 type=float, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
109 default=1.0, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
110 help="Independent term in poly and sigmoid kernels", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
111 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
112 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
113 "-e", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
114 "--eigen_solver", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
115 type=str.lower, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
116 default="auto", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
117 choices=["auto", "dense", "arpack"], |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
118 help="Choose the type of eigen solver.", |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
119 ) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
120 parser.add_argument( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
121 "-o", "--outfile", help="Base name for output file (no extension)." |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
122 ) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
123 args = parser.parse_args() |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
124 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
125 usecols = None |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
126 pca_params = {} |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
127 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
128 if args.columns == "by_index_number" or args.columns == "all_but_by_index_number": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
129 usecols = [int(i) for i in args.column_indices.split(",")] |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
130 elif args.columns == "by_header_name" or args.columns == "all_but_by_header_name": |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
131 usecols = args.column_indices |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
132 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
133 header = "infer" if args.header else None |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
134 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
135 pca_input = read_columns( |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
136 f=args.infile, |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
137 c=usecols, |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
138 c_option=args.columns, |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
139 sep="\t", |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
140 header=header, |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
141 parse_dates=True, |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
142 encoding=None, |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
143 index_col=None, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
144 ) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
145 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
146 pca_params.update({"n_components": args.number}) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
147 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
148 if args.pca_type == "classical": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
149 pca_params.update({"svd_solver": args.svd_solver, "whiten": args.whiten}) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
150 if args.svd_solver == "arpack": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
151 pca_params.update({"tol": args.tolerance}) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
152 pca = PCA() |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
153 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
154 elif args.pca_type == "incremental": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
155 pca_params.update({"batch_size": args.batch_size, "whiten": args.whiten}) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
156 pca = IncrementalPCA() |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
157 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
158 elif args.pca_type == "kernel": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
159 pca_params.update( |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
160 { |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
161 "kernel": args.kernel, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
162 "eigen_solver": args.eigen_solver, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
163 "gamma": args.gamma, |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
164 } |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
165 ) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
166 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
167 if args.kernel == "poly": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
168 pca_params.update({"degree": args.degree, "coef0": args.coef0}) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
169 elif args.kernel == "sigmoid": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
170 pca_params.update({"coef0": args.coef0}) |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
171 elif args.kernel == "precomputed": |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
172 pca_input = np.dot(pca_input, pca_input.T) |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
173 |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
174 if args.eigen_solver == "arpack": |
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
175 pca_params.update({"tol": args.tolerance, "max_iter": args.max_iter}) |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
176 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
177 pca = KernelPCA() |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
178 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
179 print(pca_params) |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
180 pca.set_params(**pca_params) |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
181 pca_output = pca.fit_transform(pca_input) |
9
ead7adad8d0e
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
bgruening
parents:
8
diff
changeset
|
182 np.savetxt(fname=args.outfile, X=pca_output, fmt="%.4f", delimiter="\t") |
8
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
183 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
184 |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
185 if __name__ == "__main__": |
e03a58b31c12
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afb24f3c81d625312186750a714d702363012b5"
bgruening
parents:
diff
changeset
|
186 main() |