<jupyter_start><jupyter_text>What do I want to do on SVR Gaussian kernel?- Nominal: dummify - Ordinal: keep- Discrete: keep- Continuous: keep- Then, StandardScaler it.Parameters to be tuned:- gamma: large=overfit, small=underfit- C: large=overfit, small=underfit- epsilon: large=underfit, small=overfit<jupyter_code>back_end_svr.head() # BSMT: no bin
back_end_svr.shape
y_std.shape
kfold = KFold(n_splits=5, shuffle = True)
params = {
    'C': np.logspace(-0.5,1.5,9),
    'epsilon': np.logspace(-2,-1,5),
    'gamma' : np.logspace(-3.5,-2,7)
          }
svr = SVR(kernel = 'rbf')
svr_tuner = GridSearchCV(svr, params, cv=kfold, return_train_score = True, n_jobs = -1)
%time svr_tuner.fit(back_end_svr, y_std.ravel())
svr_tuner.best_score_
# 0.9404, 1.5, -1, -3
# 0.9402, 1.25, -1.25, -3
svr_tuner.best_estimator_.get_params()
C, gamma, epsilon = (30, 0.001, 0.1);
goal = 0.9450;
parameters = [];
kfold = KFold(n_splits=5, shuffle = True);
svr = SVR(kernel = 'rbf');

round_best = 0.94
for i in range(50):
    step_size = 20*max(0.0005, goal-round_best);
    params = {
    'C': np.linspace((1-step_size)*C, (1+step_size)*C, 5),
    'epsilon': np.linspace((1-step_size)*epsilon, (1+step_size)*epsilon, 5),
    'gamma' : np.linspace((1-step_size)*gamma, (1+step_size)*gamma, 5)
          };
    svr_tuner = GridSearchCV(svr, params, cv=kfold, return_train_score = True, n_jobs = -1)
    %time svr_tuner.fit(back_end_svr, y_std.ravel())
    
    C = svr_tuner.best_estimator_.get_params()["C"]
    epsilon = svr_tuner.best_estimator_.get_params()["epsilon"]
    gamma = svr_tuner.best_estimator_.get_params()["gamma"]
    round_best = svr_tuner.best_score_;
    
    print(C, epsilon, gamma, round_best);
    parameters.append([C, epsilon, gamma, round_best]);

svr_tuner.cv_results_["mean_test_score"].mean()
parameters2 = [];
kfold = KFold(n_splits=5, shuffle = True);
svr = SVR(kernel = 'rbf', epsilon = 0.1);

round_best = 0.94
for i in range(50):
    step_size = 30*max(0.0005, goal-round_best);
    params = {
    'C': np.linspace((1-step_size)*C, (1+step_size)*C, 7),
    # 'epsilon': np.linspace((1-step_size)*epsilon, (1+step_size)*epsilon, 5),
    'gamma' : np.linspace((1-step_size)*gamma, (1+step_size)*gamma, 7)
          };
    svr_tuner = GridSearchCV(svr, params, cv=kfold, return_train_score = True, n_jobs = -1)
    %time svr_tuner.fit(back_end_svr, y_std.ravel())
    
    C = svr_tuner.best_estimator_.get_params()["C"]
    gamma = svr_tuner.best_estimator_.get_params()["gamma"]
    round_best = svr_tuner.best_score_;
    round_mean = svr_tuner.cv_results_["mean_test_score"].mean();
    
    print(C, gamma, round_best, round_mean);
    parameters2.append([C, gamma, round_best, round_mean]);

temp = parameters2
temp.sort(key = lambda x: x[3], reverse = True)
np.mean([x[3] for x in temp])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16754663850756776, 'fraction_numerical': 0.03555086237240408, 'mean_word_length': 4.3927893738140416, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '249238', 'license': 'MIT', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1190, 'n_words': 211, 'path': 'Hao-Wei/Gaussian SVR and kernel ridge exploration-Copy1.ipynb', 'repo_name': 'kiwymic/operation_goldfish-1', 'size': '2841'}