Changeset 9f0f63 in git
- Timestamp:
- Jul 29, 2019, 3:02:43 PM (4 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 05dbb13ce9ff25aa2c15fa96fa9a3b3b4c4bc09e
- Parents:
- eb2904af1f3fb2d653378807ed3b18780cfd4dbc
- Location:
- machine_learning/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
machine_learning/common/keyword_vector.py
reb2904 r9f0f63 3 3 """Some vector logic""" 4 4 5 import math6 5 import os 7 6 import re … … 57 56 if normalise: 58 57 vector = normalise_vector(vector) 59 return vector 58 return vector 60 59 61 60 … … 85 84 Create a zero vector for a given dictionary 86 85 """ 87 assert not dictionary ==None, "Please give a dictionary"88 assert not len(dictionary)== 0, "Please give a dictionary"86 assert not dictionary is None, "Please give a dictionary" 87 assert not np.array(dictionary).size == 0, "Please give a dictionary" 89 88 vector = {} 90 89 for word in dictionary: … … 124 123 sys.exit(1) 125 124 126 testvector = np.array([3, 4])125 testvector = np.array([3, 4]) 127 126 normalise_vector(testvector) 128 127 print("normalised vector: " + str(testvector)) 129 128 130 vector1 = np.array([3, 4])129 vector1 = np.array([3, 4]) 131 130 vector1 = normalise_vector(vector1) 132 vector2 = np.array([4, 3])131 vector2 = np.array([4, 3]) 133 132 normalise_vector(vector2) 134 133 vector2 = normalise_vector(vector2) -
machine_learning/common/lookuptable.py
reb2904 r9f0f63 14 14 15 15 # local imports 16 from common.keyword_vector import count_occurances, read_dictionary, \ 17 normalise_vector 16 from common.keyword_vector import count_occurances, read_dictionary 18 17 from common.constants import HELP_FILE_URL, HELP_FILE_PATH, SINGULAR_BIN, \ 19 18 EXTRACT_SCRIPT, KEYWORDS_FILE, HELPFILE_NPY, \
Note: See TracChangeset
for help on using the changeset viewer.