Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private var weights : DoubleArray
- private var bias = 0.0
- // numFeatures is a value of type Int and refers to the number of features.
- // It is the length of the X vector.
- init {
- val random = Random()
- val weights = DoubleArray(numFeatures)
- for (x in 0 until numFeatures) {
- weights[x] = random.nextFloat().toDouble()
- }
- this.weights = weights
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement