Skip to content

Instantly share code, notes, and snippets.

View MishaelRosenthal's full-sized avatar

Mishael Rosenthal MishaelRosenthal

View GitHub Profile
package com.liveperson.lpbt.research.hadoop.scripts.EligibilityExperiment.auc.aucCalculators
import com.twitter.scalding._
/**
* Created with IntelliJ IDEA.
* User: mishaelr
* Date: 4/17/14
* Time: 1:21 PM
*
@MishaelRosenthal
MishaelRosenthal / DirectedGraphTraversals.scala
Created May 15, 2014 11:02
Directed Graph Traversals Implementations are tail recursive and uses only immutable data structures. These implementations are not more efficient than non tail recursive implementations.
package com.liveperson.predictivedialer.examples.misc
import scala.annotation.tailrec
import scala.util.Try
/**
* Created with IntelliJ IDEA.
* User: mishaelr
* Date: 5/14/14
* Time: 5:18 PM
@MishaelRosenthal
MishaelRosenthal / FCBF.scala
Last active September 25, 2018 11:24
Implements the Fast Correlation Based Filter algorithm for feature selection.Conference version: http://machinelearning.wustl.edu/mlpapers/paper_files/icml2003_YuL03.pdfJournal version: http://machinelearning.wustl.edu/mlpapers/paper_files/YuL04.pdf
package com.liveperson.lpbt.research.hadoop.examples
import scala.annotation.tailrec
/**
* User: mishaelr
* Date: 7/11/13
* Time: 10:33 AM
*/
object FCBF extends App{
package com.liveperson.predictivedialer.examples.misc
import spray.json._
import spray.json.DefaultJsonProtocol._
import java.io.{PrintWriter, FileWriter}
import scala.concurrent.duration._
/**
* Created with IntelliJ IDEA.
* User: mishaelr
@MishaelRosenthal
MishaelRosenthal / Sampling.scala
Last active August 29, 2015 14:02
Reservoir sampling and exponentially decaying sampling.Contains a batch and incremental version.Programmed in functional non object oreinted style.
package com.liveperson.mishael.misc
import scala.collection.immutable.SortedMap
import scala.util.Random
/**
* Created by mishaelr on 6/15/2014.
*
*/
object Sampling {
@MishaelRosenthal
MishaelRosenthal / RegExpAlgebra.scala
Created December 16, 2014 14:31
An algebra on regular expressions.
package core.misc
/**
* Created by mishael on 12/11/14.
*
*/
object RegExpAlgebra {
case class Singleton(regExp: String) extends RegExpAlgebra
case class ~!(inner: RegExpAlgebra) extends RegExpAlgebra
case class And(l: RegExpAlgebra, r: RegExpAlgebra) extends RegExpAlgebra
@MishaelRosenthal
MishaelRosenthal / MergeSortMonoid.scala
Created March 24, 2015 08:24
An exercise for learning Algebird, Monoid, Monads, ScalaCheck, etc...
package core.sparkTest.examples
import com.twitter.algebird.Monoid
import scala.annotation.tailrec
import scala.collection.GenSeq
import scala.collection.immutable.Queue
/**
* Created by mishael on 3/23/15.
package core.misc
import scala.util.Random
/**
* Created by mishael on 5/6/15.
*
*/
object SudokuSolver {
@MishaelRosenthal
MishaelRosenthal / GroupByKeySmallNumberOfGroups.scala
Last active May 8, 2020 09:59
RDD group by small number of groups
package core.sparkTest.utils
import java.io._
import java.nio.file.Files
import core.Pimps._
import org.apache.hadoop.io.compress.CompressionCodec
import org.apache.hadoop.io.{BytesWritable, NullWritable}
import org.apache.hadoop.mapred.JobConf
import org.apache.hadoop.mapred.lib.MultipleSequenceFileOutputFormat
package core.common.datastructures
import scala.collection.generic.{GenericCompanion, CanBuildFrom}
import scala.collection.{SeqLike, mutable}
import scala.collection.mutable.ListBuffer
final class LimitedParSeq[T] private (internal: Seq[T], parLimit: Int) extends Seq[T] with SeqLike[T,LimitedParSeq[T]] {
override def length: Int = internal.length