# What is algorithm in AI? Example

What is exactly algorithm in AI? Explain it with an example

An algorithm generally is just set of instructions in easier a pathway to be followed in order to do something .It includes the input of data processing on the it and then the output.For example, in linear regression, it predicts an outcome (like house prices) based on input data (square footage, bedrooms, location) by finding the best-fitting line through training and then making predictions.

A real life example could be making a cup of coffee you input coffee bean water milk then process it the way you like and get a hot cup ready to drink.

So you mean the sequence in which we train the data is algorithm?

Yes, the method by which we train an algorithm is also an algorithm. As the previous reply said, an algorithm is simply a set of instructions for converting the input data into the output data. There are many different algorithms which are used in ML/DL and AI in general. For example, suppose that your goal is to identify whether an image contains a cat or not. There are a number of ways to approach that with ML. Perhaps the simplest is Logistic Regression, which defines a particular algorithm for processing the pixels of the image and converting them to a â€śyes/noâ€ť answer. Then there is another associated algorithm for training the LR model by using Back Propagation. Other algorithms you might consider for that task would be fully connected feed forward networks (covered in DLS Courses 1 and 2) or Convolutional Nets (covered in DLS Course 4). Each of those â€śforwardâ€ť algorithms has a corresponding â€śback propâ€ť algorithm to train the network.

1 Like