Пример #1
0
    elif dataset == "NCI109":
        print "Loading NCI109 dataset"
        g_it = load_graph_datasets.load_graphs_NCI109()
    elif dataset == "NCI123":
        print "Loading NCI123 dataset"
        g_it = load_graph_datasets.load_graphs_NCI123()
    elif dataset == "NCI_AIDS":
        print "Loading NCI_AIDS dataset"
        g_it = load_graph_datasets.load_graphs_NCI_AIDS()
    else:
        print "Unknown dataset name"

    if kernel == "WL":
        print "Lambda ignored"
        print "Using WL fast subtree kernel"
        Vectorizer = WLVectorizer(r=max_radius, normalization=normalization)
    elif kernel == "ODDST":
        print "Using ST kernel"
        Vectorizer = ODDSTVectorizer(r=max_radius,
                                     l=la,
                                     normalization=normalization)
    elif kernel == "NSPDK":
        print "Using NSPDK kernel, lambda parameter interpreted as d"
        Vectorizer = NSPDKVectorizer(r=max_radius,
                                     d=int(la),
                                     normalization=normalization)
    else:
        print "Unrecognized kernel"

    features = Vectorizer.transform(g_it.graphs)  #Parallel ,njobs
    #print GM