Dioptra Documentation
  • What is KatiML ?
  • Overview
    • 🏃Getting Started
    • 🌊KatiML
      • Quick start
      • Ingestion basics
      • Ingestion SDK
      • Query basics
      • Query SDK
      • Dataset basics
      • Dataset SDK
      • Supported fields
      • Matching local data with Kati ML IDs
      • Managing Datapoints with Tags
      • Configuring Object Stores (optional)
    • 🧠Active Learning
      • 📖Miners basics
      • ⛏️Miners SDK
      • 🚗[Experimental] Mining on the edge
    • 🤖PyTorch and Tensorflow integrations
      • Tensorflow
      • PyTorch
  • 😬Enough docs, show me some code !
  • 📑Case studies
  • Definitions
Powered by GitBook
On this page
  • Query the Datapoints / Predictions / Groundtruths
  • Joining query results
  • Deleting

Was this helpful?

  1. Overview
  2. KatiML

Query SDK

Query the Datapoints / Predictions / Groundtruths

To query the Datapoints, Predictions or Groundtruths, you can use the select_datapoints select_predictions , select_groundtruths utilities. The output is a pandas DataFrame

from dioptra.lake.utils import (
    select_datapoints,
    select_predictions,
    select_groundtruths
)
def select_datapoints( # similarly select_predictions and select_groundtruths
    fields: List[str] -> ['*'],
    filters: List[object],
    limit: Optional[int],
    order_by: Optional[str],
    desc: Optional[bool]
)
Parameter
Description

the list of fields to be retrieved. To query sub fields, use a jq format. For example: image_metadata.uri

A list of filters to be used to query the data. Should follow the format {

'left': 'my_field',

'op': '=', 'right:

'my_value'

} Supported operators are =, !=, >, <, >=, <=, in, not in, like, not like

limit to the number of datapoints to query

the name of a field to order by when doing a limit This is to control the order on which the limit is applied

whether the order should be desc or asc

Joining query results

To join query results in a single DataFrame, you can use the join_on_datapoints utility

from dioptra.lake.utils import join_on_datapoints
def join_on_datapoints(
    datapoints: DataFrame,
    predictions: DataFrame,
    groundtruths: DataFrame,
)
Parameter
Description

a DataFrame containing the datapoints

a DataFrame containing the predictions

a DataFrame containing the groundtruths

Deleting

To delete datapoints, predictions or ground truths, use the delete_xxx functions. Note that deleting a datapoint will delete all attachment: groundtruths, tags, predictions.

from dioptra.lake.utils import delete_datapoints, delete_predictions, delete_groundtruths

def delete_datapoints(filters, limit=None, order_by=None, desc=None)

def delete_predictions(prediction_ids)

def delete_groundtruths(groundtruth_ids)
PreviousQuery basicsNextDataset basics

Last updated 2 years ago

Was this helpful?

🌊
fields
filters
limit
order_by
desc
datapoints
predictions
groundtruths