hyperparameter tuning
import numpy as np from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.svm import SVC from sklearn.model_selection import GridSearchCV #Split the data into training and testing sets X_train, X_test, y_train, y_test = train_test_split(df, y, test_size=0.1, random_state=42) #Train a logistic regression model svm_clf = SVC(kernel='linear') param_grid = {'C': [0.1, 1, 10], 'kernel': ['linear', 'rbf']} grid_search = GridSearchCV(svm_clf, param_grid, cv=5, scoring='accuracy') grid_search.fit(df, y) best_params = grid_search.best_params_ print(best_params)