Question: problem with python code not running import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # Import numpy and give it the

problem with python code not running
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Import numpy and give it the alias np
import numpy as np
# Load dataset
data = pd.read_csv('/content/drive/MyDrive/Cancer_Data.csv')
5. Hyperparameter Tuning"
Use GridSearchCV for hyperparameter tuning on each model.
from sklearn.model_selection import GridSearchCV
# Define parameter grids
param_grid_svc ={'C': [0.1,1,10], 'kernel': ['linear','rbf']}
param_grid_rf ={'n_estimators': [50,100], 'max_depth': [None,10]}
# Create GridSearchCV objects
grid_svc = GridSearchCV(SVC(), param_grid_svc, cv=5)
grid_rf = GridSearchCV(RandomForestClassifier(), param_grid_rf, cv=5)
# Fit models with grid search
grid_svc.fit(X_train, y_train)
grid_rf.fit(X_train, y_train)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!