Created
September 10, 2020 19:35
-
-
Save omartinez182/effdc2a56f3139b035d5b0a33b24bebd to your computer and use it in GitHub Desktop.
Snippet #1 - Nested Cross-Validation Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Load libraries | |
import numpy as np | |
import pandas as pd | |
from sklearn.datasets import load_wine | |
from sklearn.model_selection import StratifiedKFold | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.model_selection import cross_val_score, GridSearchCV, KFold | |
import matplotlib.pyplot as plt | |
import warnings | |
%matplotlib inline | |
warnings.filterwarnings("ignore") | |
#Load data | |
X, y = load_wine(return_X_y=True) | |
X.shape, y.shape |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment