Comments (2)
bayes-scala doesn't provide any high-level api at the moment, so it would be improvement. It provides implementations of different bayesian techniques, e.g.:
- separate scala code for cluster graphs in a discrete space
- separate code for factor graph in a hybrid space,
- some examples for Gaussian Processes, LDS learning and few others
Basically, I was implementing these algorithms over time when I needed them for my work, but I never really attempted creating more high level API, although I have some ideas I can share with you now.
I presume you attempt creating API for bayesian-networks, which conceptually looks similar to a graphical SamIam tool. Creating nodes and dependencies, hiding details of underlying implementation, removing varIds, explicit edges, and so on. If so, then it looks good, however consider the following:
-
Your API supports Bayesian Networks only, it can't really create markov networks, which are supported by cluster graphs. Transforming Bayesian Network to cluster graph is not an obvious task, there are multiple cluster graphs possible for the same Bayesian Network. Think how the API will be actually implemented, do you want to support just bayesian nets in discrete space or any probabilistic models.
-
If the purpose of this API is more for learning and playing with small and simple Bayesian Networks, then of course it doesn't really matter what form of cluster graph or factor graph you use for representing it, it still will be fine from the performance point of view, but creating such API for large scale and efficient inference in both discrete and continuous space is a challenge and it likely needs lots of time to design and implement it.
-
Different form of API I was thinking my self follows more a probabilistic programming paradigm, e.g.
val winter = Bern(0.2)
val sprinkler = Mixture(winter, Bern(0,2), Bern(0.75))
or differently:
val sprinkler = winter match {
case true => Bern(0,2)
case false => Bern(0.75)
}
Basically working purely with variables like in programming, instead of explicitly using factors or nodes
from bayes-scala.
Thanks for your feedback.
I have reworked a bit the POC as it can be seen for SprinklerBN.
val rain = P('rain | winter) follows (0.1, 0.9, 0.3, 0.7)
which is quite nice for a simple example. The name of the Var/val is duplicated but it is a useful information for later in order to generate an export and/or a visualisation of the network.
I am at ease with Bayesian networks but I clearly will need to go back to my books for the details of cluster graph and factor graph. In that regard, your documentation seems really good because I know the references you have been using.
My roadmap is
- almost done : a simple API for discrete Bayesian network
- next : a flexible way to create cluster graph
- later : support for 'non-discrete' network and Markov network
Your examples are interesting. I really could see a simple evolution in order to support various factor types.
val rain = P('rain | winter) is (0.1, 0.9, 0.3, 0.7)
# same as above but with normalization
val rain = P('rain | winter) is Raw(1, 9, 30, 70)
# same as above but more explicit
val rain = P('rain | winter) is Mixture(Bern(0.1), Bern(0.3))
I am not a fan of pattern matching/switch statement for the configuration but I know a few APIs are doing that (in Python). I will see how it goes step by step. Ideally, the compiler should check as much as possible that the configuration is correct. That might be a secondary challenge.
from bayes-scala.
Related Issues (20)
- Update scalalogging HOT 3
- Set up codacy code review and add button HOT 2
- deploy bayes-scala for Scala 2.11 to snapshot maven repo HOT 2
- Graphical visualization of Categoricals using Spark Notebook HOT 4
- Replace ejml with breeze HOT 1
- Write a tutorial for 'Walmart Recruiting - Sales in stormy weather'
- Unsetting the value on a Categorical HOT 4
- Non-snapshot release to maven central HOT 4
- Multi task Gaussian process regression
- Implement automated variational inference
- Package structure refactor
- replace inv(K) with invchol(cholesky(K).t) for Hermitian psd matrices (coviarance matrix)
- Use sqDist from bayes-scala-gp for covariance functions
- remove breeze-natives HOT 5
- replace isIdentical/hasUncountable with isClosy/any from breeze
- Implement new factor graph
- typo in scm HOT 1
- truncate function of Gaussian seems not work HOT 1
- Scala 2.12 cross build HOT 8
- EM for continuous bayesian network HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayes-scala.