Hi
l try to run exam code, but get error where show this is answer.
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
model = Pipeline(steps=[
(“preprocessor”, StandardScaler()),
(“classifier”, KNeighborsClassifier(n_neighbors=5)),
])
from sklearn.model_selection import cross_validate
model.set_params(preprocessor=StandardScaler(), classifier__n_neighbors=5)
cv_results_ss_5 = cross_validate(
model, data, target, cv=10, scoring=“balanced_accuracy”
)
cv_results_ss_5[“test_score”].mean(), cv_results_ss_5[“test_score”].std()
l see problem with ValueError: could not convert string to float: ’ Private’
Did you face any error?