|
15 | 15 |
|
16 | 16 | from sklearn.gaussian_process import GaussianProcessRegressor |
17 | 17 | from sklearn.gaussian_process.kernels import DotProduct, RBF, Matern, WhiteKernel |
18 | | -from sklearn.preprocessing import normalize, StandardScaler |
| 18 | +from sklearn.preprocessing import normalize, StandardScaler, MinMaxScaler |
19 | 19 |
|
20 | 20 | from gp_utils import * |
21 | 21 |
|
|
43 | 43 | # e.g. --only_use_features "votes_sd affinity_sum tag_popularity votes_mean question_age" |
44 | 44 | parser.add_argument("--beta", default=0.4, type=float, metavar="b", |
45 | 45 | help="beta parameter for exploration (0=no exploration)") |
| 46 | +parser.add_argument("--scaler", default="standard", help="minmax or standard (for normalization)") |
46 | 47 |
|
47 | 48 | parser.add_argument("--sum_file_path", default="../cache/gp/runs/") |
48 | 49 | parser.add_argument("--save_every_n", default=1000, type=int) |
|
148 | 149 |
|
149 | 150 | #With osgpr we pretrain immediately |
150 | 151 | if model_choice == "osgpr": |
151 | | - persistent_scaler = StandardScaler() |
| 152 | + if args.scaler=="minmax": |
| 153 | + persistent_scaler = MinMaxScaler() |
| 154 | + else: |
| 155 | + persistent_scaler = StandardScaler() |
152 | 156 | gp_input = persistent_scaler.fit_transform(training_set_for_gp) |
153 | 157 | Z1 = gp_input[np.random.permutation(gp_input.shape[0])[0:M_points], :] |
154 | 158 | if args.kernel == "linear": |
|
0 commit comments