Giter Club home page Giter Club logo

brain-tumor-detection's Introduction

brain tumor detection using python and sklearn

Hii Readers, In this post we are going to learn about brain tumor detection using sklearn and python.

Requirements:

  • python (https://www.python.org/downloads/)
  • sklearn (pip install sklearn)
  • openCV (pip install opencv-python)
  • numpy (pip install numpy)
  • matplotlib (pip install matplotlib)

DOWNLOAD CODE :

  1. Download the code from github
  2. Download all above mentioned dependencies.
  3. Open downloaded folder inside jupyter notebook.
  4. Now cells as per your requirements.

STEP 1: Load Dependencies

STEP 2: Load and prepare data

Note: You can find dataset directory inside github repository link (given below) or download dataset from kaggle

STEP 3: Data Analysis

STEP 4: Data Visualization

STEP 5: Split Data

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.

STEP 6: Feature Scaling

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.

STEP 7: Model Training

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.

STEP 8: Evaluation

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

STEP 9: Prediction

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.

STEP 10: TESTING (On test dataset)

Finally, it is the time to examine the results.

OUTPUT

So, this is all about creating a predictive model using sklearn on brain tumor dataset. Thanks for reading!

brain-tumor-detection's People

Contributors

akd6203 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.