Question: In this part, you need to apply a simple ANN model ( same as in part 1 ) on the MobilePriceDataset , which has 2
In this part, you need to apply a simple ANN model same as in part on the
MobilePriceDataset which has features and one label pricerangeas category range
between to Your task is:
Simply use the same steps in the previous part to implement ANN.
Note that:
a After reading the dataset you need to change dataframe to numpy by using this code:
#Changing pandas dataframe to numpy array
Xdata data.iloc::values
y data.iloc::values
b You need to split the dataset into train set and test set.
c To normalize the data, you can use this method:
#Normalizing the data
from sklearn.preprocessing import StandardScaler
sc StandardScaler
Xtrain scfittransformXtrain
Xtest scfittransformXtest
d No need to flatten the data because it is already in one dimensional shape.
e Define the ANN model with this setting:
model keras.Sequential
model.addkeraslayers.Dense inputshape activation'sigmoid'
model.addkeraslayers.Dense activation'sigmoid'
model.addkeraslayers.Dense activation'softmax'
f When you train the model change the number of epochs to be any number of your
choice between and
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
