How to Get Started with Java Machine Learning
What are the best tools to get started with Java machine learning?
They’ve been around for a while, but these days it feels like everyone is talking about artificial intelligence and machine learning. It’s no longer a secret reserved to scientists and researchers, with implementations in nearly any new emerging technology.
In the following post we’ll do a quick overview of the main Java machine learning frameworks, and show how easy it is to get started – without reinventing the wheel and creating your own algorithms from scratch.
AI for the people
AI is a wide and cool field that has been around for a while, but always felt a little bit out of reach and made especially for scientists. If you wanted to create an AI system, you had to implement the core algorithms on your own and train them to identify patterns, understand images and process natural language.
The recent buzz and evolvement around this field made it more accessible for non-researchers. Now you have easy access to the relevant algorithms and tools. You do have to know what you’re doing, but it’s a lot easier to enhance your applications with machine learning capabilities.
Getting the machine going
To make things simpler, we decided to highlight 3 projects to help get you started:
- Deeplearning4J (DL4J) – Open source, distributed and commercial-grade deep-learning library for JVM
- BID Data Project – A collection of patterns that enable fast, large-scale machine learning and data mining
- Neuroph – Object-oriented neural network
By the way, we recently published another list of interesting open source GitHub libraries that caught our attention. Check it out.
1. DL4J – Deep Learning
DL4J is a tool made to assist you in the process of configuring deep neural networks which are made of multiple layers. It brings deep learning to the JVM along with fast prototyping and customization at scale, while focusing on more convention than configuration.
This is the tool for those who already have the theory needed to create and use deep neural networks, but don’t want to actualize the algorithms themselves. You can use it to solve specific problems involving massive amounts of data and customize the neural net properties.
DL4J is written in Java, which makes it compatible with any JVM language such as Clojure, Scala or Kotlin, and it integrates with Hadoop and Spark.
Possible use cases include rating or recommendation systems (CRM, adtech, churn prevention), predictive analytics or even fraud detection. If you’re looking for a real-world example, you can check out Rapidminer. It’s an open-source data platform that uses DL4J to streamline predictive analytics processes for their users.
Setting up a new neural network is as easy as creating a new object:
ultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() .iterations(1) .weightInit(WeightInit.XAVIER) .activation("relu") .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT) .learningRate(0.05) // ... other hyperparameters .backprop(true) .build();
2. BID Data Project
The BID Data Project is made for those of you who deal with a great amount of data, and are performance sensitive. This UC Berkeley project is a collection of hardware, software and design patterns that enable fast and large-scale data mining.
The first library is BIDMach, that holds the records for many common machine learning problems, on single nodes or clusters. You can use it to manage data sources, optimize and distribute data over CPUs or GPUs.
It includes many popular machine learning algorithms, and the team is working on developing distributed Deep Learning networks, graph algorithms and other models.
The other 2 libraries are BIDMat, a fast matrix algebra library that focuses on data mining and BIDParse, GPU-accelerated natural language parser. Other libraries in this project include visualization tools, along with libraries that will let you run on Spark or even on Android.
BIDMach benchmarks repeatedly show better results than other solutions, even with a single machine compared to alternatives running on larger clusters. A full list of benchmarks can be found right here.
3. Neuroph
Neuroph is a lightweight Java framework used to develop common neural network architectures. The framework provides a Java library along with a GUI tool (called easyNeurons), and you can use it in order to create and train your very own neural networks in Java programs.
It contains an open source Java library, with a small number of basic classes which correspond to essential neural network concepts. It’s a great stepping stone if you’re just getting started with neural networks, or if you want to know how they work.
You can try out Neuroph online demo and see how it actually works. Spoiler alert: the interface looks old and outdated, but you can create nice things with it. Also, it received the Duke’s Choice Award for 2013.
What About the Others?
In case these 3 projects are not your cup of tea and you’re looking for something a little different for your project, don’t worry. If you search GitHub for “Machine learning” you’ll find 1,506 Java repositories that might give you the right tool.
For example, an interesting project from Airbnb is aerosolve; A machine learning library designed to be human friendly.
Getting started with a new technology is always a source for trouble. If you will need some help with your exceptions, be sure to check out Takipi’s error analysis tool.
Final Thoughts
Every few years there’s a new buzz around AI. This time around, it came with reinforcement in the form of machine learning, data mining, neural networks and so on and we’re all for it. The fact that these libraries are open sourced means that information and abilities are up for grabs, and all you have to do is think what can be done with this power.
If you know other interesting projects or think we missed anything, we would love to hear about it in the comments below.
Reference: | How to Get Started with Java Machine Learning from our JCG partner Henn Idan at the Takipi blog. |