Skip to content
A basic example of how to implement logistic regression in Swift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Logistic Regression with Swift and fmincg

This is a very simple example of how to implement logistic regression in Swift, using the famous Iris dataset and a conjugate gradient optimizer.

Last updated for Swift 4.2 (Xcode 10.1).

Based on the MATLAB code from Andrew Ng's machine learning course at Coursera.

The included Matrix class is minimal and unoptimized for performance. For a more complete and accelerated version, see here.

For the fmincg license terms, see the comment in fmincg.swift. There rest of the code is licensed under the terms of the MIT license.

You can’t perform that action at this time.