Skip to main content

PyPI version Build Status Coverage Status GitHub Codacy Badge

Overview

This project is aimed to serve as an utility tool for the preprocessing, training and extraction of entity embeddings through Neural Networks using the Keras framework. It's still under construction, so please use it carefully.

Installation

The installation is pretty simple if you have a virtualenv already installed on your machine. If you don't please rely to VirtualEnv official documentation.

pip install entity-embeddings-categorical

Documentation

Besides the docstrings, major details about the documentation can be found here.

Testing

This project is inteded to suit most of the existent needs, so for this reason, testability is a major concern. Most of the code is heavily tested, along with Travis as Continuous Integration tool to run all the unit tests once there is a new commit.

Usage

The usage of this utility library is provided in two modes: default and custom. In the default configuration, you can perform the following operations: Regression, Binary Classification and Multiclass Classification.

If your data type differs from any of these, you can feel free to use the custom mode, where you can define most of the configurations related to the target processing and output from the neural network.

Default mode

The usage of the default mode is pretty straightforward, you just need to provide a few parameters to the Config object:

So for creating a simple embedding network that reads from file sales_last_semester.csv, where the target name is total_sales, with the desired output being a binary classification and with a training ratio of 0.9, our Python script would look like this:

    config = Config.make_default_config(csv_path='sales_last_semester.csv',
                                        target_name='total_sales',
                                        target_type=TargetType.BINARY_CLASSIFICATION,
                                        train_ratio=0.9)


    embedder = Embedder(config)
    embedder.perform_embedding()

Pretty simple, huh?

A working example of default mode can be found here as a Python script.

Custom mode

If you intend to customize the output of the Neural Network or even the way that the target variables are processed, you need to specify these when creating the configuration object. This can be done by creating a class that extend from TargetProcessor and ModelAssembler.

A working example of custom configuration mode can be found here.

Visualization

Once you are done with the training of your model, you can use the module visualization_utils in order to create some visualizations from the generated weights as well as the accuraccy of your model.

Below are some examples created for the Rossmann dataset:

Weights for store id embedding

Troubleshooting

In case of any issue with the project, or for further questions, do not hesitate to open an issue here on GitHub.

Contributions

Contributions are really welcome, so feel free to open a pull request :-)

TODO

  • Allow to use a Pandas DataFrame instead of the csv file path;

Metadata

Release files for entity-embeddings-categorical 0.6.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entity-embeddings-categorical 0.6.7
File Size Uploaded Provenance Actions
entity_embeddings_categorical-0.6.7.tar.gz 14.2 kB Without provenance Details for entity_embeddings_categorical-0.6.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for entity-embeddings-categorical 0.6.7
File Interpreter ABI Platform Actions
entity_embeddings_categorical-0.6.7-py3-none-any.whl Python 3 none any Details for entity_embeddings_categorical-0.6.7-py3-none-any.whl

Total release size: 38.0 kB

Release files / entity_embeddings_categorical-0.6.7.tar.gz

Download URL entity_embeddings_categorical-0.6.7.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d952e3dfd2162005f7dae03f0ab319aa378266494987002f4b4ed555e2809de2
BLAKE2b-256 checksum
How to use checksums
5abfeaddeb7d08b75f1ea1f58f8e2facfaa6f41b09dbc6c13f3f2074dd58f58b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7

Release files / entity_embeddings_categorical-0.6.7-py3-none-any.whl

Download URL entity_embeddings_categorical-0.6.7-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68f4e8a82baa1ad04aad47751f27539bbe1ef4fe2b6a8d4a7a91f27a69d4446c
BLAKE2b-256 checksum
How to use checksums
061d9d4329a476490123d1884d3faac4a2d5899244e0d023a33c6f9a212e7c08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7

Security for entity-embeddings-categorical 0.6.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page