Created
May 19, 2019 12:54
-
-
Save shubham0204/a6e297e250033244c62c0b50896b3879 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 findProbabilityGivenSample( document : String , classVocab : Array<String> ) : Float { | |
val tokens = getTokens( document ) | |
var probability_given_class = 1.0f | |
for ( token in tokens ) { | |
probability_given_class *= findProbabilityGivenClass( token , classVocab ) | |
} | |
return probability_given_class * findClassProbability( positiveBagOfWords , negativeBagOfWords , classVocab ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment