> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze model quality



## OpenAPI

````yaml /api-specs/cloud/dmm.json post /model-monitor/v2/api/model/{model_id}/analyze-model-quality
openapi: 3.0.3
info:
  description: The API for programmatic access to Domino Model Monitor.
  title: Domino Model Monitor API
  version: 1.0.1
servers:
  - description: >-
      Replace 'mycluster.domino.tech' with your Domino cluster hostname. For
      Domino Cloud customers, that is `your-subdomain`.domino.tech (e.g.,
      acme.domino.tech). For self-hosted deployments, it is the hostname you
      reach the Domino UI at.
    url: https://mycluster.domino.tech
security: []
tags:
  - description: All Dataset Job related operations.
    name: DatasetJob
  - description: All data source related operations.
    name: DataSource
  - description: All Model related operations.
    name: Model
  - description: Operations related to the management of model tags.
    name: ModelTag
  - description: All Model drift related operations.
    name: ModelDrift
  - description: All Model quality related operations.
    name: ModelQuality
  - description: All Workbench related operations.
    name: Workbench
  - description: Operations related to drift and model quality defaults setting in DMM.
    name: DefaultSettings
  - description: Operations related to configuring user related settings for DMM.
    name: UserSettings
  - description: >-
      Operations related to configuring notification channel config and alert
      recipients for the model.
    name: Notification
  - description: Other miscellaneous operations.
    name: Other
  - description: All scheduler related operations
    name: Scheduler
paths:
  /model-monitor/v2/api/model/{model_id}/analyze-model-quality:
    summary: >
      Returns MQ analyze for the model based on the user's config (or model's
      default config).
    parameters:
      - description: Identifier for the model to be updated.
        in: path
        name: model_id
        required: true
        schema:
          type: string
    post:
      tags:
        - ModelQuality
      summary: Analyze model quality
      operationId: analyzeModelQuality
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/modelQualityQueryRequest'
        description: ''
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/modelQualityAnalyzeResponse'
          description: The MQ analyze query was done successfully.
        '204':
          description: Empty response.
        '400':
          description: Bad request input data.
        '403':
          description: Forbidden. The endpoint enforces permissions.
        '500':
          description: Internal server error, check server logs.
      security:
        - DominoApiKeyAuth: []
        - DmmApiKeyAuth: []
        - cookieAuth: []
        - BearerAuth: []
components:
  schemas:
    modelQualityQueryRequest:
      discriminator:
        mapping:
          classification:
            $ref: '#/components/schemas/modelQualityClassificationQuery'
          regression:
            $ref: '#/components/schemas/modelQualityRegressionQuery'
        propertyName: modelType
      oneOf:
        - $ref: '#/components/schemas/modelQualityRegressionQuery'
        - $ref: '#/components/schemas/modelQualityClassificationQuery'
    modelQualityAnalyzeResponse:
      discriminator:
        mapping:
          classification:
            $ref: '#/components/schemas/classificationModelQualityAnalyzeResponse'
          regression:
            $ref: '#/components/schemas/regressionModelQualityAnalyzeResponse'
        propertyName: modelType
      oneOf:
        - $ref: '#/components/schemas/classificationModelQualityAnalyzeResponse'
        - $ref: '#/components/schemas/regressionModelQualityAnalyzeResponse'
    modelQualityClassificationQuery:
      allOf:
        - $ref: '#/components/schemas/metricQueryCommon'
        - properties:
            metricCheckConfigs:
              items:
                $ref: '#/components/schemas/classificationCheckConfig'
              type: array
          required:
            - metricCheckConfigs
          type: object
      description: Query config for Classification model
      title: Classification Metric Query
    modelQualityRegressionQuery:
      allOf:
        - $ref: '#/components/schemas/metricQueryCommon'
        - properties:
            metricCheckConfigs:
              items:
                $ref: '#/components/schemas/regressionCheckConfig'
              type: array
          required:
            - metricCheckConfigs
          type: object
      description: Query config for Regression model
      title: Regression Metric Query
    classificationModelQualityAnalyzeResponse:
      allOf:
        - $ref: '#/components/schemas/modelQualityAnalyzeCommonResponse'
        - properties:
            classificationReport:
              $ref: '#/components/schemas/classificationReport'
            confusionMatrix:
              $ref: '#/components/schemas/confusionMatrix'
          required:
            - confusionMatrix
            - classificationReport
          type: object
    regressionModelQualityAnalyzeResponse:
      allOf:
        - $ref: '#/components/schemas/modelQualityAnalyzeCommonResponse'
    metricQueryCommon:
      description: Metric Query Common components acrooss all metrics.
      properties:
        endTimestamp:
          type: number
        modelType:
          $ref: '#/components/schemas/modelType'
        startTimestamp:
          type: number
      required:
        - modelType
      title: Metric Query Common components
      type: object
    classificationCheckConfig:
      allOf:
        - $ref: '#/components/schemas/metricCheckConfigCommon'
        - properties:
            metricType:
              $ref: '#/components/schemas/classificationMetrics'
          required:
            - metricType
          type: object
    regressionCheckConfig:
      allOf:
        - $ref: '#/components/schemas/metricCheckConfigCommon'
        - properties:
            metricType:
              $ref: '#/components/schemas/regressionMetrics'
          required:
            - metricType
          type: object
    modelQualityAnalyzeCommonResponse:
      properties:
        calculatedOn:
          description: Timestamp of time when the query was performed.
          title: Query Time
          type: number
        endTimestamp:
          description: End time for the data used for the query.
          title: End Timestamp
          type: number
        matchedRowCount:
          description: Number of matched Ground Truth and Prediction rows for this query.
          type: number
        metricTestResults:
          description: Metric Test Results for the queries.
          items:
            $ref: '#/components/schemas/metricTestResult'
          title: Metric Test Results
          type: array
        modelType:
          $ref: '#/components/schemas/modelType'
        startTimestamp:
          description: Start time for the data used for the query.
          title: Start Timestamp
          type: number
      required:
        - modelType
        - calculatedOn
        - startTimestamp
        - endTimestamp
        - metricTestResults
        - matchedRowCount
      type: object
    classificationReport:
      description: >-
        List of Metrics per label, List of Macro and Weighted Averaged metrics,
        and Micro Accuracy value
      nullable: true
      properties:
        accuracyReport:
          $ref: '#/components/schemas/AccuracyReport'
        averagesReport:
          description: >-
            Macro averaged and weighted averaged Precision, Recall, F1Score, and
            Support
          items:
            $ref: '#/components/schemas/ClassificationReportMetrics'
          type: array
        labelsReport:
          description: List of Precision, Recall, F1Score, and Support per label
          items:
            $ref: '#/components/schemas/ClassificationReportMetrics'
          type: array
      required:
        - labelsReport
        - accuracyReport
        - averagesReport
      title: MQ Classification Report Object
      type: object
    confusionMatrix:
      nullable: true
      properties:
        labels:
          items:
            type: string
          type: array
        matrix:
          items:
            items:
              type: integer
            type: array
          type: array
      required:
        - matrix
        - labels
      type: object
    modelType:
      description: Type of the model
      type: string
    metricCheckConfigCommon:
      description: Query config Common components
      properties:
        alertsEnabled:
          description: Whether this feature is alertable for not
          title: Alertable
          type: boolean
        threshold:
          $ref: '#/components/schemas/metricCheckThreshold'
      required:
        - alertsEnabled
        - threshold
      title: Metric Query config Common components
      type: object
    classificationMetrics:
      description: A Classification Metric Name
      enum:
        - accuracy
        - precision
        - recall
        - f1
        - auc_roc
        - log_loss
        - classification_normalized_weighted_gini
      title: Classification Metrics
      type: string
    regressionMetrics:
      description: A Regression Metric Name
      enum:
        - mse
        - mae
        - mape
        - r2
        - regression_normalized_weighted_gini
      title: Regression Metric
      type: string
    metricTestResult:
      allOf:
        - $ref: '#/components/schemas/metricTestResultCommon'
        - properties:
            trend:
              items:
                $ref: '#/components/schemas/MetricTrend'
              type: array
          required:
            - trend
          type: object
    AccuracyReport:
      description: >-
        MQ Accuracy Report Object providing overall weighted averaged accuracy
        for classification report
      nullable: true
      properties:
        support:
          description: >-
            Overall Support, in this case would be the sum of the confusion
            matrix
          type: integer
        value:
          description: Micro Accuracy
          nullable: true
          type: number
      required:
        - value
        - support
      title: MQ Accuracy Report Object
      type: object
    ClassificationReportMetrics:
      description: >-
        MQ Classification Report object providing classwise and averaged metric
        values
      properties:
        f1Score:
          description: Classwise or Averaged F1 score
          nullable: true
          type: number
        heading:
          description: Class label and Average type like "weighted avg" or "macro avg"
          type: string
        precision:
          description: Classwise or Averaged Precision score
          nullable: true
          type: number
        recall:
          description: Classwise or Averaged Recall score
          nullable: true
          type: number
        support:
          description: Classwise or overall Support
          type: integer
      required:
        - heading
        - support
      title: MQ Classification Report Object
      type: object
    metricCheckThreshold:
      description: Check Thresholds at which the check fails
      properties:
        lowerThreshold:
          description: The lower bound for the metric check
          title: Lower Bound
          type: number
        operator:
          description: The math operator for the condition, like < or <=.
          title: Math Operator
          type: string
        upperThreshold:
          description: The upper bound for the metric check
          title: Upper Bound
          type: number
      required:
        - operator
        - lowerThreshold
        - upperThreshold
      title: Metric Check Thresholds
      type: object
    metricTestResultCommon:
      properties:
        alertsEnabled:
          description: Boolean value to determine if Alerts are Enabled
          title: Are Alerts Enabled
          type: boolean
        metricType:
          description: Metric name
          title: Metric name
          type: string
        numberOfRecords:
          description: Ground Truth matched records
          title: Number of ground truth records matched with prediction
          type: integer
        status:
          description: Status of the check for the metric.
          nullable: true
          title: Metric check status
          type: boolean
        threshold:
          $ref: '#/components/schemas/metricCheckThreshold'
        value:
          description: Metric computed value
          nullable: true
          title: Metric Value
          type: number
      required:
        - metricType
        - threshold
        - alertsEnabled
      type: object
    MetricTrend:
      properties:
        numberOfRows:
          description: Number of rows for this trend point.
          type: number
        timestamp:
          description: Timestamp of the date for which this trend point exists.
          type: number
        value:
          description: Value of the trend point.
          nullable: true
          type: number
      required:
        - timestamp
      type: object
  securitySchemes:
    DominoApiKeyAuth:
      in: header
      name: X-Domino-Api-Key
      type: apiKey
    DmmApiKeyAuth:
      in: header
      name: X-DMM-API-KEY
      type: apiKey
    cookieAuth:
      in: cookie
      name: PLAY_SESSION
      type: apiKey
    BearerAuth:
      scheme: bearer
      type: http

````

## Related topics

- [Analyze model quality](/cloud/platform-capabilities/features/monitoring/5-use-monitoring/4-analyze-model-quality.md)
- [Data drift and quality monitoring](/cloud/platform-capabilities/features/monitoring/2-data-drift-and-model-quality.md)
- [Use monitoring](/cloud/platform-capabilities/features/monitoring/5-use-monitoring/index.md)
- [Set up model quality monitoring](/cloud/platform-capabilities/features/monitoring/3-set-up-domino-endpoints/3-set-up-model-qual-monitor.md)
