1. A computer-implemented method comprising: obtaining training data, the training data comprising a plurality of graphs, each defined by nodes and edges connecting between the nodes, wherein at least some of the nodes are labeled; determining, by a processor, a statistical model of a graph in accordance with the training data, the statistical model takes into account at least one structured and labeled feature of the graph, wherein the structured and labeled feature of the graph is defined based on a connection between a plurality of nodes and based on at least a portion of the labels of the plurality of nodes; based on the training data, building a consensus graph retaining information relating to the values of the structured and labeled feature in the plurality of graphs in the training data; obtaining an examined graph; and determining, by the processor, a score of the examined graph indicative of a similarity between the examined graph and the training data, wherein the score is based on a value of the structured and labeled feature in the examined graph, wherein said determining the score is performed by traversing the consensus graph and the examined graph to compare the values of the structured and labeled feature.