theta = theta.reshape(-1,1)
import numpy as np
from sklearn.neighbors import kneighbors_graph, KNeighborsTransformer,NearestNeighbors
from sklearn import datasets
from itertools import product
X, y = datasets.load_iris(return_X_y=True)
w = np.random.random(4)
print(w.shape)
print(X.shape)
P = X @ w
print(P.shape)
P_T = np.tile(P,(3,1))
print(P_T.shape)
theta = np.array([1,2,3])
theta = theta.reshape(-1,1)
print(theta.shape)
print(theta)
R = P_T - theta
print(R.shape)
# print(P_T- theta)