0
0
Agentic AIml~10 mins

Intermediate result handling 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 store the intermediate result in a variable.

Agentic AI
intermediate_result = model.predict([1])
Drag options to blanks, or click blank then click option'
Atest_data
Boutput_data
Cinput_data
Dtrain_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using output_data instead of input_data
Passing train_data instead of input_data
2fill in blank
medium

Complete the code to calculate the accuracy of the model predictions.

Agentic AI
accuracy = accuracy_score([1], predictions)
Drag options to blanks, or click blank then click option'
Atest_data
Bpredictions
Cinput_data
Dtrue_labels
Attempts:
3 left
💡 Hint
Common Mistakes
Using predictions as both arguments
Using input_data instead of true_labels
3fill in blank
hard

Fix the error in the code to correctly update the intermediate result.

Agentic AI
intermediate_result = intermediate_result [1] new_data
Drag options to blanks, or click blank then click option'
A+
B*
C-
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of addition
Using subtraction which changes the result incorrectly
4fill in blank
hard

Fill both blanks to filter and transform intermediate results correctly.

Agentic AI
filtered_results = [x[1]2 for x in results if x [2] 5]
Drag options to blanks, or click blank then click option'
A**
B%
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using modulus operator instead of power
Filtering with less than instead of greater than
5fill in blank
hard

Fill all three blanks to create a dictionary of filtered intermediate results.

Agentic AI
result_dict = { [1]: [2] for [3] in data if [2] > 0 }
Drag options to blanks, or click blank then click option'
Ak
Bv
Ck, v
Attempts:
3 left
💡 Hint
Common Mistakes
Using tuple unpacking incorrectly
Using the same variable for key and value