Last active
August 29, 2015 14:22
-
-
Save kudkudak/fb70db9d86883764d95e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def pick_h(protein, fingerprint, loader, model=TWELM, full_param_grid = {'C': list(np.logspace(0, 5, 6)), | |
| 'h': [100, 200, 500, 1000]}): | |
| comps = [[protein, fingerprint]] | |
| loader = copy.deepcopy(loader) | |
| preprocess_fncs = [] | |
| data = get_data(comps, loader, preprocess_fncs).values()[0][0][0] | |
| X = data['X_train']['data'] | |
| y = data['Y_train']['data'] | |
| X_test = data['X_valid']['data'] | |
| y_test = data['Y_valid']['data'] | |
| projector = RandomProjector() | |
| model = partial(model, projector=projector, random_state=666) | |
| grid = GridSearch(base_model_cls=model, | |
| param_grid=full_param_grid, | |
| seed=666, | |
| score=wac_score) | |
| grid.fit(X, y) | |
| best_params = grid.best_params | |
| return best_params['h'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment