0
0
Agentic AIml~10 mins

Choosing the right framework in Agentic AI - Interactive Code Practice

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

Complete the code to import the popular machine learning framework.

Agentic AI
import [1] as ml
Drag options to blanks, or click blank then click option'
Atensorflow
Bpandas
Cmatplotlib
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Using pandas which is for data manipulation, not ML framework.
Using matplotlib which is for plotting, not ML framework.
2fill in blank
medium

Complete the code to create a simple neural network layer using the framework.

Agentic AI
model = ml.keras.Sequential([ml.keras.layers.Dense([1], activation='relu')])
Drag options to blanks, or click blank then click option'
Aoptimizer
Binput_shape
C64
Dloss
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'input_shape' which is a parameter but not the neuron count.
Using 'optimizer' or 'loss' which are unrelated here.
3fill in blank
hard

Fix the error in the code to compile the model with an optimizer.

Agentic AI
model.compile(optimizer=[1], loss='sparse_categorical_crossentropy')
Drag options to blanks, or click blank then click option'
A'relu'
B'adam'
C'accuracy'
Dadam
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the optimizer name causes errors.
Using 'accuracy' or 'relu' as optimizer which are incorrect.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters features with importance above 0.1.

Agentic AI
important_features = {k: v for k, v in feature_importances.items() if v [1] [2]
Drag options to blanks, or click blank then click option'
A>
B0.1
C<
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' reverses the filter logic.
Using 1 as threshold filters out too many features.
5fill in blank
hard

Fill all three blanks to create a training loop that runs for 5 epochs and prints loss each epoch.

Agentic AI
for epoch in range([1]):
    history = model.fit(X_train, y_train, epochs=1, verbose=0)
    print(f"Epoch { [2] }: Loss = {{history.history['[3]'][0]}}")
Drag options to blanks, or click blank then click option'
A10
Bepoch + 1
Closs
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using 10 epochs instead of 5.
Printing epoch without adding 1 starts from 0.
Using 'accuracy' instead of 'loss' in history key.