官术网_书友最值得收藏!

Project structure

The wrapped up Scala web ML app has the following directory structure:

Figure 7: Scala ML web app directory structure

In the preceding structure, bitcoin_ml folder has all the backend and frontend codes. The models folder has all the trained models. An example-trained model is given in the gbt_22_binary_classes_32660767 folder. Finally, database files and traces are there in the DataBase.mv.db and DataBase.trace.db files respectively.

Then let us see the sub-folder structure of the bitcoin_ml folder that contains the actual codes:

Figure 8: The bitcoin_ml directory structure

In the preceding figure, the conf folder has the Scala web app configuration file, application.conf containing necessary configurations (as shown already). All the dependencies are defined in the build.sbt file shown as follows:

libraryDependencies ++= Seq(jdbc, evolutions,
"com.typesafe.play" %% "anorm" % "2.5.1",
cache, ws, specs2 % Test, ws)

unmanagedResourceDirectories in Test <+= baseDirectory(_ / "target/web/public/test")
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"

resolvers ++= Seq(
"apache-snapshots" at "http://repository.apache.org/snapshots/")
routesGenerator := InjectedRoutesGenerator
val sparkVersion = "2.2.0"
libraryDependencies += "org.apache.spark" %% "spark-mllib" % sparkVersion
libraryDependencies += "org.apache.hadoop" % "hadoop-mapreduce-client-core" % "2.7.2"
libraryDependencies += "org.apache.hadoop" % "hadoop-common" % "2.7.2"
libraryDependencies += "commons-io" % "commons-io" % "2.4"
libraryDependencies += "org.codehaus.janino" % "janino" % "3.0.7" //fixing "java.lang.ClassNotFoundException: de.unkrig.jdisasm.Disassembler" exception

libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.1.1",
"org.slf4j" % "slf4j-nop" % "1.6.4"
)

To be frank, at the beginning of writing, I did not think of wrapping up this application as a Scala Play web app. Therefore, things went a bit unstructured. However, do not worry to know more about backend as well frontend, refer to the options trading application in Chapter 7, Options Trading Using Q-Learning and Scala Play Framework.

主站蜘蛛池模板: 南召县| 西安市| 宁国市| 体育| 固原市| 乌鲁木齐县| 莱芜市| 大石桥市| 手游| 额济纳旗| 余庆县| 名山县| 文山县| 秀山| 庆元县| 武陟县| 林州市| 尖扎县| 河曲县| 乃东县| 阿瓦提县| 荣昌县| 新化县| 青海省| 信丰县| 右玉县| 肥乡县| 荥阳市| 松潘县| 隆林| 福州市| 汕尾市| 华蓥市| 北川| 临城县| 嘉黎县| 沙湾县| 称多县| 景洪市| 剑阁县| 新化县|