⛏️Miners SDK

You can use several types of miners with Dioptra based on the type of model issues you are trying to resolve

Miner catalog

Entropy mining

More details about the when to use this here

from dioptra.miners.entropy_miner import EntropyMiner
class EntropyMiner(
    display_name: str,
    size: int,
    model_name: str,
    select_filters: List[object],
    select_limit: Optional[int],
    select_order_by: Optional[str],
    select_desc: Optional[bool]
):
Parameter
Decription

name of the miner

number of datapoints to sample

name of the model to get the prediction from. If used with EMBEDDINGS then the model name should include the layer name with the format model_name:layer_name

a lml like list of filters to select the data to mine from

a limit to the number of datapoints to sample from

the name of a field to order by when doing selection of the data to mine from. This is useful when used with limit to control the which datapoints are selected. For ex: the last 1000 datapoints ordered by timestamp

whether to order desc or asc. should be used with select_order_by

Activation mining

More details about the when to use this here

Parameter
Decription

name of the miner

number of datapoints to sample

name of the model to get the prediction from. If used with EMBEDDINGS then the model name should include the layer name with the format model_name:layer_name

the field to use. Could be EMBEDDINGS or LOGITS

a dioptra like list of filters to select the data to mine from

a limit to the number of datapoints to sample from

the name of a fielld to order by when doing selection of the data to mine from. This is useful when used with limit to control the which datapoints are selected. For ex: the last 1000 datapoints ordered by timestamp

whether to order desc or asc. should be used with select_order_by

KNN mining

More details about the when to use this here

Parameter
Decription

name of the miner

number of datapoints to sample

Name of the model to get the prediction from. The model name should include the layer name with the format model_name:layer_name

the metric to be used to assess similarity. Could be euclidean or cosine

a dioptra like list of filters to select the data to mine from

a limit to the number of datapoints to sample from

the name of a field to order by when doing selection of the data to mine from. This is useful when used with limit to control the which datapoints are selected. For ex: the last 1000 datapoints ordered by timestamp

whether to order desc or asc. should be used with select_order_by

same as above but to select the reference data to do similarity from

same as above but to select the reference data to do similarity from

same as above but to select the reference data to do similarity from

same as above but to select the reference data to do similarity from

Coreset mining

More details about the when to use this here

Parameter
Decription

name of the miner

number of datapoints to sample

name of the model to get the prediction from. The model name should include the layer name with the format model_name:layer_name

the metric to be used to assess similarity. Could be euclidean or cosine

a dioptra like list of filters to select the data to mine from

a limit to the number of datapoints to sample from

the name of a field to order by when doing selection of the data to mine from. This is useful when used with limit to control the which datapoints are selected. For ex: the last 1000 datapoints ordered by timestamp

whether to order desc or asc. should be used with select_order_by

same as above but to select the data that is already in the training dataset for coreset

same as above but to select the data that is already in the training dataset for coreset

same as above but to select the data that is already in the training dataset for coreset

same as above but to select the data that is already in the training dataset for coreset

BADGE mining

More details about the when to use this here

Parameter
Decription

name of the miner

number of datapoints to sample

name of the model to get the prediction from. The model name should include the layer name with the format model_name:layer_name

a dioptra like list of filters to select the data to mine from

a limit to the number of datapoints to sample from

the name of a field to order by when doing selection of the data to mine from. This is useful when used with limit to control the which datapoints are selected. For ex: the last 1000 datapoints ordered by timestamp

whether to order desc or asc. should be used with select_order_by

Weighted Entropy mining

More details about the when to use this here

Getting an existing miner

To get an existing miner, you can set the miner_id of a BaseMiner

Listing all miners

To get the list of all miners, you can use the list_miners utility

Running a miner

Once a miner is created, you can run

Getting Status

While the miner runs, you can get its status. It can either me SUCCESS, PROCESSING, or FAILURE

Get Results

After a run is finished, you can retrieved the results. The results are a list of the uuid of the datapoints selected. You can get the datapoints using the select_datapoints utility method.

Get Config

To get the config of a miner you can call the get_config method

Delete

To delete a miner call the delete method

Reset

You can reset a miner to clear its results

Last updated

Was this helpful?