I was hyper-tuning the machine learning algorithms via for loop. but I do not know how to keep it saving into csv or excel file as it is showing in terminal output...Help me..Here I am sharing the code for reference.
def random_search():
options = create_opts()
# kernel
kernel_opts = np.array(["rbf", "poly", "linear"]) # 3
# C
C_opts = np.array([0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000]) # 15
# C_linear_opts = np.array([0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100]) # 10
# epsilon
epsilon_opts = np.array([.01, .02, .03, .04, .05, .06, .07, .08, .09, 0.1]) # 10
# gamma
gamma_opts = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]) # 9
# n_iter = len(kernel_opts)*len(C_opts)*len(epsilon_opts)*len(gamma_opts)
for kernel in kernel_opts:
for C in C_opts:
for epsilon in epsilon_opts:
for gamma in gamma_opts:
run_svr(options.random_state, options.poly_degree, kernel=kernel, C=C, epsilon=epsilon, gamma=gamma)