Created
May 19, 2019 12:49
-
-
Save shubham0204/01e5db8a276705852844557fc366c537 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 fun findProbabilityGivenClass( x : String , classVocab : Array<String> ) : Float { | |
val x_count = classVocab.count { it.contains(x) or x.contains(it) }.toFloat() | |
val class_count = classVocab.count().toFloat() | |
return (( x_count / class_count ) + 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment