Changeset 872089 in git for machine_learning/model/predictor.py
- Timestamp:
- Jul 26, 2019, 4:13:00 PM (5 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 55a5abbd0397943b2c98a4492b27ecbc050c20ef
- Parents:
- 746d3db65a7b75cbc29407ee9382332483801f1d
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
machine_learning/model/predictor.py
r746d3d r872089 8 8 9 9 # Local imports 10 from keyword_vector import vector_distance 10 from common.keyword_vector import vector_distance, count_occurances, \ 11 read_dictionary 12 from common.lookuptable import create_table 13 from common.constants import KEYWORDS_FILE 11 14 12 15 … … 89 92 print(prediction) 90 93 94 dictionary = read_dictionary(KEYWORDS_FILE) 95 vectors, file_list = create_table(dictionary=dictionary) 96 test_vec = count_occurances("extract.lib", dictionary) 97 predictor.fit(vectors, file_list) 98 prediction = predictor.predict(np.array([test_vec])) 99 print(prediction) 100 91 101 if __name__ == '__main__': 92 102 main()
Note: See TracChangeset
for help on using the changeset viewer.