Skip to main content

AccernXYME is a library for easily accessing XYME via python.

Project description

accern_xyme is a python library for accessing XYME functionality.

CircleCI

Usage

You can install accern_xyme with pip:

pip install --user accern-xyme

Import it in python via:

from accern_xyme import create_xyme_client

client = accern_xyme.create_xyme_client(
    "https://xyme.accern.com/", "<USERNAME>", "<PASSWORD>")
print(client.get_user_info())

<USERNAME> and <PASSWORD> are the login credentials for XYME. The values can also be set to None in which case the values must be set in the environment variables ACCERN_USER and ACCERN_PASSWORD. A login token can also be provided.

You will need python3.6 or later.

Exploring Workspaces

The workspaces of the user can be retrieved via:

for (workspace, count) in client.get_workspaces().items():
    print(f"{workspace} contains {count} jobs"

And jobs in a given workspace can be retrieved via:

for job in client.get_jobs(workspace):
    print(f"{job.get_job_id()}: {job.get_name()} - {job.get_status()}"

Or directly by Job ID:

job = client.get_job_id("username_example_com/job_id")

Starting Jobs

A new job can be started via:

# creating the job
job = client.create_job(schema=schema_obj, name="my job")

with job.update_schema() as cur:
    # updating the schema
    cur["M"]["params"]["hidden_layer_sizes"] = [100, 100, 100]

# starting the job
job.start()

import time
time.sleep(30)

print(job.get_status())

Computing Predictions

Predictions can be obtained for a finished or running job:

# predict_proba is also available
predictions, stdout = job.predict(df)
print(stdout)

print("prediction of first row: ", predictions.iloc[0])

Project details


Download files

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

Files for accern-xyme, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size accern_xyme-0.0.8-py2.py3-none-any.whl (20.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size accern_xyme-0.0.8.tar.gz (21.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page