Bayesian networks in Scala [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
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!

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.

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.

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

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.

There is a Scala lib out there by now:
https://github.com/danielkorzekwa/bayes-scala

Related

Is there any statistical library for javascript? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need to implement some statistical tests like: T-test, Anova and Wilcoxon on javascript.
Similar to Java's - Apache Commons Math Library, is there any statistical tests library or codes for javascript?
jStat : a JavaScript statistical library
https://github.com/jstat/jstat
OpenEpi is a Javascript stats library, is open source, and has ANOVA and t-tests. I've not tried it (it's a bit too focused on epidemiology for my needs) but it might be useful.
jStat is a javascript statistical library project, and it looks like it's got a great future, but it might not have all you need right now. Edit: as of Dec 2012 it looks like the jStat project page is no longer maintained but the project is continuing to be developed. There's more up to date documentation on github. It now does have anova tests and varieties of t-test. No sign of Wilcoxon signed-rank though.
If you need very specific statistical processing in javascript urgently, you might have most success by browsing Omegahat who have various little tools that bridge the established stats language R with others including javascript.
It'll depend on the details of exactly what you want to do, but you might have some success with packages such as RJavascript - a code translator which aims to help turn existing R features into Javascript (just don't expect quality results first time). Also, SpiderMonkey builds on R for browsers, so it might be useful for internal or personal uses (but it's unlikely to be suitable for public publishing).
Some years ago I ported https://code.google.com/p/statistics-distributions-js/ so that I could use it in http://elem.com/~btilly/effective-ab-testing/ - it may have the functionality you need if you only need simple things.
If you're looking for a simple library for descriptive statistics, you could use javascriptstats.com
It does:
Mean
Median
Mode
Range
Variance
Standard Deviation
Best!
Leveraging a related answer:
The following blog post lists some recent packages: http://jgoodall.me/posts/2012/02/01/javascript-statistical-libraries/
As mentioned by others, native JS is a far cry from R, which web-wise has progressed from RApache (http://rapache.net/) to shiny (http://www.rstudio.com/shiny/). The latter uses node.js server-side, so this is quite promising. Of course both approaches will require you to code stats in R server-side, instead of using JS either on client or server.
Marc

Double-entry accounting libraries for Java? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
What double-entry accounting libraries are available for Java?
I did write a library for myself, but since it was for a really trivial application, I don't know if it would suit a general purpose accounting need.
It has an interface like:
ledger.newPosting(new Date(), "Received $10 from Anne")
.debit("Cash:Anne", 1000)
.credit("Dues Received", 1000)
.post();
int cashBalance = ledger.getAccount("Cash").getTrialBalance();
assertEquals(-1000, cashBalance);
int anneBalance = ledger.getAccount("Cash:Anne").getTrialBalance();
assertEquals(-1000, anneBalance);
int duesBalance = ledger.getAccount("Dues Received").getTrialBalance();
assertEquals(1000, duesBalance);
Is this the kind of thing you're looking for? Anyone else actually INTERESTED in this code? I wrote it generically, but never published it because I didn't think anyone would want something this trivial.
There's a Swedish project called fribok.org (free (as in GNU free) accounting). It's an application too, but might be componentized and contain what you look for (given that GPL is a viable option for you).
I've seen JMoney used with custom plug-ins. What are you trying to do?
Well, I am not aware of any such libraries. Personally me thinks that double entry accounting framework would boil down to couple of interfaces and minimal code to ensure equation invariants. Hence no libs for that: try to bite a relevant code snippet from JMoney or something like that...
;)
How about jLedger - Java Business Accounting API?
Citing the project's home page: "This is a Java Business Accounting API that consist of invoicing, general ledger, stock/inventory control and other business API that will assist java developer to build a business software with ease."
Note, however, that this project releases the software under the GNU GPL v2 license, not the Apache license that's usually associated with Java-related projects.
GNU GPL is a copyleft license and libraries licensed under it may not be appropriate for internally developed or commercial software.
There is this more recent implementation using JTA and Spring. As it states:
The Double-entry bookkeeping concept implemented with Spring 4, the
Java Transaction API and the H2 database in embedded mode
The best I have seen is a jPos module called minigl which is part of jpos-ee., The jPOS framework is used widely in many production grade deployments. I have personally used in at scale on some high-profile projects.
You will need to get up to speed on jpos-ee, a very solid java framework for all things payment and fintech related. It is worth the learning curve as if you are asking about ledgers you are probably going to have other needs which are likely already addressed in the jPos codebase.
I just wrote a java library for accounting. The beauty of my library is that it uses a 4GL to do the credits, debits and ledgers. You can also import other functions to handle inventory, payroll and things like that. Fetal Libraries

High-End 2D Java (SE) Graphics Library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking for a high-end graphics library for Java Standard Edition. I know some fairly low-level libraries: AWT/Swing, JOGL, SDL. Are/is there an alternative?
My requirements are (atleast):
Anti-aliased
Fullscreen support
Alpha channel
Blend modes and Z-depth
Rasterized Effects: (motion) blur, glow, gloom, etc.
And, optionally:
Hardware acceleration
Vector graphics (scale/rotate/translate in floating point precision)
Well documentated, easy to get started.
I understand if there are no libraries/frameworks matching all requirements, if so, can you comment on how well it's extendible?
Edit:
Are there any other alternatives besides Processing? Is Processing usable (and easy?) as a library?
All of the effects you ask for can be done with Java 2D fairly simply and Java2D is to some degree hardware accelerated. The book Filthy Rich Clients shows how to implement all of these effects and many others. Painters in the SwingX has also implemented several of these effects.
Another possibility is JavaFx. It has a lot of effects built in. A year and a half ago when I tried it, it was still a little slow, but at least one version has been released since then. It may be more performant now. It's built on top of Java2D, so it should be able to take advantage of the hardware acceleration in Java2D.
As far as full screen support here's more information.
Maybe Processing (homepage) can be a good tradeoff.
it has 4 kinds of backing, including OpenGL
it has AA
it is 2d or 3d
it supports hw acceleration
it supports transformations
its syntax is quite easy to learn
it's easily embeddable
everything you need to learn is in this page
Not really a graphics library but rather an advanced applet AND graphics library:
PulpCore
Be sure to grab a quite recent version (maybe even fetch the source via mercurial and build it yourself) because the filter effects you mentioned (blur etc.) aren't available in earlier versions.
I know it might not be exactly what you're looking for; it is not a processing alternative, but it might be the better choice, depending on what you're planning to do.
Take a look at http://processing.org

Choose a language to write technical engineering maths (can I use Java?) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have to write a prototype app for an engineering company. Most of the work is calculating various engineering properties (I'm talking pipes and real things here, not software engineering).
However, there will also have to be a GUI for:
parameter entry
displaying results
some basic diagramming
The calculation work at the moment doesn't involve complex math elements (no matrices at the moment), just logs, square roots, relatively simple formulae. Later I will have to do some:
curve fitting
numerical approximation
I was wondering if Java has been used for real world engineering apps?
Are there libraries available for this sort of thing?
Or am I better off writing in MatLab and then connecting to the code through Java?
Also open to other languages (although we are a Java shop).
I have some experience of both Matlab and of Java for scientific/engineering type codes. Yes, Java is used for real-world scientific and engineering codes, and yes there are libraries available. You can certainly do what you want using either so I'm not sure that you could sensibly distinguish between the two on the sole basis of your current requirements. I'd ask myself the following questions:
How good am I at programming advanced mathematical operations? Operations such as function minimisation, differential equation solvers, matrix algebra. If the answer is not very then lean towards Matlab which will provide all of these out-of-the-box (though you may need additional toolboxes). If you opt for Java, make sure you are very comfortable with floating-point arithmetic and dealing with the sorts of errors which occur when you use it.
Do I want to code everything in Java, everything in Matlab, or am I happy to use both and to wrestle with, say, a Java GUI on a Matlab engine ? I think you can do much better (in a vague sense) GUIs with Java than with Matlab, but Matlab's GUI facilities are good enough for most of its users that the added complexity of integrating Matlab with Java is not worth tackling. But then many Matlab users are not software engineers.
What speed of development do I need for the prototype work ? If you were equally skilled in Java and in Matlab then I'd guess that you could do it quicker in Matlab, because the numeric stuff is already provided, you could concentrate on the GUI. But if you are a skilled Java programmer coming newly to Matlab you might decide to stick with what you know.
How will I develop and deploy the production app if the prototype is successful ? If Matlab doesn't fit your deployment ideas then learning it and forgetting it may not be rewarding.
Finally, since you solicit other language recommendations: forget Java, forget Matlab, forget Python, forget R, use Mathematica, it's way more fun and very powerful.
This sounds like a job for Matlab: you don't give any reason not to use it. There's some code for evaluating Matlab expressions from Java: http://www.cs.virginia.edu/~whitehouse/matlab/JavaMatlab.html
I have done some work where I had to reimplement Matlab code in Java so it is certainly possible. The Java code can end up being quite verbose compared to the Matlab original due to Matlab being able to operate directly on matrices/arrays etc.
Some math libraries that you might want to look at to see if they support the functionality you are looking for:
Commons Math
Colt
JSci
I guess that Java would be a good choice, even though it is not considered a typical language for rapid application development.
Pros:
versatile GUI toolkit for desktop applications in standard library (Swing),
(relatively) cross-platform,
great libraries, e.g. from Apache; a great math library to look at would be colt; for charts and diagrams, you may like jfreechart ..
Cons:
"not so rapid" prototyping capabilities
Further reading:
Technical Java: Applications for Science and Engineering
Python has several decent GUI toolkits as well as NumPy, and is easy and fun to write in.
This depends mainly on how easy it will be in your environment to include the mathlab or other math engine in your product. If this is easy, I would suggest to use mathlab, but if not, e.g. you have licensing issues or deployment issues, you are probably better of just using plain Java code.
You may also want to consider R language.
I would do a search for software that's written to do piping calculations. This problem has been done. (As you've noted, the calculations need not be difficult.) At a minimum I'd recommend that you know what's available to you, how much it would cost, and where the break even point was for development costs.
A commercial product will have one huge advantage over anything you'll write: It will have a larger user community that's been banging on it and finding bugs for a longer period of time than your prototype. That's worth something as well.
What's your opportunity cost? What else could you have done with the development time that would drive more revenue?
Don't forget numpy or scipy. Both allow you to call fast matrix libraries from Python.

MathML and Java [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I've been doing some research for a mathematical Android related project I'd like to embark upon and I stumbled across for the first time MathML.
Does anyone know of any Java libraries which can do any (preferably all) of the following things?
Parse MathML
Output MathML by parsing standard mathematical notation
Render MathML (particularly important)
Do any other cool maths-ey things (like re-arrange equations in terms of different things)
Number 3 is probably the most important, and number 4 the least.
Thanks in advance.
I've used JEuclid for rendering MathML in my Symja project (Java symbolic math system - point 4 of your list).
JEuclid may be too slow (especially at startup) to render MathML on a mobile phone.
Other alternatives for rendering math expressions with TeX:
JMathTex
SnuggleTeX
JLaTeXMath
and for re-arranging equations or as general Java math libraries:
Mathrider (Yacas for Java)
Jasymca - Symbolic Calculator for Mobile Devices
Java Algebra System
Hipparchus - library of lightweight, self-contained mathematics and statistics components
The Apache Commons Mathematics Library
Calculator projects for Android:
Calculator N+ (GNU public license)
Jasymca for Android (GNU public license)
Arity calculator for android (Apache license)
The W3C MathML Implementations page (http://www.w3.org/Math/Software/mathml_software_cat_editors.html) has a few that mention Java-based tools... that might be a good place to start looking.
Good luck.
JScience (jscience.org) looks like it has some experimental support for MathML being introduced.
JScience MathML Java class
hierarchy
JScience MathML Java
package classes
I would like to say I am extremely impressed with the features the JScience author has chosen and proven able to support with his powerful Java library.
It is a pretty amazing piece of craftsmanship. If you are doing any significant amount of sophisticated mathematics in your Java programs, or just want to create a utility to punt around with then you should take a look at this library. It might even give you some ideas for things you never thought about doing before because they were "too hard".
There is an open source project named MathEclipse that might interest you too.
I have used this for your Point #3 above (rendering): http://jeuclid.sourceforge.net/
It does a pretty nifty job taking MathML and creating a JPG, PNG, etc. It will also display the equations in a GUI (and I'm guessing you can look at the GUI code and incorporate that into your own project)
It depends on having a browser that will render MathML, of course.
An alternative would be to try jsMath, a JavaScript library that uses TeX to render equations.

Categories