Skip to content

Instantly share code, notes, and snippets.

@redwrasse
redwrasse / naivebayes.go
Created July 8, 2017 04:59
Naive Bayes v1
package main
import (
"fmt"
"strings"
"crypto/sha1"
"encoding/base64"
)
type Document struct {
@redwrasse
redwrasse / MedianBinning.scala
Created August 12, 2016 04:06
Distributed median binning with spark
/**
* Distributed median binning
*
* See
* "Fast Computation of the Median by Successive Binning"
* https://www.stat.cmu.edu/~ryantibs/papers/median.pdf
*
* This code currently only works for an odd number of elements
* See https://github.com/goodsoldiersvejk/medianbinning
*/