Loading…
Glossary term
A step-by-step procedure for solving a problem or performing a computation.
An algorithm is a precise sequence of steps for solving a problem. A recipe is an everyday example: follow the steps in order and you get the result.
In AI, a learning algorithm is the procedure that adjusts a model from data, while the model itself is what the algorithm produces.
A classic algorithm: find the largest number
def largest(numbers):
best = numbers[0]
for n in numbers[1:]:
if n > best:
best = n
return best
print(largest([3, 9, 4])) # 9Knowing the difference between an algorithm (the procedure) and a model (the result of training) clears up a lot of confusion in AI news.