Skip to content

bkdevart/ML-Playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ML Playground

The purpose of this app is to:

  1. Deploy a ML model to run natively on the iPhone
  2. Provide an intuitive way of interacting with the ML model
  3. Display relationships with the data and machine learning model for both technical and non-technical users

This project contains a random forest classifier that is trained on a sample of data from the well-known Pima Indians Database here. Apple's Core ML tools library is used to translate the Python model to the Core ML format. The iOS app itself is written in Swift, using SwiftUI with the Charts and CoreML libaries.

A more comprehensive article documenting this application can be found here.

img

App Interface

Main screen

img

  • Sliders under the "Choose feature values" section allow for testing model predictions with different values for each feature
  • The charts update to reflect data that nearly matches the user's selections
  • The visible data can be increased by increasing the neighboring data slider

Stats screens

Compare selections

img

  • Compare current selections made on main screen to median, min and max values of sampled data
  • Scroll values on both left and right sides of screen

Compare outcomes

img

  • Compare sampled data's median, min and max values by positive/negative outcome
  • Scroll values on both left and right sides of screen

Swift / Python files

This project makes use of Python to create the model and SwiftUI to interface with it

Updating / deploying model

To make edits to the model and export it in the core ML format, use the notebook file at python_data/feature-importances-ios.ipynb. It will export a file called DiabetesTest.mlmodel that can be imported into the iOS app.

Updating SwiftUI iOS app

Open the ML Slide.xcodeproj using Xcode. Import the updated DiabetesTest.mlmodel file into the project.

Data definitions

  • Pregnacies (preg): Number of pregnancies the patients
  • Body-Mass-Index (BMI) Measured in kg/m^2
  • Glucose level (glu): Plasma glucose concentraion a 2 hours in an orgal glucose tolerance test
  • Blood Pressure (bp): Diastolic blood pressure in mmHg
  • Skin Thickness (skin): Triceps skin fold thicknes in mm
  • Insulin level (insulin): 2-hour serum insulin (micro-U/ml)
  • Diabetes pedigree function (dpfunc)
  • Age: (age) in Years

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors