A Swift package for decision tree classification
Branch: master
Clone or download
Latest commit fe13592 Feb 16, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sources/TreeKit Naive Bayes Feb 15, 2019
Tests Naive Bayes Feb 15, 2019
TreeKit.xcodeproj Naive Bayes Feb 15, 2019
docs Naive Bayes Feb 15, 2019
.gitignore Test coverage Feb 2, 2019
.travis.yml Testing Feb 2, 2019
LICENSE.txt First check in Jan 28, 2019
Package.resolved Naive Bayes Feb 15, 2019
Package.swift Refactoring Feb 11, 2019
README.md Refactoring Feb 11, 2019



Build Status codecov Codacy Badge

TreeKit is a Swift package for classification problems, primarily drawing on decision tree based machine learning algorithms. It builds on DataKit.


Install using the Swift package manager by adding a dependency in a project Package.swift file:

dependencies: [
    // Dependencies declare other packages that this package depends on.
    // .package(url: /* package url */, from: "1.0.0"),
    .package(url: "https://github.com/PeetV/DataKit.git", from: "0.3.0"),
    .package(url: "https://github.com/PeetV/TreeKit.git", from: "0.2.0"),
targets: [
    // Targets are the basic building blocks of a package. A target can define a
    // module or a test suite.
    // Targets can depend on other targets in this package, and on products in
    // packages which this package depends on.
        name: ...,
        dependencies: ["DataKit", "TreeKit"]),


See the docs folder for interactive examples in playgrounds that can be run using Xcode or see the Contents.swift file in the playground folder.

Playground Description
Overview.playground General overview of the TreeKit API.
ClassifierZoo.playground Examples of applying TreeKit classification models to different datasets.


  • 0.1 Single binary classification tree
  • 0.2 Ensemble of classification trees
  • 0.3 Naive Bayes classifier
  • 0.4 Regression trees
  • 0.5 Boosting