Hii Readers, In this post we are going to learn about brain tumor detection using sklearn and python.
- python (https://www.python.org/downloads/)
- sklearn (pip install sklearn)
- openCV (pip install opencv-python)
- numpy (pip install numpy)
- matplotlib (pip install matplotlib)
- Download the code from github
- Download all above mentioned dependencies.
- Open downloaded folder inside jupyter notebook.
- Now cells as per your requirements.
Note: You can find dataset directory inside github repository link (given below) or download dataset from kaggle
In this step, we are going to split data in two parts (training and testing), so that we can train our model on training dataset and test its accuracy on unseen (test) data.
In this step, we are going to use minmax scaling technique to bring all the feature values to less than or equal to 1. In order to do so, we have divided the training data by its maximum value.
As we have done with preprocessing part, it is time to train our model. I am going to train model using SVM (Support Vector Machine) and Logistic Regression algorithms and then we will compare the performance of these two different models.
In this part, we will compare the scores of above two models.
As we can observe, SVM showed a great balance among training an testing score as compared to Logistic Regression. So we can reach to the conclusion that it is ideal model for this particular dataset
In this step we are going to predict test dataset. Afterwards, I have checked the total number of misclassified samples out of total test samples.
Finally, it is the time to examine the results.
So, this is all about creating a predictive model using sklearn on brain tumor dataset. Thanks for reading!