Code Monkey home page Code Monkey logo

swiftlearner's Introduction

SwiftLearner: Scala machine learning library

Build Status Join the chat at https://gitter.im/valdanylchuk/swiftlearner Maven Central

Swift Learner

These are some simply written machine learning algorithms. They are easier to follow than the optimized libraries, and easier to tweak if you want to experiment. They use plain Java types and have few or no dependencies. SwiftLearner is easy to fork; you can also copy-paste the individual methods.

Some of the methods are very short, thanks to the elegance of the classic algorithms, and the expressive power of Scala. Some are optimized slightly, just enough to accommodate the test datasets. Those are not idiomatic Scala, closer to CS 101 while loops, which are longer, but perform better. They are still easy to follow.

Use this project as a prototyping library, a cookbook, or a cheat sheet. For high performance and rich features, there are better options. Still, these methods are fully functional and work well for small datasets.

The name comes from Fallout, the greatest game ever. Fallout is a trademark of Bethesda Softworks LLC.

To make one ML enthusiast happy, please star or fork this project ;)

Contents

Examples

Most of the examples I wrote so far are small enough to fit in the tests, so take a look there.

Fisher iris flowers dataset

Iris Virginica flower; credit: Wikimedia Commons

One example is classifying the classic Fisher Iris flower dataset with different algorithms:

The accuracy for backprop and the genetic algorithm goes higher with longer training; these figures are for the quick settings in the automated tests.

Hotel recommendation

Hotel

This is based on Expedia hotel recommendations competition on Kaggle

I have extracted a subset of the fields and data rows to test with NN/Backprop. This is not a full solution, only a small technical demo:

SwiftLearner hotels example

SwiftLearner backprop classifier scales fine to thousands of inputs and millions of examples. The prediction accuracy achieved so far is 0.058, which is nothing spectacular, but certainly an evidence of some learning, compared to a random guess at 0.01.

MNIST handwritten digits

MNIST handwritten digits

Another classic example is classifying the handwritten digits from the MNIST database:

Setup

Add the following line to your build.sbt:

libraryDependencies += "com.danylchuk" %% "swiftlearner" % "0.2.0"

License

This is free software under a BSD-style license. Copyright (c) 2016 Valentyn Danylchuk. See LICENSE for details.

swiftlearner's People

Contributors

gitter-badger avatar valdanylchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

swiftlearner's Issues

Check this out! :)

Just announcing my new hobby project, thought you might be curious:
SwiftLearner Scala machine learning library
Stars/forks are welcome! ;)

It is a weird way to contact you, but also the quickest one for github-related topics, given that everyone today has their own favorite messaging platform.

@vessi @igorshubovych @YuliaSavchuk @NadiaGamula @bekinin @HouzuoGuo @dbo @wpohl @arrowplum @dejo1307 @ianformanek @rpelisse @petterolsson @tgiunipero @lenniboy @mabedan @wknebel @poolh20 @spadgos @matthiaskoester @hajoeichler @jbraeuer @michal-r @markus-meyer @gregorN4 @jpingel @mhuetsch @JensN4 @holkra @BLangendorf @mariofusco @mkonicek @larsxschneider @twittner @akosicki @mkleen @yoosiba @gazdanebojsa @panchenko @dwestheide @romanb @dvorobiov

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.