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

# Compute Embedding

> Compute dimensionality reduction embedding for visualization.



## OpenAPI

````yaml /api-reference/openapi.json post /api/playground/sessions/{session_id}/embedding
openapi: 3.1.0
info:
  title: Blindsight API
  version: 0.1.0
servers: []
security: []
paths:
  /api/playground/sessions/{session_id}/embedding:
    post:
      tags:
        - playground
      summary: Compute Embedding
      description: Compute dimensionality reduction embedding for visualization.
      operationId: compute_embedding_api_playground_sessions__session_id__embedding_post
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: blindsight_session
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Blindsight Session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    EmbeddingRequest:
      properties:
        method:
          type: string
          enum:
            - pca
            - tsne
            - umap
          title: Method
          default: umap
        dimensions:
          type: integer
          enum:
            - 2
            - 3
          title: Dimensions
          default: 3
        feature_columns:
          items:
            type: string
          type: array
          minItems: 1
          title: Feature Columns
        label_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Label Column
        n_neighbors:
          type: integer
          maximum: 100
          minimum: 2
          title: N Neighbors
          default: 15
        min_dist:
          type: number
          maximum: 1
          minimum: 0
          title: Min Dist
          default: 0.1
        perplexity:
          type: integer
          maximum: 100
          minimum: 5
          title: Perplexity
          default: 30
        sample_size:
          anyOf:
            - type: integer
              maximum: 100000
              minimum: 100
            - type: 'null'
          title: Sample Size
          default: 10000
      type: object
      required:
        - feature_columns
      title: EmbeddingRequest
    EmbeddingResponse:
      properties:
        session_id:
          type: string
          title: Session Id
        method:
          type: string
          title: Method
        dimensions:
          type: integer
          title: Dimensions
        point_count:
          type: integer
          title: Point Count
        points:
          items:
            $ref: '#/components/schemas/EmbeddingPoint'
          type: array
          title: Points
        clusters:
          items:
            $ref: '#/components/schemas/ClusterInfo'
          type: array
          title: Clusters
      type: object
      required:
        - session_id
        - method
        - dimensions
        - point_count
        - points
        - clusters
      title: EmbeddingResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EmbeddingPoint:
      properties:
        index:
          type: integer
          title: Index
        x:
          type: number
          title: X
        'y':
          type: number
          title: 'Y'
        z:
          anyOf:
            - type: number
            - type: 'null'
          title: Z
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        cluster:
          type: integer
          title: Cluster
      type: object
      required:
        - index
        - x
        - 'y'
        - cluster
      title: EmbeddingPoint
    ClusterInfo:
      properties:
        id:
          type: integer
          title: Id
        size:
          type: integer
          title: Size
        centroid:
          items:
            type: number
          type: array
          title: Centroid
        description:
          type: string
          title: Description
          default: ''
        top_labels:
          items:
            $ref: '#/components/schemas/ClusterLabelInfo'
          type: array
          title: Top Labels
          default: []
        top_features:
          items:
            $ref: '#/components/schemas/ClusterFeatureInfo'
          type: array
          title: Top Features
          default: []
      type: object
      required:
        - id
        - size
        - centroid
      title: ClusterInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ClusterLabelInfo:
      properties:
        label:
          type: string
          title: Label
        count:
          type: integer
          title: Count
        percentage:
          type: number
          title: Percentage
      type: object
      required:
        - label
        - count
        - percentage
      title: ClusterLabelInfo
    ClusterFeatureInfo:
      properties:
        feature:
          type: string
          title: Feature
        direction:
          type: string
          title: Direction
        z_score:
          type: number
          title: Z Score
        mean:
          type: number
          title: Mean
        global_mean:
          type: number
          title: Global Mean
      type: object
      required:
        - feature
        - direction
        - z_score
        - mean
        - global_mean
      title: ClusterFeatureInfo
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````