2b8a7f6cdf259893a99f6923a42388c5495fb18d,grakel/graph_kernels.py,GraphKernel,transform,#GraphKernel#Any#,125

Before Change


            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

After Change


                if len(x) == 1:
                    target_graph[num_of_targets] = graph(x[0],{},"all")
                    num_of_targets += 1
                elif len(x) == 2:            
                    target_graph[num_of_targets] = graph(x[0],x[1],"all")
                    num_of_targets += 1
                else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: ysig/GraKeL
Commit Name: 2b8a7f6cdf259893a99f6923a42388c5495fb18d
Time: 2017-11-16
Author: y.siglidis@gmail.com
File Name: grakel/graph_kernels.py
Class Name: GraphKernel
Method Name: transform


Project Name: ysig/GraKeL
Commit Name: 2b8a7f6cdf259893a99f6923a42388c5495fb18d
Time: 2017-11-16
Author: y.siglidis@gmail.com
File Name: grakel/graph_kernels.py
Class Name: GraphKernel
Method Name: transform


Project Name: scikit-learn/scikit-learn
Commit Name: ac7081c510fc2c27b1bef002dfefc9f3854e2c9a
Time: 2019-11-12
Author: qinhanmin2005@sina.com
File Name: sklearn/metrics/_plot/precision_recall_curve.py
Class Name:
Method Name: plot_precision_recall_curve


Project Name: scikit-learn/scikit-learn
Commit Name: ac7081c510fc2c27b1bef002dfefc9f3854e2c9a
Time: 2019-11-12
Author: qinhanmin2005@sina.com
File Name: sklearn/metrics/_plot/roc_curve.py
Class Name:
Method Name: plot_roc_curve