Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9fcf8fc

Browse files
authoredApr 6, 2024
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

+1-1
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

1 commit comments

Comments
 (1)

pturnah commented on Apr 7, 2024

@pturnah
Author

link to fix #103

Please sign in to comment.