HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A learning filter is given eight emails that users have labelled…
MediumComputer ScienceHigh School (9–10)Computer Science › Automated and Emerging TechnologiesNumericalIGCSE

A learning filter is given eight emails that users have labelled…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A learning filter is given eight emails that users have labelled. The number is the count of suspicious words in each email.

  • Wanted: 0, 1, 2, 40,\ 1,\ 2,\ 40, 1, 2, 4
  • Unwanted: 3, 5, 6, 83,\ 5,\ 6,\ 83, 5, 6, 8

The filter calls an email unwanted when its count is greater than a whole number TTT, and wanted otherwise.

  1. How many of the eight does it label correctly when T=3T = 3T=3?
  1. It tries every whole number TTT from 000 to 888 and keeps the best. How many does the best TTT label correctly?

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Machine learning is when a program has the ability to automatically adapt its own processes and/or data. It learns from examples (training data). An expert system's rules are written by people; a learning program adapts its own rules and data.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

(a) T=3T = 3T=3.

  • Wanted 0,1,20, 1, 20,1,2 are 333 or less, so they are right. Wanted 444 is more than 333, so it is wrongly called unwanted.
  • Unwanted 5,6,85, 6, 85,6,8 are more than 333, so they are right. Unwanted 333 is not more than 333, so it is wrongly called wanted.

That is 3+3=63 + 3 = 63+3=6 correct.

(b) The best TTT. With T=2T = 2T=2: wanted 0,1,20, 1, 20,1,2 right and unwanted 3,5,6,83, 5, 6, 83,5,6,8 right, so 777. With T=4T = 4T=4: wanted 0,1,2,40, 1, 2, 40,1,2,4 right and unwanted 5,6,85, 6, 85,6,8 right, so again 777. No whole number gets all eight, because the wanted 444 lies above the unwanted 333. The best is 777 correct.

This is learning. The program changed its own process, the value of TTT, by testing it on labelled data.

Answer: (a) 666; (b) 777.

Log in to save this for later
← All Problems
← An email service has a filter that moves unwanted messages into a separate folder…A bank wants software to decide which card payments might be fraud… →
More onComputer Science › Automated and Emerging Technologies

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. A filter calls an email unwanted when its score is greater than its dividing line T…Hard
  2. A bank wants software to decide which card payments might be fraud…Hard
  3. An email service has a filter that moves unwanted messages into a separate folder…Medium
  4. A health centre in a remote area uses an expert system to help a nurse decide whether a patient…Hard
  5. A small expert system for identifying animals has five rules…Hard
All problems on this topic →