pyqpanda_alg.QPCA.QPCA
¶
Module Contents¶
Functions¶
|
QPCA is a quantum version of the classical PCA algorithm, which is widely used in data analysis and machine learning. |
- pyqpanda_alg.QPCA.QPCA.qpca(sample_A, k)¶
QPCA is a quantum version of the classical PCA algorithm, which is widely used in data analysis and machine learning.
- Parameters:
sample_A:
ndarray
the input matrix for analysis
k:
int
the dimension to reduce
- Returns:
out:
ndarray
the output matrix after reducing dimension
- Examples:
import numpy as np from pyqpanda_alg.QPCA.QPCA import qpca A = np.array([[-1, 2], [-2, -1], [-1, -2], [1, 3], [2, 1], [3, 2]]) data_q = qpca(A, 1) print(data_q)