---
title: "Fetch Score Bands"
method: POST
path: "/method/emo/fetch_score"
tags: ["EMO"]
---

# Fetch Score Bands

`POST /method/emo/fetch_score`

Fetches results from a completed EMO method.

Args:
    request (EMOFetchRequest): The request object containing parameters for fetching results and of the SCORE bands
        visualization.
    user (Annotated[User, Depends]): The current user.
    session (Annotated[Session, Depends]): The database session.

Raises:
    HTTPException: If the request is invalid or the EMO method has not completed.

Returns:
    SCOREBandsResult: The results of the SCORE bands visualization.

## Request body

- EMOScoreRequest — Request model for getting SCORE bands visualization data from state.
  - `problem_id` integer, required — Database ID of the problem to solve.
  - `session_id` integer, nullable
  - `parent_state_id` integer, nullable — State ID of the parent state, if any.
  - `config` SCOREBandsConfig — Configuration options for SCORE bands visualization.
    - `dimensions` string[], nullable — List of variable/objective names (i.e., column names in the data) to include in the visualization. If None, all columns in the data are used. Defaults to None.
    - `axis_positions` object, nullable — Dictionary mapping objective names to their positions on the axes in the SCORE bands visualization. The first objective is at position 0.0, and the last objective is at position 1.0. Use this option if you want to manually set the axis positions. If None, the axis positions are calculated automatically based on correlations. Defaults to None.
    - `clustering_algorithm` union — Clustering algorithm to use. Currently supported options: "GMM", "DBSCAN", and "KMeans". Defaults to "DBSCAN".
      - GMMOptions — Options for Gaussian Mixture Model clustering algorithm.
        - `name` string — Gaussian Mixture Model clustering algorithm.
        - `scoring_method` 'BIC' | 'silhouette' — Scoring method to use for GMM. Either "BIC" or "silhouette". Defaults to "silhouette". This option determines how the number of clusters is chosen.
      - DBSCANOptions — Options for DBSCAN clustering algorithm.
        - `name` string — DBSCAN clustering algorithm.
      - KMeansOptions — Options for KMeans clustering algorithm.
        - `name` string — KMeans clustering algorithm.
        - `n_clusters` integer — Number of clusters to use. Defaults to 5.
      - DimensionClusterOptions — Options for clustering by one of the objectives/decision variables.
        - `name` string — Clustering by one of the dimensions.
        - `dimension_name` string, required — Dimension to use for clustering.
        - `n_clusters` integer — Number of clusters to use. Defaults to 5.
        - `kind` 'EqualWidth' | 'EqualFrequency' — Kind of clustering to use. Either "EqualWidth", which divides the dimension range into equal width intervals, or "EqualFrequency", which divides the dimension values into intervals with equal number of solutions. Defaults to "EqualWidth".
      - CustomClusterOptions — Options for custom clustering provided by the user.
        - `name` string — Custom user-provided clusters.
        - `clusters` integer[], required — List of cluster IDs (one for each solution) indicating the cluster to which each solution belongs.
    - `distance_formula` 1 | 2 — Distance formulas supported by SCORE bands. See the paper for details.
    - `distance_parameter` number — Change the relative distances between the objective axes. Increase this value if objectives are placed too close together. Decrease this value if the objectives are equidistant in a problem with objective clusters. Defaults to 0.05.
    - `use_absolute_correlations` boolean — Whether to use absolute value of the correlation to calculate the placement of axes. Defaults to False.
    - `include_solutions` boolean — Whether to include individual solutions. Defaults to False. If True, the size of the resulting figure may be very large for datasets with many solutions. Moreover, the individual traces are hidden by default, but can be viewed interactively in the figure.
    - `include_medians` boolean — Whether to include cluster medians. Defaults to False. If True, the median traces are hidden by default, but can be viewed interactively in the figure.
    - `interval_size` number — The size (as a fraction) of the interval to use for the bands. Defaults to 0.95, meaning that 95% of the middle solutions in a cluster will be included in the band. The rest will be considered outliers.
    - `scales` object, nullable — Optional dictionary specifying the min and max values for each objective. The keys should be the objective names (i.e., column names in the data), and the values should be tuples of (min, max). If not provided, the min and max will be calculated from the data.
  - `solution_ids` integer[], required — List of solution IDs to score.

## Response `200`

Successful Response

- EMOScoreResponse — Model of the response to an EMO score request.
  - `state_id` integer, nullable — The state ID of the newly created state.
  - `result` SCOREBandsResult, required — Pydantic/JSON model for representing SCORE Bands.
    - `options` SCOREBandsConfig, required — Configuration options for SCORE bands visualization.
      - `dimensions` string[], nullable — List of variable/objective names (i.e., column names in the data) to include in the visualization. If None, all columns in the data are used. Defaults to None.
      - `axis_positions` object, nullable — Dictionary mapping objective names to their positions on the axes in the SCORE bands visualization. The first objective is at position 0.0, and the last objective is at position 1.0. Use this option if you want to manually set the axis positions. If None, the axis positions are calculated automatically based on correlations. Defaults to None.
      - `clustering_algorithm` union — Clustering algorithm to use. Currently supported options: "GMM", "DBSCAN", and "KMeans". Defaults to "DBSCAN".
        - GMMOptions — Options for Gaussian Mixture Model clustering algorithm.
          - `name` string — Gaussian Mixture Model clustering algorithm.
          - `scoring_method` 'BIC' | 'silhouette' — Scoring method to use for GMM. Either "BIC" or "silhouette". Defaults to "silhouette". This option determines how the number of clusters is chosen.
        - DBSCANOptions — Options for DBSCAN clustering algorithm.
          - `name` string — DBSCAN clustering algorithm.
        - KMeansOptions — Options for KMeans clustering algorithm.
          - `name` string — KMeans clustering algorithm.
          - `n_clusters` integer — Number of clusters to use. Defaults to 5.
        - DimensionClusterOptions — Options for clustering by one of the objectives/decision variables.
          - `name` string — Clustering by one of the dimensions.
          - `dimension_name` string, required — Dimension to use for clustering.
          - `n_clusters` integer — Number of clusters to use. Defaults to 5.
          - `kind` 'EqualWidth' | 'EqualFrequency' — Kind of clustering to use. Either "EqualWidth", which divides the dimension range into equal width intervals, or "EqualFrequency", which divides the dimension values into intervals with equal number of solutions. Defaults to "EqualWidth".
        - CustomClusterOptions — Options for custom clustering provided by the user.
          - `name` string — Custom user-provided clusters.
          - `clusters` integer[], required — List of cluster IDs (one for each solution) indicating the cluster to which each solution belongs.
      - `distance_formula` 1 | 2 — Distance formulas supported by SCORE bands. See the paper for details.
      - `distance_parameter` number — Change the relative distances between the objective axes. Increase this value if objectives are placed too close together. Decrease this value if the objectives are equidistant in a problem with objective clusters. Defaults to 0.05.
      - `use_absolute_correlations` boolean — Whether to use absolute value of the correlation to calculate the placement of axes. Defaults to False.
      - `include_solutions` boolean — Whether to include individual solutions. Defaults to False. If True, the size of the resulting figure may be very large for datasets with many solutions. Moreover, the individual traces are hidden by default, but can be viewed interactively in the figure.
      - `include_medians` boolean — Whether to include cluster medians. Defaults to False. If True, the median traces are hidden by default, but can be viewed interactively in the figure.
      - `interval_size` number — The size (as a fraction) of the interval to use for the bands. Defaults to 0.95, meaning that 95% of the middle solutions in a cluster will be included in the band. The rest will be considered outliers.
      - `scales` object, nullable — Optional dictionary specifying the min and max values for each objective. The keys should be the objective names (i.e., column names in the data), and the values should be tuples of (min, max). If not provided, the min and max will be calculated from the data.
    - `ordered_dimensions` string[], required — List of variable/objective names (i.e., column names in the data). Ordered according to their placement in the SCORE bands visualization.
    - `clusters` integer[], required — List of cluster IDs (one for each solution) indicating the cluster to which each solution belongs.
    - `axis_positions` object, required — Dictionary mapping objective names to their positions on the axes in the SCORE bands visualization. The first objective is at position 0.0, and the last objective is at position 1.0.
    - `bands` object, required — Dictionary mapping cluster IDs to dictionaries of objective names and their corresponding band extremes (min, max).
    - `medians` object, required — Dictionary mapping cluster IDs to dictionaries of objective names and their corresponding median values.
    - `cardinalities` object, required — Dictionary mapping cluster IDs to the number of solutions in each cluster.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/industrial-optimization-group/apis/desdeo-fast-api.md) · [All operations](https://skmtc.net/industrial-optimization-group/apis/desdeo-fast-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/industrial-optimization-group/desdeo-fast-api/revisions/c24fa4e23380/schema)
