> ## 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.

# Returns MQ analyze for the model based on the user's config (or model's default config).



## OpenAPI

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

````