0
0
ML Pythonml~10 mins

Why deep learning handles complex patterns in ML Python - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a deep learning model with multiple layers.

ML Python
model = Sequential()
model.add(Dense(64, activation=[1], input_shape=(100,)))
Drag options to blanks, or click blank then click option'
Asigmoid
Brelu
Clinear
Dsoftmax
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'linear' activation which does not add non-linearity.
2fill in blank
medium

Complete the code to add a second hidden layer to the model.

ML Python
model.add(Dense(32, activation=[1]))
Drag options to blanks, or click blank then click option'
Arelu
Bsoftmax
Csigmoid
Dlinear
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'softmax' activation in hidden layers.
3fill in blank
hard

Fix the error in the code to compile the model with the correct loss function for classification.

ML Python
model.compile(optimizer='adam', loss=[1], metrics=['accuracy'])
Drag options to blanks, or click blank then click option'
Amean_absolute_error
Bhinge
Ccategorical_crossentropy
Dmse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'mse' which is for regression tasks.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each word to its length if the length is greater than 3.

ML Python
{word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as value instead of its length.
Using '<' instead of '>' in the condition.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase words to their counts if count is greater than zero.

ML Python
result = [1]: [2] for word, count in word_counts.items() if count [3] 0}
Drag options to blanks, or click blank then click option'
Aword.upper()
Bcount
C>
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'word' instead of 'word.upper()' for keys.
Using '<' instead of '>' in the condition.