Building Neural Networks with Weka In Java

Post navigation

Building neural networks models and implementing learning consist of lots of math this might be boring. Herein, some tools help researchers to build network easily. Thus, a researcher who knows the basic concept of neural networks can build a model without applying any math formula.

So, Weka is one of the most common machine learning tool for machine learning studies. It is a java-based API developed by Waikato University, New Zealand. Weka is an acronym for Waikato Environment for Knowledge Analysis. Actually, name of the tool is a funny word play because weka is a bird species endemic to New Zealand. Thus, researchers can introduce an endemic bird to world wide.

As well as weka provides a cute graphic user interface, we will focus on how to build neural network models in our java programs by referencing its library. Thus, machine learning would be directly adapted into the daily business flows.

Normally, weka works on files with .arff extention. File content looks like the following form if standard xor example transformed to arff format. The choice reason of xor dataset is that linear approaches cannot classify this problem successfully.

So, building neural networks with weka is too easy. Moreover, it has a high performance. Although, epoch param is picked up 10K, model is built in seconds. Also, model produces very successful results. Correlation is almost 100% and MAE is almot 0%.

Although, weka is easy to build neural networks models, it is not perfect. Firstly, it supports only back propagation algorithm. For instance, MatLab nntool also supports Levenberg–Marquardt algorithm for learning. Moreover, only sigmoid function is supported as an activation function by Weka. However, activation functionshould be picked up depending on the problem. Furthermore, weights should be initialized randomly. However, Weka initializes weights depending on same procedure. That’s why, classifier always produces same outputs. This might cause to get stuck in a large local minimum. Finally, in weka incremental models can learn using one instance at a time, but neural networks is not incremental. Memory problems might appear in large scale dataset studies. In other words, weka is not applicable for nn-based big data studies.