SaddleはハイパフォーマンスなScala向けデータ操作ライブラリ。
Saddleでは以下の様なデータ形式や性質をもたらす。
- array-backed
- Indexed
- 1次元または2次元データ構造
- ベクトル計算
- 自動的データアライメント(?)
- データ欠損への堅牢性
- I/O周り
- rangeとかshuffleとか、joda DataTime objectsのヘルパーといった便利機能いっぱい
SaddleはR言語やその統計環境、numpyやpandas、Python、そしてScalaのコレクションライブラリなどから影響を受けている。
SaddleはJVM上での構造化されたデータへのプログラミングを簡便にし、より表現豊かにすることができる。
公式では状況に応じていくつかの方法が提示されている。
おなじみg8を使う。
$ g8 saddle/saddle.g8
# follow the promts, go to your new project directory, and run
$ sbt console
resolvers ++= Seq(
"Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"
)
libraryDependencies ++= Seq(
"org.scala-saddle" %% "saddle" % "1.0.1"
)
なお、自分で試した時には以下のようなログが出ており、resolversにはrepo.typesafe.com
も加えておいたほうが良さそう(自分の場合はすでにrepo.typesafe.comを加えていた)。
[info] downloading http://repo.typesafe.com/typesafe/repo/org/scala-saddle/saddle_2.9.2/1.0.1/saddle_2.9.2-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-saddle#saddle_2.9.2;1.0.1!saddle_2.9.2.jar (32904ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/com/googlecode/efficient-java-matrix-library/ejml/0.19/ejml-0.19.jar ...
[info] [SUCCESSFUL ] com.googlecode.efficient-java-matrix-library#ejml;0.19!ejml.jar (8050ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/org/apache/commons/commons-math/2.2/commons-math-2.2.jar ...
[info] [SUCCESSFUL ] org.apache.commons#commons-math;2.2!commons-math.jar (11273ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/it/unimi/dsi/fastutil/6.5.2/fastutil-6.5.2.jar ...
[info] [SUCCESSFUL ] it.unimi.dsi#fastutil;6.5.2!fastutil.jar (185619ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/it/unimi/dsi/dsiutils/2.0.15/dsiutils-2.0.15.jar ...
[info] [SUCCESSFUL ] it.unimi.dsi#dsiutils;2.0.15!dsiutils.jar (11210ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/org/scala-saddle/jhdf5/2.9/jhdf5-2.9.jar ...
[info] [SUCCESSFUL ] org.scala-saddle#jhdf5;2.9!jhdf5.jar (13801ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/com/martiansoftware/jsap/2.1/jsap-2.1.jar ...
[info] [SUCCESSFUL ] com.martiansoftware#jsap;2.1!jsap.jar (4825ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/com/google/guava/guava/14.0-rc3/guava-14.0-rc3.jar ...
[info] [SUCCESSFUL ] com.google.guava#guava;14.0-rc3!guava.jar(bundle) (26383ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/log4j/log4j/1.2.17/log4j-1.2.17.jar ...
[info] [SUCCESSFUL ] log4j#log4j;1.2.17!log4j.jar(bundle) (7654ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar ...
[info] [SUCCESSFUL ] commons-configuration#commons-configuration;1.8!commons-configuration.jar (8191ms)
[info] downloading http://repo.typesafe.com/typesafe/repo/org/apache/commons/commons-math3/3.1.1/commons-math3-3.1.1.jar ...
[info] [SUCCESSFUL ] org.apache.commons#commons-math3;3.1.1!commons-math3.jar (21990ms)
[info] Done updating.
resolvers ++= Seq(
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases",
"Typesafe repo" at "http://repo.typesafe.com/typesafe/repo",
"Sonatype Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"
)