Professional Documents
Culture Documents
PAI Practicle
PAI Practicle
NAME: Shivam
BRANCH: CSE(AI-ML)
SEM: 6TH
ROLL NO: 23242
Shivam (23242)
Department of CSE AIML
Certificate
Certified that this Practical entitled “Big Data Lab” submitted by Shivam (23242), student
of Computer Science & Engineering Department, Dronacharya College of
Engineering, Gurgaon in the partial fulfillment of the requirement for the award
Bachelor’s of Technology (Branch) Degree of MDU, Rohtak, is a record of student own
study carried under my supervision & guidance.
Shivam (23242)
Sr. Practical Name Signature
No.
1. Introduction of various python libraries used for
machine
learning.
2. Write a program to perform data pre-processing
techniques for effective machine learning.
3. Write a program to apply different feature encoding
schemes on the given dataset.
5.
6.
7.
8.
9.
10.
Shivam (23242)
PROGRAM 1: Introduction of various python libraries used for machine learning.
Code:
[3]: data
df = pd.DataFrame(student_data) df
Shivam (23242)
[7]: df.iloc[2,0]
[7] : 'Geetanshu'
[]:
Shivam (23242)
[1]:# import pandas
import pandas as pd
Shivam (23242)
[59]: # assign 10 in place of null value df["Age"].fillna(10, inplace = True) df["Salary"].fillna(10, inplace =
True)
df
[34]: Country 0
Age 0
Salary 0
Purchased 0
dtype: int64
Shivam(23242)
PROGRAM 3: Write a program to apply different feature encoding schemes on the given dataset.
[57]: #df.describe()
[42]: # import and apply LabelEncoder to the data from sklearn.preprocessing import
LabelEncoder df_le= df
class_le = LabelEncoder()
df_le['Country'] = class_le.fit_transform(df_le['Country'].values) df_le
[48]: df
Shivam(23242)
2 Germany 30.0 54000.0 No
3 Spain 38.0 61000.0 No
4 Germany 40.0 NaN Yes
5 France 35.0 58000.0 Yes
6 Spain NaN 52000.0 No
7 France 48.0 79000.0 Yes
8 Germany 50.0 83000.0 No
9 France 37.0 67000.0 Yes
[61]: df_new=pd.get_dummies(df)
[62]: df_new
Purchased_No Purchased_Yes
0 1 0
1 0 1
2 1 0
3 1 0
4 0 1
5 0 1
6 1 0
7 0 1
8 1 0
9 0 1
[63]: df_le['Country']
[63]: 0 0
1 2
2 1
3 2
4 1
5 0
Shivam(23242)
6 2
Shivam(23242)
7 0
8 1
9 0
Shivam(23242)
PROGRAM 4: Write a program to apply filter feature selection techniques.
Shivam(23242)
Shivam(23242)
Shivam(23242)
Shivam(23242)