Ignore:
Timestamp:
Jul 26, 2019, 4:13:00 PM (5 years ago)
Author:
Murray Heymann <heymann.murray@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
55a5abbd0397943b2c98a4492b27ecbc050c20ef
Parents:
746d3db65a7b75cbc29407ee9382332483801f1d
Message:
Reorganize source tree, make test prediction
File:
1 moved

Legend:

Unmodified
Added
Removed
  • machine_learning/model/predictor.py

    r746d3d r872089  
    88
    99# Local imports
    10 from keyword_vector import vector_distance
     10from common.keyword_vector import vector_distance, count_occurances, \
     11                                    read_dictionary
     12from common.lookuptable import create_table
     13from common.constants import KEYWORDS_FILE
    1114
    1215
     
    8992    print(prediction)
    9093
     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
    91101if __name__ == '__main__':
    92102    main()
Note: See TracChangeset for help on using the changeset viewer.