O'Reilly logo

Scala Machine Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The policy and action-value

The QLData class encapsulates the attributes of the policy in the Q-learning algorithm by creating a QLData record or instance with a given reward, probability, and Q-value that is computed and updated during training. The probability variable is used to model the intervention condition for an action to be executed.

If the action does not have any external constraint, the probability is 1 (that is, the highest), and it is zero otherwise (that is, the action is not allowed anyhow). The signature is given as follows:

final private[scalaml] class QLData(    val reward: Double,     val probability: Double = 1.0) {    import QLDataVar._    var value: Double = 0.0    @inline final def estimate: Double = value * probability    final 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required