Created
May 15, 2021 23:47
-
-
Save samarth-agrawal-86/5a19d8fa48d83affbfed26aaa89fa8f4 to your computer and use it in GitHub Desktop.
Random Split - To create train valid test dataset using fast_ml train_valid_test_split
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
import pandas as pd | |
df = pd.read_csv('/kaggle/input/bluebook-for-bulldozers/TrainAndValid.csv', parse_dates=['saledate'], low_memory=False) | |
from fast_ml.model_development import train_valid_test_split | |
X_train, y_train, X_valid, y_valid, X_test, y_test = train_valid_test_split(df, target = 'SalePrice', | |
train_size=0.8, valid_size=0.1, test_size=0.1) | |
print(X_train.shape), print(y_train.shape) | |
print(X_valid.shape), print(y_valid.shape) | |
print(X_test.shape), print(y_test.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment