blayze

A fast and flexible Naive Bayes implementation for the JVM written in Kotlin

License

License

GroupId

GroupId

com.tradeshift
ArtifactId

ArtifactId

blayze
Last Version

Last Version

6.0
Release Date

Release Date

Type

Type

jar
Description

Description

blayze
A fast and flexible Naive Bayes implementation for the JVM written in Kotlin
Project URL

Project URL

https://github.com/Tradeshift/blayze
Source Code Management

Source Code Management

https://github.com/Tradeshift/blayze/tree/master

Download blayze

How to add to project

<!-- https://jarcasting.com/artifacts/com.tradeshift/blayze/ -->
<dependency>
    <groupId>com.tradeshift</groupId>
    <artifactId>blayze</artifactId>
    <version>6.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.tradeshift/blayze/
implementation 'com.tradeshift:blayze:6.0'
// https://jarcasting.com/artifacts/com.tradeshift/blayze/
implementation ("com.tradeshift:blayze:6.0")
'com.tradeshift:blayze:jar:6.0'
<dependency org="com.tradeshift" name="blayze" rev="6.0">
  <artifact name="blayze" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.tradeshift', module='blayze', version='6.0')
)
libraryDependencies += "com.tradeshift" % "blayze" % "6.0"
[com.tradeshift/blayze "6.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.21
org.jetbrains.kotlin : kotlin-stdlib jar 1.3.21
org.jetbrains : annotations jar 13.0
com.google.protobuf : protobuf-java jar 3.5.1
colt : colt jar 1.2.0

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
io.mockk : mockk jar 1.9.1
io.mockk : mockk-dsl-jvm jar 1.9.1

Project Modules

There are no modules declared in this project.

blayze

A fast and flexible Bayesian Naive Bayes implementation for the JVM written in Kotlin.

  • Fully supports the online learning paradigm, in which data, and even new features, are added as they become available.
  • Reasonably fast and memory efficient. We've trained a document classifier with tens of thousands of classes on hundreds of thousands of documents, and ironed out most of the hot-spots.
  • Naturally works with few samples, by integrating out the uncertainty on estimated parameters.
  • Models and data structures are immutable such that they are concurrency friendly.
  • Efficient serialization and deserialization using protobuf.
  • Missing and unknown features at prediction time are properly handled.
  • Minimal dependencies.

Usage

Get the latest artifact from maven central

//Java 9
Model model = new Model().batchAdd(List.of(new Update( //Models are immutable
        new Inputs( // Supports multiple feature types
                Map.of( //Text features
                        "subject", "Attention, is it true?", //features are named.
                        "body", "Good day dear beneficiary. This is Secretary to president of Benin republic is writing this email ..." // multiple features of the same type have different names
                ),
                Map.of( //Categorical features
                        "sender", "[email protected]"
                ),
                Map.of( //Gaussian features
                        "n_words", 482.
                )
        ),
        "spam" // the outcome, in this case spam.
)));

Map<String, Double> predictions = model.predict(new Inputs(/*...*/));// e.g. {"spam": 0.624, "ham": 0.376}

Built With

Versioning

We use SemVer for versioning.

Authors

com.tradeshift

Tradeshift

Tradeshift is the world’s largest business commerce platform that connects buyers and sellers.

Versions

Version
6.0
5.0
4.1.1
4.0.1
4.0.0
3.0.0
2.0.0
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0