Explain the difference between regression and classification
Explain the difference between regression and classification
The solution to the given question is:
Regression and Classification algorithms are supervised learning algorithms. Both algorithms are used for prediction in machine learning and operate on labeled datasets. However , the difference between them lies in the way they are used for different machine learning tasks.
The key difference between regression and classification algorithms is that regression algorithms are used to predict continuous values such as price , salary , age , etc. whereas classification algorithms are used to predict/classify discrete values such as male or female , true or false will be , whether spam or not spam etc.
EXAMPLE
WHICH OF THE FOLLOWING IS A CLASSIFICATION PROBLEM?
- Predicting a person's gender by handwriting
- Predicting house prices by area
- Predicting whether the rainy season will be normal next year
- Predicting next month's album sales
SOLUTION
Predict a person's gender Predict whether next year's rainy season will be normal. The other two are regression. We have discussed classification with a few example in python that uses RandomForestClassifier to perform classification on an iris dataset.
EXAMPLE
WHICH OF THE FOLLOWING IS A REGRESSION TASK?
- Predicting age of a person
- Predicting nationality of a person
- Predicting whether stock price of a company will increase tomorrow
- Predicting whether a document is related to sighting of UFOs?
SOLUTION
Predicting age of a person (because it is a real value , predicting nationality is categorical , whether stock price will increase is discrete-yes/no answer , predicting whether a document is related to UFO is again discrete-a yes/no answer).
Step by step
Solved in 2 steps