🧠Active Learning
Once the unlabeled data is in Dioptra, running Active Learning Miners can be done in just a few lines of code.
Step 1: define your filters
Define the filters to select the data to mine from. It's like SQL.
We support standard operators =
, !=
, >
, <
, >=
, <=
, in
, not in
, like
, not like
filters = [{
'left': 'tags.name',
'op': '=',
'right': 'model_id'
}, {
'left': 'tags.value',
'op': '=',
'right': 'anomaly_detection'
}, {
'left': 'tags.name',
'op': '=',
'right': 'model_version'
}, {
'left': 'tags.value',
'op': '=',
'right': 'v1'
}]
Step 2: Create your miner, run it and wait for the results
import time
from dioptra.miners.entropy_miner import EntropyMiner
my_miner = EntropyMiner('my entropy miner', budget=100, filters=filters)
my_miner.run()
datapoint_ids = my_miner.get_results()
Step 3: get the resulting datapoints from the lake
from dioptra.lake.utils import select_datapoints
datapoint_ids = my_miner.get_results()
results_df = select_datapoints(filters=[{
'left': 'id',
'op': 'in',
'right': ids
}])
# do stuff with the results
Last updated
Was this helpful?