scikit-learn - Stop sign flips in sklearn's PCA
问题描述
I am using PCA to visualize the evolution of a high dimensional latent space of a network during the training process. For this, I'm using PCA
function from sklearn.decomposition
and visualize the latent space every 10 epochs.
The problem is that during the evolution, the direction of the PCA axis flips from one frame to the other. While this is not particularly important, it ruins my animated latent space progress. I was wondering if there is a way to stop sign flips.
Below are two consecutive frames of my animation with sign flip.
解决方案
尝试设置 的random_state
参数sklearn.decomposition.PCA
。
希望能帮助到你。
推荐阅读
- javascript - 使用 react 和 react-firebase-hooks 时的无限循环
- php - 发送 POST 请求以获取数据时 PHP cURL 不起作用
- python - 为什么我无法在我的 jupyter 笔记本上安装模块“nturl2path”?
- sql - 多个可为空的外键是一个糟糕的设计吗?
- javascript - JavaScript - 在没有用户干预的情况下停止重定向并获取目标 URL
- python - MinMaxScaler 仅生成正值
- mysql - MySQL 分区的预定截断
- rust - 如何在 Rust 中拒绝没有显式类型注释的 int 变量?
- authorization - Akka.Net:透明地传递上下文信息以进行审计/授权
- c - c语言改变const变量和静态const变量的值