/cozy-global-model-classificator

Generate a bayes model to help the cozy-bank konnectors categorize the bank transactions

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

cozy-global-model-classificator

Install

  1. Install dependencies : yarn

  2. Copy the file data.example.json to data.json

  3. Modify the file data.json with your data

  4. Launch the script: yarn start to generate the file bank_classifier_nb_and_voc.json

  5. Copy the generated json file on your web server

  6. Update your cozy config :

    # Example for cozy.yml
    
    remote_assets:
        bank_classifier_nb_and_voc: $URL_TO_YOUR_JSON_FILE
  7. Reload cozy-stack

How does it work?

Context

The goal of this project is to make available the global categorization model for self-hosted instances of Cozy. This gobal model is shared with all cozy-bank konnectors, if all are compatible with the categorization system of cozy. By default, on self hosted instance, the global model is ignored because the bayes model is missing. Only the local model is used.

Cozy documentation:

The global model is a model specific to hosted Cozy instances. It is not available for self-hosted instances. It will just do nothing in that case.

Workflow

Sequence diagram

Create the bayes model missing

As explained in the workflow, when the model is missing, the konnector goes the next step. This model has a particular format. To create it, the script classificator.js initializes a bayes classificator and reads your data (data.json) to learn them. Then, the script exports the model to a JSON file.

The last step is to copy/move the JSON file to your web server. After that, the model is available and your cozy-bank konnectors can initialize a global model. Congratualations! :)

License

cozy-global-model-classificator is developed by Orandin and distributed under the AGPL v3 license.