between target an features
// Check is fit had been called
check_is_fitted(self, ["input_shape_"])
// Input validation
// ~X = check_array(X)
if(X is None):
is_symmetric = True
target_graph = self.X_graph
num_of_targets = self.num_of_graphs
else:
is_symmetric = False
target_graph = dict()
num_of_targets = 0
for x in X:
target_graph[num_of_targets] = graph(x[0],x[1],"all")
num_of_targets += 1
// Check that the input is of the same shape as the one passed
// during fit.
//if X.shape != self.input_shape_:
// raise ValueError("Shape of input is different from what was seen"
// "in `fit`")
// Calculate kernel matrix
K = np.empty(shape = (self.num_of_targets,self.num_of_graphs))
if is_symmetric:
for i in range(0,self.num_of_targets):
for j in range(i,self.num_of_graphs):
K[i,j] = self.kernel(target_graph[i],self.X_graph[i])
if(i!=j):
K[j,i] = K[i,j]
else:
for i in range(0,self.num_of_targets):
for j in range(0,self.num_of_graphs):
K[i,j] = self.kernel(target_graph[i],self.X_graph[i])
return K