| 14 | |
| 15 | |
| 16 | class PCADecomposition(object): |
| 17 | def __init__(self, n_components=256): |
| 18 | self.pca = PCA(n_components=n_components) |
| 19 | |
| 20 | def fit(self, data): |
| 21 | self.pca.fit( data ) |
| 22 | return self |
| 23 | |
| 24 | def transform(self, data): |
| 25 | return self.pca.transform( data ) |
| 26 | |
| 27 | def save_model(self, save_path): |
| 28 | #保存模型 |
| 29 | joblib.dump(self.pca, save_path) |
| 30 |
no outgoing calls
no test coverage detected