Skip to main content

No project description provided

Project description

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 :-)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entity_embeddings_categorical-0.6.4.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

entity_embeddings_categorical-0.6.4-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file entity_embeddings_categorical-0.6.4.tar.gz.

File metadata

  • Download URL: entity_embeddings_categorical-0.6.4.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for entity_embeddings_categorical-0.6.4.tar.gz
Algorithm Hash digest
SHA256 e92b47f973bf225256422368da32cbc5a1aa51f95b2c436a3dbbe9fac5250b0f
MD5 9d598a37c80a6a3e685cd8900e8520d7
BLAKE2b-256 fbee455b5bdf9a7a09b3713dacd3f2596962a94ed6a3dffad8b91afdfe6f9d03

See more details on using hashes here.

File details

Details for the file entity_embeddings_categorical-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: entity_embeddings_categorical-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for entity_embeddings_categorical-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 79998ddb66c2074b26f113f67244e04a8f415a1d9178279c1204946f6c09dea1
MD5 8aa7fb84e0ca5543545f897bc8210df4
BLAKE2b-256 78fd67de6bc5d9fad3000d70aabcabc657e1a1830cbeba791991d5b90b071448

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page