Zaktualizuj 'linearpred.py'
This commit is contained in:
parent
ca7be0f60e
commit
026265d53d
@ -22,7 +22,7 @@ for line2 in lines:
|
|||||||
for t in terms2:
|
for t in terms2:
|
||||||
if(t in vocabulary):
|
if(t in vocabulary):
|
||||||
expected=expected+(words_count[t]/len(words_count)*(weights[word_to_index[t]]))
|
expected=expected+(words_count[t]/len(words_count)*(weights[word_to_index[t]]))
|
||||||
if(expected>0.65):
|
if(expected>0.5):
|
||||||
print(1)
|
print(1)
|
||||||
else:
|
else:
|
||||||
print(0)
|
print(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user