Skip to main content
POST
/
quantlib
/
ml
/
clustering
/
pca
Principal Component Analysis (PCA)
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/ml/clustering/pca \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "X": [
    [
      1.2,
      0.5,
      3.1,
      2.3
    ],
    [
      2.1,
      1.3,
      2.5,
      1.8
    ],
    [
      0.8,
      0.9,
      4.2,
      3.1
    ]
  ],
  "n_components": 2
}
'
{
  "success": true,
  "data": {
    "transformed": [
      [
        2.34,
        -0.56
      ],
      [
        1.87,
        0.23
      ],
      [
        3.12,
        -0.89
      ]
    ],
    "n_components": 2,
    "explained_variance_ratio": [
      0.734,
      0.189
    ]
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
X
number[][]
required

Feature matrix (high-dimensional data)

Example:
[
[1.2, 0.5, 3.1, 2.3],
[2.1, 1.3, 2.5, 1.8],
[0.8, 0.9, 4.2, 3.1]
]
n_components
integer
default:2

Number of principal components

Example:

2

Response

PCA transformation results

success
boolean
Example:

true

data
object