filmov
tv
Machine Learning | Cross Validation | Random State in Train Test Split | ML | AI

Показать описание
Machine Learning | Cross Validation | Random State in Train Test Split | ML | AI
Topic to be Covered - Importance of Random State in Train Test Split
Table of Content
0:00 Introduction
00:14 Import pandas library
00:17 Import dataset using pandas read_csv function
00:39 Handle missing values
00:59 Extract features and labels
01:15 Label Encoding
01:37 Sampling - Train Test Split
02:10 Random State
03:20 Compare X_train value with the previous run when random_state remains the same
04:00 Change the value of random_state from 0 to 1
04:20 Compare X_train value with the previous run when random_state is changed from 0 to 1
06:29 random_state=None
07:28 Compare X_train value with the previous run when random_state=None
Code Start here
=============
import pandas as pd
import numpy as np
'''Get the rows that contains NULL (NaN)'''
'''Fill the NaN values for Occupation, Emplyment Status and Employement Type'''
col = ['Occupation','Employment Status','Employement Type']
df['Age'].fillna(df['Age'].mean(),inplace=True)
df['Salary'].fillna(df['Salary'].mean(),inplace=True)
'''col1 = ['Age','Salary']
'''------------------------------- L A B E L E N C O D I N G ------------------'''
encode = LabelEncoder()
'''S A M P L I N G'''
X_train2, X_test2, y_train2, y_test2 = train_test_split(features,
labels,
test_size=.25,
random_state=None)
All Playlist of this youtube channel
====================================
1. Data Preprocessing in Machine Learning
2. Confusion Matrix in Machine Learning, ML, AI
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
4. Cross Validation, Sampling, train test split in Machine Learning
5. Drop and Delete Operations in Python Pandas
6. Matrices and Vectors with python
7. Detect Outliers in Machine Learning
8. Time Series preprocessing in Machine Learning
9. Handling Missing Values in Machine Learning
10. Dummy Encoding in Machine Learning
11. Data Visualisation with Python, Seaborn, Matplotlib
12. Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
14. Statistics with Python
15. Sklearn Scikit Learn Machine Learning
16. Python Pandas Dataframe Operations
17. Linear Regression, Supervised Machine Learning
18 Interiew Questions on Machine Learning and Data Science
19. Jupyter Notebook Operations
Topic to be Covered - Importance of Random State in Train Test Split
Table of Content
0:00 Introduction
00:14 Import pandas library
00:17 Import dataset using pandas read_csv function
00:39 Handle missing values
00:59 Extract features and labels
01:15 Label Encoding
01:37 Sampling - Train Test Split
02:10 Random State
03:20 Compare X_train value with the previous run when random_state remains the same
04:00 Change the value of random_state from 0 to 1
04:20 Compare X_train value with the previous run when random_state is changed from 0 to 1
06:29 random_state=None
07:28 Compare X_train value with the previous run when random_state=None
Code Start here
=============
import pandas as pd
import numpy as np
'''Get the rows that contains NULL (NaN)'''
'''Fill the NaN values for Occupation, Emplyment Status and Employement Type'''
col = ['Occupation','Employment Status','Employement Type']
df['Age'].fillna(df['Age'].mean(),inplace=True)
df['Salary'].fillna(df['Salary'].mean(),inplace=True)
'''col1 = ['Age','Salary']
'''------------------------------- L A B E L E N C O D I N G ------------------'''
encode = LabelEncoder()
'''S A M P L I N G'''
X_train2, X_test2, y_train2, y_test2 = train_test_split(features,
labels,
test_size=.25,
random_state=None)
All Playlist of this youtube channel
====================================
1. Data Preprocessing in Machine Learning
2. Confusion Matrix in Machine Learning, ML, AI
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
4. Cross Validation, Sampling, train test split in Machine Learning
5. Drop and Delete Operations in Python Pandas
6. Matrices and Vectors with python
7. Detect Outliers in Machine Learning
8. Time Series preprocessing in Machine Learning
9. Handling Missing Values in Machine Learning
10. Dummy Encoding in Machine Learning
11. Data Visualisation with Python, Seaborn, Matplotlib
12. Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
14. Statistics with Python
15. Sklearn Scikit Learn Machine Learning
16. Python Pandas Dataframe Operations
17. Linear Regression, Supervised Machine Learning
18 Interiew Questions on Machine Learning and Data Science
19. Jupyter Notebook Operations
Комментарии