Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Data Science Project struture in cookiecutter style.
Developed with ❤️ by A3Data
Hermione is the newest open source library that will help Data Scientists on setting up more organized codes, in a quicker and simpler way. Besides, there are some classes in Hermione which assist with daily tasks such as: column normalization and denormalization, data view, text vectoring, etc. Using Hermione, all you need is to execute a method and the rest is up to her, just like magic.
To bring in a little of A3Data experience, we work in Data Science teams inside several client companies and it’s undeniable the excellence of notebooks as a data exploration tool. Nevertheless, when it comes to data science products and their context, when the models needs to be consumed, monitored and have periodic maintenance, putting it into production inside a Jupyter Notebook is not the best choice (we are not even mentioning memory and CPU performance yet). And that’s why Hermione comes in! We have been inspired by this brilliant, empowered and awesome witch of The Harry Potter saga to name this framework!
This is also our way of reinforcing our position that women should be taking more leading roles in the technology field. #CodeLikeAGirl
Hermione does not depend on conda to build and manage virtual environments anymore. It uses venv
instead.
pip install -U hermione-ml
For bash:
echo 'eval "$(_HERMIONE_COMPLETE=source_bash hermione)"' >> ~/.bashrc
For Zsh:
echo 'eval "$(_HERMIONE_COMPLETE=source_zsh hermione)"' >> ~/.zshrc
After installed Hermione:
hermione project new project_hermione
Please select one of the following templates
(0) starter
(1) barebones
(2) sagemaker
Option [0]:
<project_name>_env\Scripts\activate
For linux and MacOS users, do
source <project_name>_env/bin/activate
pip install -r requirements.txt
train.py
file and execute it. In the example, models and metrics are already controlled via MLflow.mlflow ui
[2020-10-19 23:23:12 -0300] [15676] [INFO] Starting gunicorn 19.10.0
[2020-10-19 23:23:12 -0300] [15676] [INFO] Listening at: http://127.0.0.1:5000 (15676)
[2020-10-19 23:23:12 -0300] [15676] [INFO] Using worker: sync
[2020-10-19 23:23:12 -0300] [15678] [INFO] Booting worker with pid: 15678
predict.py
file, type hermione run predict
. The default implemented version will print some predictions for you in the terminal.hermione run predict
notebooks
.Do you want to create your project from scratch? There click here to check a tutorial.
Hermione comes with a default Dockerfile
which implements a FastAPI application that serves your ML model. You should take a look at the api/app.py
module and rewrite predict_new()
function as you see fit.
Also, in the newest version, hermione brings two CLI commands that helps us abstract a little bit the complexity regarding docker commands. To build an image (remember you should have docker installed), you should be in the project's root directory. Than, do:
hermione run build <IMAGE_NAME>
After you have built you're docker image, run it with:
hermione run container <IMAGE_NAME>
[2020-10-20 02:13:20 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2020-10-20 02:13:20 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2020-10-20 02:13:20 +0000] [1] [INFO] Using worker: sync
[2020-10-20 02:13:20 +0000] [7] [INFO] Booting worker with pid: 7
[2020-10-20 02:13:20 +0000] [8] [INFO] Booting worker with pid: 8
[2020-10-20 02:13:20 +0000] [16] [INFO] Booting worker with pid: 16
THAT IS IT! You have a live model up and running. To test your API, hermione provides a api/myrequests.py
module. This is not part of the project; it's a "ready to go" code to make requests to the API. Help yourself!
cd src/api
python myrequests.py
Sending request for model...
Data: {"Pclass": [3, 2, 1], "Sex": ["male", "female", "male"], "Age": [4, 22, 28]}
Response: "[0.24630952 0.996 0.50678968]"
Play a little with the 'fake' data and see how far can the predictions go.
This is the class structure diagram that Hermione relies on:
Here we describe briefly what each class is doing:
scikit-learn
library, for instance, can be easily used with the TrainerSklearn implemented class.Have a look at our contributing guide.
Make a pull request with your implementation.
For suggestions, contact us: hermione@a3data.com.br
FAQs
Unknown package
We found that hermione-ml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.