Time series
The overwhelming majority of examples used to illustrate the different machine algorithms in this book process time series or sequential, ordered, or unordered data.
Each library has its own container type to manipulate datasets. The challenge is to define all possible conversions between types from different libraries needed to implement a large variety of machine learning models. Such a strategy may result in a combinatorial explosion of implicit conversion. A solution consists of creating a generic class to manage conversion from and to any type used by a third-party library.
Note
Scala.collection.JavaConversions _
Scala provides a standard package to convert collection types from Scala to Java and vice versa.
The generic data transformation, DT
, can be used to transform any XTSeries
time series:
class DT[T,U] extends PipeOperator[XTSeries[T], XTSeries[U]] { override def |> : PartialFunction[XTSeries[T], XTSeries[U]] }
Let's consider the simple case of using a Java...