(no description)
File Size: | 131 lines (4 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
PCA:: (5 methods):
__construct()
fit()
transform()
calculateMeans()
normalize()
__construct(?float $totalVariance = null, ?int $numFeatures = null) X-Ref |
PCA (Principal Component Analysis) used to explain given data with lower number of dimensions. This analysis transforms the data to a lower dimensional version of it by conserving a proportion of total variance within the data. It is a lossy data compression technique.<br> param: float $totalVariance Total explained variance to be preserved param: int $numFeatures Number of features to be preserved |
fit(array $data) X-Ref |
Takes a data and returns a lower dimensional version of this data while preserving $totalVariance or $numFeatures. <br> $data is an n-by-m matrix and returned array is n-by-k matrix where k <= m |
transform(array $sample) X-Ref |
Transforms the given sample to a lower dimensional vector by using the eigenVectors obtained in the last run of <code>fit</code>. |
calculateMeans(array $data, int $n) X-Ref |
No description |
normalize(array $data, int $n) X-Ref |
Normalization of the data includes subtracting mean from each dimension therefore dimensions will be centered to zero |