"""Projection/reconstruction starter."""
import numpy as np
X=np.array([[0.,1.],[1.,2.],[2.,2.],[3.,3.]])
u=np.array([1.,1.]); u=u/np.linalg.norm(u)
mu=np.mean(X,axis=0); Xc=X-mu
# TODO: coordinates and reconstruction
z=Xc@u
Xhat=z.reshape(-1,1)*u.reshape(1,-1)
mse=np.mean(np.sum((Xc-Xhat)**2,axis=1))
print(mu); print(z); print(Xhat); print(mse)
