Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 1) on the
MobilePriceDataset, which has 20 features and one label price_range(as category range
between 0 to 3). Your task is:
(1)Simply use the same steps in the previous part to implement ANN.
(2)Note that:
a. After reading the dataset you need to change dataframe to numpy by using this code:
#Changing pandas dataframe to numpy array
X_data = data.iloc[:,:20].values
y = data.iloc[:,20:21].values
b. You need to split the dataset into 80% train set and 20% test set.
c. To normalize the data, you can use this method:
#Normalizing the data
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.fit_transform(X_test)
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.add(keras.layers.Dense(16, input_shape=(20,), activation='sigmoid'))
model.add(keras.layers.Dense(12, activation='sigmoid'))
model.add(keras.layers.Dense(4, activation='softmax'))
f. When you train the model change the number of epochs to be any number of your
choice between 100 and 120.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions