Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 1.75 KB

README.md

File metadata and controls

47 lines (40 loc) · 1.75 KB

ft_linear_regression

It is the simple iOS application for training linear regression with gradient descent optimization algorithm. You can change parameters to see how do they affect learning.

Tested with:

  • macOS Catalina - 10.15.5 Beta
  • Xcode - 11.4.1
  • iPhone 8
  • iOS - 13.3.1

Get started:

git clone https://github.com/Gleonett/ft_linear_regression.git
cd ft_linear_regression
git submodule update --init --recursive
  1. Open ft_linear_regression/ft_linear_regression.xcodeproj
  2. Drag the Charts/Charts.xcodeproj to the project
  3. Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
  4. Build and run

Explanation

Main view

Main_view

Main view contains visualization for model, dataset and buttons:

  • Parameters - Link to Parameters view
  • Reset - Reset already trained linear regression model parameters
  • Train - Train model
  • Predict - Link to Prediction view

Parameters view

Parameters_view

Learning rate is a tuning parameter in an optimization algorithm that determines the step size at each iteration while moving toward a minimum of a loss function

learningRate = initinalLearningRate / (decay * currentEpoch + 1)

Model will train either until the end of epochs or until:

abs(InterceptN - InterceptN-1) < AccuracyThreshold
and
abs(BiasN - BiasN-1) < AccuracyThreshold

Prediction view

Prediction_view

regressor is the value we want to predict the dependent