Created
June 9, 2019 05:55
-
-
Save shubham0204/e0143179726732b9c3fddac5740328cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment