9

I'm looking for a library to create Bayes nets and perform learning and inference on them in Scala (or Java, in case of lack of a better solution). The library should be actively maintained, performant, preferably easy, definitely well-documented unless the usage is really straightforward. Free, open-source and commercial alternatives are ok, but for commercial solutions a free trial is required.

An ideal solution would be the equivalent of what in the .NET world is Infer.NET by Microsoft Research, but more documented.

Thanks in advance!

em70
  • 6,088
  • 6
  • 48
  • 80
  • 1
    This might be helpful http://stackoverflow.com/questions/5363855/implement-bayes-net/5364920#5364920 – ŁukaszBachman Feb 02 '12 at 13:11
  • and here is direct link to [weka](http://weka.wikispaces.com/Use+WEKA+in+your+Java+code) (also mentioned in response Łukasz referred you to) – wmz Feb 02 '12 at 13:14
  • @ŁukaszBachman: Thanks, but I've already looked at JavaBayes and found it old and not performant, although quite documented... – em70 Feb 02 '12 at 13:59

5 Answers5

9

FACTORIE is a young project, but it fits the bill and is implemented in Scala:

FACTORIE is a toolkit for deployable probabilistic modeling, implemented as a software library in Scala. It provides its users with a succinct language for creating relational factor graphs, estimating parameters and performing inference.

It's developed by Andrew McCallum and his lab at UMass, who are also responsible for the hugely useful MALLET machine learning toolkit.

Travis Brown
  • 138,631
  • 12
  • 375
  • 680
  • 3
    FACTORIE might be great, but it's not straightforward - at least to me - and the documentation falls very short of the requirement... +1 anyway – em70 Feb 02 '12 at 14:02
  • Does FACTORIE support Bayesian network out of the box? – Erik Kaplun Feb 17 '14 at 20:45
  • I've spent the last 24 hours on FACTORIE and I'm almost ready to run a naivebayes algorithm (I think). I really like the organization _but_ the documentation is _SEVERELY_ lacking, as @em70 mentioned – Ritwik Bose Apr 01 '15 at 19:21
4

You might want to look into SMILE. It is free and has Java API. Other free options in Java are UnBBayes and SamIam.

  • SMILE

    SMILE (Structural Modeling, Inference, and Learning Engine) is a fully portable library of C++ classes implementing graphical decision-theoretic methods, such as Bayesian net-works and influence diagrams, directly amenable to inclusion in intelligent systems.

  • UnBBayes

    UnBBayes is a probabilistic network framework written in Java. It has both a GUI and an API with inference, sampling, learning and evaluation. It supports BN, ID, MSBN, OOBN, HBN, MEBN/PR-OWL, PRM, structure, parameter and incremental learning.

  • SamIam

    Samiam includes two main components: a graphical user interface and a reasoning engine. The graphical interface lets users develop Bayesian network models and save them in a variety of formats. The reasoning engine supports many tasks including: classical inference; parameter estimation; time-space tradeoffs; sensitivity analysis; and explanation-generation based on MAP and MPE.

Pure Scala and free options are FACTORIE (already mentioned) and Figaro. But Figaro currently lacks learning part.

  • Figaro - Probabilistic Modeling

    Figaro models are data structures in the Scala programming language, which is interoperable with Java, and can be constructed, manipulated, and used directly within any Scala or Java program.

Zuul
  • 16,217
  • 6
  • 61
  • 88
1

There is a Scala lib out there by now:

https://github.com/danielkorzekwa/bayes-scala

Elmar Weber
  • 2,683
  • 28
  • 28
1

Perhaps Banjo fits the bill? I'm not sure how actively it is developed, but I know it has been around for at least a few years ... (never used it myself).

Banjo: Bayesian Network Inference with Java Objects

Steve Lianoglou
  • 7,183
  • 2
  • 25
  • 21
1

Some Java alternatives to Infer.NET were presented as answers to this question. So, I think basically you're asking about either a follow up to that question (it was asked during the second half of 2010) with respect to Java or fully Scala-based solution.

Community
  • 1
  • 1
carlosdc
  • 12,022
  • 4
  • 45
  • 62