Installing Breeze
If you have downloaded the code examples for this book, the easiest way of using Breeze is to go into the chap02
directory and type sbt console
at the command line. This will open a Scala console in which you can import Breeze.
If you want to build a standalone project, the most common way of installing Breeze (and, indeed, any Scala module) is through SBT. To fetch the dependencies required for this chapter, copy the following lines to a file called build.sbt
, taking care to leave an empty line after scalaVersion
:
scalaVersion := "2.11.7" libraryDependencies ++= Seq( "org.scalanlp" %% "breeze" % "0.11.2", "org.scalanlp" %% "breeze-natives" % "0.11.2" )
Open a Scala console in the same directory as your build.sbt
file by typing sbt console
in a terminal. You can check that Breeze is working correctly by importing Breeze from the Scala prompt:
scala> import breeze.linalg._ import breeze.linalg._