on-internet
← Community

Principal component analysis, add a line to the three-dimensional graph. showing the first principal component

Stack Overflow ·

I am conducting PCA on a dataset. I am attempting to add a line in my three-dimensional graph which shows the first principal component. I have tried a few methods, but I have not been able to display the first principal component as a line in my three-dimensional graph. My code is as follows: import numpy as np np.set_printoptions (suppress=True, precision=5, linewidth=150) import pandas as pd from sklearn.decomposition import PCA from sklearn.preprocessing import LabelEncoder from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt file_name = 'C:/Users/data' input_data = pd.r

Comments

Sign in or sign up to comment and upvote.

No comments yet.