Comments (3)
This is a good question.
Reading the source code, we can see there are 9 different types of features that make up the entire vector. The lengths of each different category of feature can easily be determined from reading the class definition for each. Unfortunately, the order of how these different features are arranged within the end vector depends on what version of Python you are using. Python 3.7+ specifies that the order iterating though dict must be insertion order, so the order can be determined by reading the source code. In previous versions of Python, this was an implementation-level detail, so the order cannot be known.
Here is what I get from reading the code:
ByteHistogram ------------- [0000, 0256)
ByteEntropyHistogram --- [0256, 0512)
StringExtractor ------------- [0512, 0616)
GeneralFileInfo ------------ [0616, 0626)
HeaderFileInfo ------------- [0626, 0688)
SectionInfo ------------------ [0688, 0944)
ImportsInfo ------------------ [0944, 2224)
ExportsInfo ------------------ [2224, 2352)
DataDirectories ------------ [2352, 2382)
from ember.
Unfortunately, the order of how these different features are arranged within the end vector depends on what version of Python you are using. Python 3.7+ specifies that the order iterating though dict must be insertion order, so the order can be determined by reading the source code.
If that is the case, there should be a note on this point in the README.
The following simple code can be used for separating the raw_features into their constituent parts.
features = {
'ByteHistogram': ByteHistogram(),
'ByteEntropyHistogram': ByteEntropyHistogram(),
'StringExtractor': StringExtractor(),
'GeneralFileInfo': GeneralFileInfo(),
'HeaderFileInfo': HeaderFileInfo(),
'SectionInfo': SectionInfo(),
'ImportsInfo': ImportsInfo(),
'ExportsInfo': ExportsInfo()
}
features_mapping = {}
feature_vector = [] # <-- load your feature vector here
for k, v in features.items():
features_mapping[k] = feature_vector[:v.dim]
feature_vector = feature_vector[v.dim:]
from ember.
Agreed it has the potential to be problematic. Upon further research, it appears that CPython >= 3.5 maintains dict order, although it is not PEP-mandated for 3.5 and 3.6. Don't quote me.
from ember.
Related Issues (20)
- AttributeError: module 'ember' has no attribute 'create_vectorized_features' HOT 10
- error: subprocess-exited-with-error (lief) HOT 2
- create_vectorized_features error HOT 7
- module 'lief' has no attribute 'bad_format' HOT 2
- Problem with run classify_binaries.py URGENT
- How to extract raw feature from a set of PE binaries? HOT 2
- Extract Raw Features for Own Dataset HOT 3
- The range of the vectorized features and normalization
- extracting column names for the dataframe HOT 1
- how to uninstall ember
- Why "train model" runs so fast?
- Can't import the library on Google Colab
- How to get the original bytes of the PE file. I want to covert a file to a gray image. HOT 5
- How to map samples in data set to their SHA256 hash?
- What is the license of the ember/features.py file?
- The train_ember.py file is not installed HOT 2
- Dependencies no longer declared in setuptools
- NumPy 1.24 compatibility HOT 2
- Sharing datasets over BitTorrent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember.