Python Machine Learning Data Pre-Processing Template

From Federal Burro of Information
Revision as of 23:51, 17 February 2023 by David (talk | contribs) (Created page with " <pre> import numpy as np import matplotlib.pyplot as plt import pandas as pd dataset = pd.read_csv('filename.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, -1].values from sklearn.model_selection import train_test_split X_train, X_test , y_train, y_test = train_test_split(X,y,test_size = 0.2 , random_state = 81 ) </pre> source: Udemey "Machine Learning A-Z™: Python & R in Data Science [2023]" category:script")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

dataset = pd.read_csv('filename.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values

from sklearn.model_selection import train_test_split
X_train, X_test , y_train, y_test = train_test_split(X,y,test_size  = 0.2 , random_state = 81 )

source: Udemey "Machine Learning A-Z™: Python & R in Data Science [2023]"