From b878be7a34ad70b073d09bbacef161d785d3ca24 Mon Sep 17 00:00:00 2001 From: Thieu Date: Sun, 5 Nov 2023 16:25:31 +0700 Subject: [PATCH] Update README --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b2d72c6b..39d88974 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,12 @@ sc = StandardScaler() X_train_std = sc.fit_transform(X_train) X_test_std = sc.transform(X_test) -data = [X_train_std, X_test_std, y_train, y_test] +data = { + "X_train": X_train_std, + "X_test": X_test_std, + "y_train": y_train, + "y_test": y_test +} class SvmOptimizedProblem(Problem): @@ -260,11 +265,11 @@ class SvmOptimizedProblem(Problem): svc = SVC(C=C_paras, kernel=kernel_paras, degree=degree, gamma=gamma, probability=probability, random_state=1) # Fit the model - svc.fit(X_train_std, y_train) + svc.fit(self.data["X_train"], self.data["y_train"]) # Make the predictions - y_predict = svc.predict(X_test_std) + y_predict = svc.predict(self.data["X_test"]) # Measure the performance - return metrics.accuracy_score(y_test, y_predict) + return metrics.accuracy_score(self.data["y_test"], y_predict) my_bounds = [ FloatVar(lb=0.01, ub=1000., name="C_paras"),