0
0
Agentic AIml~10 mins

Measuring agent accuracy and relevance 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 calculate the accuracy of an agent's predictions.

Agentic AI
accuracy = correct_predictions / [1]
Drag options to blanks, or click blank then click option'
Awrong_predictions
Btotal_agents
Ctotal_predictions
Dcorrect_predictions
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing by wrong_predictions instead of total_predictions.
Using correct_predictions twice in the formula.
2fill in blank
medium

Complete the code to compute the relevance score using cosine similarity.

Agentic AI
relevance_score = cosine_similarity(agent_vector, [1])
Drag options to blanks, or click blank then click option'
Aquery_vector
Brandom_vector
Cagent_vector
Dnoise_vector
Attempts:
3 left
💡 Hint
Common Mistakes
Comparing the agent vector to itself instead of the query vector.
Using a random or noise vector which does not relate to the query.
3fill in blank
hard

Fix the error in the code that calculates F1 score from precision and recall.

Agentic AI
f1_score = 2 * (precision * recall) / [1]
Drag options to blanks, or click blank then click option'
Aprecision + recall
Bprecision - recall
Cprecision * recall
Dprecision / recall
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication in the denominator instead of addition.
Dividing precision by recall instead of adding them.
4fill in blank
hard

Fill both blanks to create a dictionary of agent accuracies for agents with accuracy above 0.8.

Agentic AI
accuracies = {agent: [1] for agent, [2] in results.items() if accuracy > 0.8}
Drag options to blanks, or click blank then click option'
Aaccuracy
Bscore
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name other than accuracy in the loop unpacking.
Not using accuracy as the dictionary value.
5fill in blank
hard

Fill all three blanks to filter agents with relevance above 0.7 and create a summary dictionary.

Agentic AI
summary = {agent: [1] for agent, [2] in agent_results.items() if [3] > 0.7}
Drag options to blanks, or click blank then click option'
Arelevance
Daccuracy
Attempts:
3 left
💡 Hint
Common Mistakes
Using accuracy instead of relevance in any blank.
Using different variable names inconsistently.