To read the given data and perform Feature Generation process and save the data to a file.
Feature Generation (also known as feature construction, feature extraction or feature engineering) is the process of transforming features into new features that better relate to the target.
Read the given Data
Clean the Data Set using Data Cleaning Process
Apply Feature Generation techniques to all the feature of the data set
Save the data to the file
import pandas as pd
df = pd.read_csv("Encoding Data.csv")
df
from sklearn.preprocessing import LabelEncoder, OrdinalEncoder
data = ["Red","Green","Blue"]
set = OrdinalEncoder(categories = [data])
set.fit_transform(df[["nom_0"]])
df["nom_1"] = set.fit_transform(df[["nom_0"]])
df
data = ["Cold","Warm","Hot"]
st = OrdinalEncoder(categories = [data])
st.fit_transform(df[["ord_2"]])
df["ord_1"] = st.fit_transform(df[["ord_2"]])
df
le = LabelEncoder()
df["sty"]=le.fit_transform(df[["ord_2"]])
df
pd.get_dummies(df,columns=["nom_0"])
df = pd.read_csv("data.csv")
from sklearn.preprocessing import LabelEncoder, OrdinalEncoder
data = ["Cold","Warm","Hot","Very Hot"]
set = OrdinalEncoder(categories = [data])
set.fit_transform(df[["Ord_1"]])
df["nom_1"] = set.fit_transform(df[["Ord_1"]])
df
pd.get_dummies(df,columns=["Ord_1"])
Thus, the given data is read and Feature Generation process is successfully performed and the data is successfully saved to a file.