Python for Machine Learning | Preprocessing | fit, transform and fit_transform
Table of content:
00:17 Import pandas library and the dataset
00:34 Get the Null value counts using dataframe df.isnull().sum()
00:46 Check the Null value by expanding dataframe df in the variable explorer
01:07 Import Imputer and create the object of Imputer()
01:15 Imputer object is created with different parameter like missing_value'NaN' and strategy='mean'
02:13 Fit the Imputer object created with Age and Salary column and execute it
02:36 imputer.statistics_
03:22 imputer.transform to be applied on Age and Salary column
03:58 Save imputer.transform to some variable
04:14 How to apply imputer's fit and transform in a single step
04:42 What is Label Encoding and How fit, transform and fit_transform works separately
04:52 Import LabelEncoder and create its object
05:15 Apply Label Encoding on the country column
05:37 Fit LabelEncoder object with country column
05:54 After fitting LabelEncoder object how to get the unique classes using encoder.classes_
06:01 Transform LabelEncoder object to get the numeric value assigned to each country
06:31 Use LabelEncoder's fit_transform on the country column
07:12 Apply fit, transform and fit_transform on standardscaler
07:32 Import numpy and create an array
07:40 import StandardScaler from sklearn.preprocessing
07:50 Create an object of StandardScaler
08:13 Scale the dataset using fit_transform
08:23 Formula to calculate StandardScaler
09:00 Get the mean using standardscaler object standardscaler.mean
09:34 Get the variance using standardscaler object standardscaler.variance_
09:52 How to calculate the standard deviation of each column
10:37 Apply fit on standardscaler object
11:16 Apply transform on standardscaler object
Topic to be covered -
How fit(), transform() and fit_transform() works ?
OR
Difference between fit(), transform() and fit_transform()
Code Starts Here
==============
import pandas as pd
from sklearn.preprocessing import Imputer, LabelEncoder
df = pd.read_csv('Datapreprocessing.csv')
imputer = Imputer(missing_values='NaN',strategy='mean',axis=0)
imputer.fit(df[['Age','Salary']])
X = imputer.transform(df[['Age','Salary']])
imputer.fit_transform(df[['Age','Salary']])
encode = LabelEncoder()
encode.fit(df['Country'])
encode.transform(df['Country'])
encode.fit_transform(df['Country'])
import numpy as np
from sklearn.preprocessing import StandardScaler
x1 = np.array([[1,2,3],
[4,5,6],
[7,8,9]])
standscaler = StandardScaler()
x_scaler = standscaler.fit_transform(x1)
print(x_scaler)
(Xi - Xmean) / (standard Deviation of that feature)
standscaler.fit(x1)
standscaler.transform(x1)
All the playlist of this youtube channel
========================================
1. Data Preprocessing in Machine Learning
• Data Preprocessing in Machine Learning| Li...
2. Confusion Matrix in Machine Learning, ML, AI
• Confusion Matrix in Machine Learning, ML, AI
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
• Anaconda | Python Installation | Spyder | ...
4. Cross Validation, Sampling, train test split in Machine Learning
• Cross Validation | Sampling | train test s...
5. Drop and Delete Operations in Python Pandas
• Drop and Delete Operations in Python Pandas
6. Matrices and Vectors with python
• Matrices and Vectors with python
7. Detect Outliers in Machine Learning
• Detect Outliers in Machine Learning
8. TimeSeries preprocessing in Machine Learning
• TimeSeries preprocessing in Machine Learning
9. Handling Missing Values in Machine Learning
• Handling Missing Values in Machine Learning
10. Dummy Encoding Encoding in Machine Learning
• Label Encoding, One hot Encoding, Dummy En...
11. Data Visualisation with Python, Seaborn, Matplotlib
• Data Visualisation with Python, Matplotlib...
12. Feature Scaling in Machine Learning
• Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
• Python | Python 3 Basics | Python for Begi...
14. Statistics with Python
• Statistics with Python
15. Data Preprocessing in Machine Learning
• Data Preprocessing in Machine Learning| Li...
16. Sklearn Scikit Learn Machine Learning
• Sklearn Scikit Learn Machine Learning
17. Linear Regression, Supervised Machine Learning
• Linear Regression | Supervised Machine Lea...
Auf dieser Seite können Sie das Online-Video Python for Machine Learning | Preprocessing | fit, transform and fit_transform mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer technologyCult 04 August 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 15,753 Mal angesehen und es wurde von 193 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!