Commit 7201edad authored by Tags's avatar Tags

Change model from 'frequency matrix model' into 'Direct model'

Changed into accordance list binary string data -> string data
parent 4b39d48e
......@@ -119,6 +119,7 @@ class Classifier:
@property
def teg_accordance(self, persantage=20):
"""
Class method for computing % af tag accordance
:return: tuple of % af tag accordance
......@@ -128,7 +129,7 @@ class Classifier:
temp_matrix = self.tag_frequency_matrix[row]
rez_summ = temp_matrix[self.matrix_test_data.toarray ()[0] > 0].sum ()
if rez_summ > (persantage / 100):
vector_accordance.append ((int(self.tags[row][0]), int (rez_summ * 1000) / 10, self.tags[row][1]))
vector_accordance.append ((int(self.tags[row][0]), int (rez_summ * 1000) / 10, self.tags[row][1].decode('ascii', 'ignore')))
vector_accordance.sort (key=lambda tup: tup[1], reverse=True)
return vector_accordance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment