Transformer

abstract class Transformer[-A, B, C](val name: String) extends Serializable
Base class for feature transformers.
Input values are converted into intermediate type B, aggregated, and converted to summary type
C. The summary type C is then used to transform input values into features.
Type Params
A
input type
B
aggregator intermediate type
C
aggregator summary type
Value Params
name
feature name
trait Serializable
class Object
trait Matchable
class Any

Value members

Methods

protected def checkRange(name: String, value: Double, lower: Double, upper: Double): Unit
def featureDimension(c: C): Int
Number of generated features given an aggregator summary.
def featureNames(c: C): Seq[String]
Names of the generated features given an aggregator summary.
def buildFeatures(a: Option[A], c: C, fb: FeatureBuilder[]): Unit
Build features from a single input value and an aggregator summary.
Value Params
a
input value
c
aggregator summary
fb
feature builder
protected def nameAt(n: Int): String
protected def names(n: Int): Stream[String]
def contramap[AA](f: AA => A): Transformer[AA, B, C]
Builds a new transformer with an extra input preprocessing step
Value Params
f
input preprocessing function
def optFeatureDimension(c: Option[C]): Int
def optFeatureNames(c: Option[C]): Seq[String]
def optBuildFeatures(a: Option[A], c: Option[C], fb: FeatureBuilder[]): Unit
def unsafeBuildFeatures(a: Option[Any], c: Option[Any], fb: FeatureBuilder[]): Unit
def unsafeFeatureDimension(c: Option[Any]): Int
def flatRead[T](evidence$1: FlatReader[T]): T => Option[Any]
def flatWriter[T](fw: FlatWriter[T]): Option[A] => IF
def unsafeFlatWriter[T](fw: FlatWriter[T]): Option[Any] => IF
def encodeAggregator(c: C): String
Encode aggregator summary of the current extraction.
def decodeAggregator(s: String): C
Decode aggregator summary from a previous extraction.
def params: Map[String, String]
Compile time parameters.
def settings(c: Option[C]): Settings
Settings including compile time parameters and runtime aggregator summary.
Value Params
c
aggregator summary

Fields

val name: String
val aggregator: Aggregator[A, B, C]
Aggregator for computing input values into a summary.