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

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.

主站蜘蛛池模板: 望谟县| 逊克县| 伊金霍洛旗| 吴堡县| 剑阁县| 蒙阴县| 广丰县| 萍乡市| 永登县| 合川市| 张家港市| 昭通市| 齐齐哈尔市| 嘉兴市| 邯郸市| 南召县| 沧源| 普宁市| 北辰区| 正定县| 阜新市| 鄢陵县| 高青县| 黑水县| 和林格尔县| 平度市| 黑龙江省| 平南县| 上思县| 南城县| 华安县| 宝清县| 高雄市| 华亭县| 讷河市| 巴楚县| 北川| 英吉沙县| 宾川县| 武义县| 临夏市|