In Machine Learning one of the main task is to model the data and predict the output using various Classification and Regression Algorithms. But since there are so many Algorithms, it is really difficult to choose the one for predicting the final data. So we need to compare our models and choose the one with the highest accuracy.
Using the sklearn library we can find out the scores of our ML Model and thus choose the algorithm with a higher score to predict our output. Another good way is to calculate errors such as mean absolute error and mean squared error and try to minimize them to better our models.
Mean Absolute Error(MAE): It is the mean of all absolute error
Mean Squared Error (MSE) It is the mean of square of all errors.
Here, we are using Titanic dataset as our input for Classification problem and modelling our data with Logistic Regression and KNN only. Although, you can also model with other algorithms. You can find the dataset here
We can now see the score and error of our models and compare them. Score of Logistic Regression is greater then KNN and error is also less. Thus, Logistic Regression will be the right choice for our model.
- ML | Mathematical explanation of RMSE and R-squared error
- Exposing ML/DL Models as REST APIs
- ML | Dummy variable trap in Regression Models
- NLP | How to score words with Execnet and Redis
- ML | Log Loss and Mean Squared Error
- ML | Fowlkes-Mallows Score
- Selective Search for Object Detection | R-CNN
- Introduction to Ontologies
- Machine Learning and Data Science
- How Machine Learning Will Change the World?
- Machine Learning Role in Business Growth and Development
- Introduction to Predictive Maintenance
- Difference between Parametric and Non-Parametric Methods
- Upper Confidence Bound Algorithm in Reinforcement Learning
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.