The backend

In the backend, I encapsulated the preceding Q-learning implementation and additionally created a Scala controller that controls the model behavior from the frontend. The structure is given here:

import java.nio.file.Pathsimport org.codehaus.janino.Javaimport ml.stats.TSeries.{normalize, zipWithShift}import ml.workflow.data.DataSourceimport ml.trading.OptionModelimport ml.Predef.{DblPair, DblVec}import ml.reinforcement.qlearning.{QLConfig, QLModel, QLearning}import scala.util.{Failure, Success, Try}import play.api._import play.api.data.Formimport play.api.libs.json._import play.api.mvc._import scala.util.{Failure, Success, Try}class API extends Controller {    protected val name: String = "Q-learning"    private var sPath = Paths.get((s"${"public/data/IBM.csv"}")).toAbsolutePath.toString ...

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.