Run Objects

Ingejcting runners

driftai.run.decorators.single_run(cls)[source]

Injects a SingleRunner to a RunnableApproach class

RunGenerator

class driftai.run.run_manage.RunGenerator[source]

Responsible of generating runs

Parameters:approach (RunnableApproach) – Approach containing the subdataset info and hyperparameters to generate the runs
add_parameters(param)[source]

Adds an extra hyperparameter to run generator

Parameters:param (AbstractParameter) –
static from_runnable_approach(runnable, extra_parameters=[])[source]

Given a runnable approach generates the runs

Parameters:runnable (RunnableApproach) –
Returns:
Return type:list(Run)

RunPool

class driftai.run.RunPool[source]

Pool to simplify runs iteration

Parameters:
  • runs (list(Run)) – All runs to be executed
  • resume (bool) – If True RunPool will only iterate through pendent|waiting runs, otherwise all runs will be iterated
iteruns()[source]

Iterates to the pending runs

Returns:The next run with status equal to waiting
Return type:Run

Runners

class driftai.run.runner.AbstractRunner[source]

Bases: abc.ABC

run(approach, resume=False)[source]

Runs an approach

class driftai.run.runner.CloudRunner[source]

Bases: driftai.run.runner.AbstractRunner

Runs an approach in a single machine using dask parallelization

run(approach, resume=False)[source]

Runs an approach

class driftai.run.runner.DaskRunner[source]

Bases: driftai.run.runner.AbstractRunner

Runs an approach in a single machine using dask parallelization

run(approach, resume=False)[source]

Runs an approach

class driftai.run.runner.SingleRunner[source]

Bases: driftai.run.runner.AbstractRunner

Runs an approach in a single machine

run(runnable_approach, resume=False)[source]

Runs an approach

Run

class driftai.run.Run[source]
static collection(approach_id)[source]

Get table containing runs

Returns:
Return type:TinyDB instance
done()[source]

Is the comuptation done?

Returns:
Return type:boolean
get_info()[source]

Get the summary of a run instance

Returns:Dict containing a run summary:
{
    "id": <unique identifier>,
    "approach_id": <approach id>,
    "subdataset": <subdataset id>,
    "run_parameters": <hyperparameters of the run>,
    "status": <run status>,
    "results": <dict summarizing driftai.Result instance>,
    "creation_date": <run creationd date>,
    "submitted_date": <when run starts>,
    "finish_date": <when run finishes>,
    "subdataset_set": <subdataset set>
}
Return type:dict
get_test_data()[source]

Get the test data from the run related subdataset set

Returns:Containing records and its labels:
{
    "X": list,
    "y": list
}
Return type:dict
get_train_data()[source]

Get the train data from the run related subdataset set

Returns:Containing records and its labels:
{
    "X": list,
    "y": list
}
Return type:dict
id

Get the unique identifier of the Persistent instance

Returns:Unique identifier
Return type:str
classmethod load(approach_id, id_)[source]

Creates an instance of the cls class using the unique identifier

Parameters:id (str) – Unique identifier of the persistent instance
Returns:Instance created using JSON data comming from tinydb
Return type:Persistent
classmethod load_from_data(data, **kwargs)[source]

Loads a Run from the data coming from TinyDB

Parameters:data (dict) – Dict containing the JSON data
Raises:OptAppSubDatasetInfoFileWrongStructureException – If data has worng keys
Returns:New Run instance
Return type:driftai.Run
results

Get results

Returns:
Return type:driftai.Result
save()[source]

Save a class instance to TinyDB

update()[source]

Updates a class instance to TinyDB