zero-to-mastery-ml icon indicating copy to clipboard operation
zero-to-mastery-ml copied to clipboard

Resolved Error in sklearn Lesson File - Incorrect Data Splitting

Open sakethyalamanchili opened this issue 1 year ago • 0 comments

I have resolved an error in the provided sklearn lesson file. Below is my updated code along with the corrected data splitting after preprocessing:

Corrected data splitting after preprocessing

X_train, X_test, y_train, y_test = train_test_split(X_transform_df, y, test_size=0.2, random_state=5)

Fit and score the model

grid_cv = GridSearchCV(estimator=model, param_grid=param, cv=5, verbose=2)
grid_cv.fit(X_train, y_train)
y_preds = grid_cv.predict(X_test)
evaluation_metrics(y_test, y_preds)

You can also access the IPython Notebook containing the complete code and execution results updated-Notebook.

sakethyalamanchili avatar Feb 26 '24 04:02 sakethyalamanchili