Skip to content

Instantly share code, notes, and snippets.

View abomm's full-sized avatar

Aris Vlasakakis abomm

View GitHub Profile
@abomm
abomm / prediction.scala
Last active August 29, 2015 14:04
Cannot Serialize this Scala Class this with Twitter Chill
import org.apache.spark.mllib.classification.LogisticRegressionModel
import org.apache.spark.mllib.linalg.{Vectors, Vector => MLVector}
import org.apache.spark.mllib.regression.LabeledPoint
// Object which will provides list of scores
class Prediction(val model: LogisticRegressionModel, val offers: Vector[(String,MLVector)]) extends Serializable{
/*
THE PROBLEM WITH CHILL LIBRARY
import tensorflow as tf
# a = tf.constant([3,2], name="a", dtype=tf.float32)
# b = tf.constant([3,2], shape=[2,1], name="b")
# c = tf.constant([[3.0], [2.0]], name="c")
a = tf.constant([3], name="a")
b = tf.constant([5], name="b")
c = tf.add(a,b,name="c")
@abomm
abomm / MapSort.scala
Last active August 26, 2019 20:48
Breaking ZIO.foreachPar
import zio.{DefaultRuntime, RIO, UIO, ZIO}
import scala.collection.mutable
import scala.util.Random
object MapSort {
val numValues = 10
val ceilingValue = 100000
@abomm
abomm / MLToyApp.scala
Created October 5, 2020 18:53
Machine Learning application design with Pure Functional ZIO in Scala
package ziomlscoring
import zio._
import ziomlscoring.SizeMyShirt.moduleExperimentFramework.ExperimentFramework
import ziomlscoring.SizeMyShirt.moduleInferenceLogger.InferenceLogger
import ziomlscoring.SizeMyShirt.moduleTShirtSizer.TShirtSizer
import ziomlscoring.SizeMyShirt.sizeMyShirtMicroService
object SizeMyShirt {
case class UserId(value: Long) extends AnyVal