Naive Bayes with Weka

If you are interested in Machine Learning in the JVM you should not forget about the good old Weka. It has basically been desinged to be used by a Swing GUI but it can also be used as an API. In terms of documentation I can recommend this manual and the javadoc. In my Demo I use the NaiveBayesMultinomial classifier with the iris dataset that is directly loaded from the Internet. The Jupyter notebook can Read more…

Exchanging Data between MLlib, DL4J and Shogun

Each machine learning framework has its own basic data model and it is part of the ‘data preparation’ to convert the existing data to the required input format of the specific framework. Most of these frameworks also provide a direct access to some predefined data-sets (e.g iris, mnist etc) I tried to do a quick overview on how to exchange the data between the following frameworks DeepLearning for Java (DL4J) Scala MLlib Shogun so that Read more…

Random Forrest Classifier in Spark ML

MLlib is Spark’s machine learning (ML) library. It’s goal is to make practical machine learning scalable and easy. I tried to make a complete step by step classification example using the Iris flower data set  using the BeakerX Jupyter kernel which covers the following steps Setup Data Preparation Testing and Prediction Validation The example is written in Scala but you could use any other language which is supported by the JVM. My example can be found the this GIST Read more…

Using Shogun in the JVM

Shogun is and open-source machine learning library that offers a wide range of efficient and unified machine learning methods. It is implemented in C++ and provides the necessary java integration so that it can be used in any language which is based on the JVM: – Java – Scala – Groovy – Kotlin – etc I tried to make Shogun easier to use in a JVM environment. The documentation how to use Shogun e.g. in Read more…

Deeplearning4j – Recurrent Neural Networks (RNN)

A recurrent neural network (RNN) is a class of artificial neural network where connections between nodes form a directed graph along a sequence. This allows it to exhibit temporal dynamic behavior for a time sequence. Unlike feedforward neural networks, RNNs can use their internal state (memory) to process sequences of inputs. I am showing a basic implementation of a RNN in DL4J. Further information can be found at https://deeplearning4j.org/docs/latest/deeplearning4j-nn-recurrent. This demo has been implemented in Read more…

Deeplearning4j – Iris Classification Example

I am a big fan of Keras – Fortunately we also have a similar framework available when we need to implement a solution which works in the JVM: DeepLearning4J. In this Blog I give a quick introduction of some of the key concepts which are needed to get started. I am using the Iris dataset to demonstrate the classification of data with the help of a neural network. This demo has been implemented in Scala Read more…

Investor – Automatic Trading with E-Trade

Hurray – Today I finally managed to finish the implementation of the integration into E-Trade. Unfortunately it turned out to be a little bit more complicated then initially thought and there were quite a few stumbling blocks around the topic of “authentication”. I have aleady demonstrated how to do trading with actual data. In this document I want to show how to do automatic trading with E-Trade. Information on how to request to access E-Trade Read more…

Investor – A Polyglot Framework

Because Investor has been implemented in Java and is available as jars from a Maven repository we can easily use the framework in all languages which are based on the the JVM. Here is a quick demo using Jupyter Lab (using Beakerx) with: – Scala – Java – Groovy – Kotlin – Clojure Here is a screen shot of Jupyter Lab: Scala Scala combines object-oriented and functional programming in one concise, high-level language. Scala’s static Read more…

Investor – Running an Automatic Trading Bot

So far we have looked at the trading simulation functionality which was using the historic stock data to evaluate strategies on a single stock or a portfolio of stocks. In this document we want to demonstrate how to do trading with actual data. We still use the PaperTrader to demonstrate the basic logic Setup We add the necessary jars and import all relevant packages: %classpath config resolver maven-public https://software.pschatzmann.ch/repository/maven-public/ %%classpath add mvn ch.pschatzmann:investor:0.9-SNAPSHOT ch.pschatzmann:jupyter-jdk-extensions:0.0.1-SNAPSHOT Added Read more…

Investor and Edgar

In this document we demonstrate how to use the Edgar Database for the selection of the stocks into a portfilio with the help of the Investor library. This functionality is using the Edgar Webservice which is based on the data which is available on https://www.sec.gov/edgar.shtml. Setup We add the necessary jars and import the related packages. %classpath config resolver maven-public http://software.pschatzmann.ch/repository/maven-public/ %classpath add mvn ch.pschatzmann:investor:0.9-SNAPSHOT %classpath add mvn ch.pschatzmann:jupyter-jdk-extensions:0.0.1-SNAPSHOT // our stock evaluation framwork import Read more…