Models API
Learn how to query models using our programmatic API
Models belong to a
Space
. Because of this, you can either query for models off of a Space
node or a Model
node directly.The model or space id is in the url when you visit the corresponding page. The format looks like this:
spaces/:
space
_id/models/:
model_id
.
Query Model Directly
Query by Space
query {
node(id: "model_id") {
... on Model {
name
modelType
uri
}
}
}
query {
node(id: "space_id") {
... on Space {
models(first: 50) {
edges {
node {
id
name
}
}
}
}
}
}
The
ModelsConnection
off of Space
provides a convenient way for you to pull models that match the given criteria. If you have a large number of models, you will have to use pagination to pull the complete list. This data can then be structured to your liking and be exported to the platform of your choosing. You can query your model's schema through the Arize GraphQL API. The
ModelSchema
type contains important information about your models such as features
, tags
, predictions
and actuals
which is useful when programmatically creating Monitors. Querying a Model's schema can return the equivalent of thousands of REST requests, resulting in a high computation cost on our servers. Be mindful of your complexity score to ensure your call falls within our complexity cost limit. More details here.
query {
node(id: "model_id") {
... on Model {
name
modelSchema {
features(first: 10) {
edges {
node {
dimension {
name
}
}
}
}
}
}
}
}
You can query binning information relating to your model's
features
, actuals
, predictions
and tags
. Query by Model Schema
Create / Update a Dimension Configuration
query {
node(id: "model_id") {
... on Model {
name
modelSchema {
features(first: 10) {
edges {
node {
dimensionConfig {
id
dimensionName
dimensionCategory
numBins
binOption
bins
}
}
}
}
}
}
}
}
mutation CreateOrUpdateDimensionConfiguration(
$input: UpdateDimensionConfigMutationInput!
) {
updateDimensionConfig(input: $input) {
dimensionConfig {
dimensionName
binOption
numBins
bins
id
}
}
}
variables
{
"input": {
"modelId": "model_id",
"dimensionName": "dimension_name",
"dimensionCategory": "featureLabel",
"binOption": "equalWidth",
"numBins": 4
}
Last modified 3mo ago