Regression
When the output variable has a continuous value, regression will be used. A few examples are predicting the temperature, stock prices, property prices, or any other numerical number. Regression involves training a model to predict a target variable that has a real value of any kind.
Classification
On the other hand, when the output variable is a category or label, we will use a classification. Examples - include sentiment analysis (positive or negative), image recognition (dog or cat), and spam or not. The model is trained to classify input data into one of several predetermined groups when it comes to classification.