Skip to content

Commit 9fcf8fc

Browse files
authored
Update features.py
Fixed: ValueError: Samples can not be a single string. The input must be an iterable over iterables of strings. By: entry_name_hashed = FeatureHasher(50, input_type="string").transform([raw_obj['entry']]).toarray()[0] with: entry_name_hashed = FeatureHasher(50, input_type="string").transform([ [raw_obj['entry']] ]).toarray()[0] at line 192. In this way an iterable over iterable over raw features is obtained, as transform() method require.
1 parent d97a0b5 commit 9fcf8fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ember/features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def process_raw_features(self, raw_obj):
189189
section_entropy_hashed = FeatureHasher(50, input_type="pair").transform([section_entropy]).toarray()[0]
190190
section_vsize = [(s['name'], s['vsize']) for s in sections]
191191
section_vsize_hashed = FeatureHasher(50, input_type="pair").transform([section_vsize]).toarray()[0]
192-
entry_name_hashed = FeatureHasher(50, input_type="string").transform([raw_obj['entry']]).toarray()[0]
192+
entry_name_hashed = FeatureHasher(50, input_type="string").transform([ [raw_obj['entry']] ]).toarray()[0]
193193
characteristics = [p for s in sections for p in s['props'] if s['name'] == raw_obj['entry']]
194194
characteristics_hashed = FeatureHasher(50, input_type="string").transform([characteristics]).toarray()[0]
195195

0 commit comments

Comments
 (0)