Driver function to execute PCA and display results.
()
| 62 | |
| 63 | |
| 64 | def main() -> None: |
| 65 | """ |
| 66 | Driver function to execute PCA and display results. |
| 67 | """ |
| 68 | data_x, _data_y = collect_dataset() |
| 69 | |
| 70 | # Number of principal components to retain |
| 71 | n_components = 2 |
| 72 | |
| 73 | # Apply PCA |
| 74 | transformed_data, variance_ratio = apply_pca(data_x, n_components) |
| 75 | |
| 76 | print("Transformed Dataset (First 5 rows):") |
| 77 | print(transformed_data[:5]) |
| 78 | |
| 79 | print("\nExplained Variance Ratio:") |
| 80 | print(variance_ratio) |
| 81 | |
| 82 | |
| 83 | if __name__ == "__main__": |
no test coverage detected