Code Monkey home page Code Monkey logo

mlmodel's Introduction

mlmodel

Supervised Learning Model test

Logistic Regression and RandomForestClassifier Model for Diabetes Prediction

This repository contains a simple implementation of a logistic regression and RandomForestClassifier model for predicting diabetes based on various features. The model is trained on a dataset containing information related to diabetes symptoms.

Dataset

The dataset used for training the model includes the following features:

['Age', 'Gender', 'Polyuria', 'Polydipsia', 'sudden weight loss', 'weakness', 'Polyphagia', 'Genital thrush', 'visual blurring', 'Itching', 'Irritability', 'delayed healing', 'partial paresis', 'muscle stiffness', 'Alopecia', 'Obesity', 'class']

The target variable is the 'class', indicating the presence or absence of diabetes.

I started by training the RandomForestClassifier model on the data based on the available features. A classification report and confusion matrix was done. The result was this:

image

I now used feature importance to select the best features and trained another RandomForestClassifier Model on the data now based on the selected features (these features were selected on a threshold of >0.05). A classification report and confusion matrix was done on it, below is the result:

image

The next method i implemented was SelectFromModel. I used this on the data set and RandomForestClassifier. SelectFromModel is used to automatically select features based on their importance scores with a specified threshold. A classification report, the features selected and confusion matrix was done. Below is the result:

image

image

These same processes were done with LogisticRegression

The complete analysis can be found in the notebook in this repository

mlmodel's People

Contributors

chukwuebuka-2003 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.