Skip to main content

Coverage Status tests PyPI version

Mobagel decanter ai sdk

Decanter AI is a powerful AutoML tool which enables everyone to build ML models and make predictions without data science background. With Decanter AI SDK, you can integrate Decanter AI into your application more easily with Python.

It supports actions such as data uploading, model training, and prediction to run in a more efficient way and access results more easily.

To know more about Decanter AI and how you can be benefited with AutoML, visit MoBagel website and contact us to try it out!

How it works

  • Upload train and test files in both csv and pandas dataframe.
  • Setup different standards and conduct customized experiments on uploaded data.
  • Use different models to run predictions
  • Get predict data in pandas dataframe form.

Requirements

Usage

Installation

pip install decanter-ai-sdk

Constructor

To use this sdk, you must first construct a client object.

from decanter_ai_sdk.client import Client
    client = Client(
        auth_key="auth_API_key",
        project_id="project_id",
        host="host_url",
    )

Upload

After the client is constructed, now you can use it to upload your training and testing files in both csv and pandas dataframe. This function will return uploaded data id in Decanter server.

import os
sys.path.append("..")

current_path = os.path.dirname(os.path.abspath(__file__))
train_file_path = os.path.join(current_path, "ts_train.csv")
train_file = open(train_file_path, "rb")
train_id = client.upload(train_file, "train_file")

Experiment

To conduct an experiment, you need to first specify which type of data you are going to use , i.e., iid or ts, then you can input parameters by following our pyhint to customize your experiment. After the experiment, the function will return an object which you can get experiment attributes from it.

# Training iid data
experiment = client.train_iid(
    experiment_name=exp_name,
    experiment_table_id=train_id,
    target="Survived",
    evaluator=ClassificationMetric.AUC,
    custom_feature_types={
        "Pclass": DataType.categorical,
        "Parch": DataType.categorical,
    },
)
# Training ts data
experiment = client.train_ts(
    experiment_name=exp_name,
    experiment_table_id=train_id,
    target="Passengers",
    datetime="Month",
    time_groups=[],
    timeunit=TimeUnit.month,
    groupby_method="sum",
    max_model=5,
    evaluator=RegressionMetric.MAPE,
    custom_feature_types={"Pclass": DataType.numerical},
)

To get its attributes, you can either extract them by simply using dot or its functions.

# Experiment object usage
best_model = experiment.get_best_model()
model_list = experiment.get_model_list()
best_auc_model = experiment.get_best_model_by_metric(ClassificationMetric.AUC)

Prediction

Now you can use model data to run prediction.

# Predicting iid data
predict = client.predict_iid(
    keep_columns=[], 
    non_negative=False, 
    test_table_id=test_id, 
    model=best_model
)
# Predicting ts data
predict = client.predict_ts(
    keep_columns=[], 
    non_negative=False, 
    test_table_id=test_id, 
    model=best_model
)

To get prediction result, do

predict_data = predict.get_predict_df()

Development

Installing poetry

  1. pip install poetry poethepoet
  2. poetry install #Project setup.
  3. poetry shell #Start your project in poetry env.

Now you can create your own branch to start developing new feature.

Testing

To run test, do:

poe test

Lint and format

To lint, do:

poe lint

To reformat, do:

poe format

Releasing

#TODO

Enums

#TODO

License

#TODO

TODO

#TODO

Metadata

Release files for decanter-ai-sdk 0.1.1

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

Source distribution (sdist)

Source distribution for decanter-ai-sdk 0.1.1
File Size Uploaded Provenance Actions
decanter-ai-sdk-0.1.1.tar.gz 32.4 kB Without provenance Details for decanter-ai-sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for decanter-ai-sdk 0.1.1
File Interpreter ABI Platform Actions
decanter_ai_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for decanter_ai_sdk-0.1.1-py3-none-any.whl

Total release size: 73.8 kB

Release files / decanter-ai-sdk-0.1.1.tar.gz

Download URL decanter-ai-sdk-0.1.1.tar.gz
Size 32.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5ed94b0f0e4b4ba1f4d8477a0ea649f48a4ad0f81742eda043cfaa50447dc0d8
BLAKE2b-256 checksum
How to use checksums
53f778bbdec150a978ca31b217a9d41c4e064e0f4802f9468a2870507ed08b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.10.7 Linux/5.15.0-1020-azure

Release files / decanter_ai_sdk-0.1.1-py3-none-any.whl

Download URL decanter_ai_sdk-0.1.1-py3-none-any.whl
Size 41.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f58b286465343f7ac71e7423dd85a8489db71e712bfb6d302cc2aa1fbd68d72b
BLAKE2b-256 checksum
How to use checksums
e84114944bf2682c44e244bcc1d1424305c0ed1b8b527e0870c7083c28c92f7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.10.7 Linux/5.15.0-1020-azure

Security for decanter-ai-sdk 0.1.1

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