<jupyter_start><jupyter_text>Graph Litmus TestThis is a very simple example to proove, that the GCN components are actually working.<jupyter_code>from Networkx_Dataset import get_random_graphs, plot_nx_edge_count
from photonai.base import Hyperpipe, PipelineElement
from sklearn.model_selection import KFold
import networkx as nx
import numpy as np<jupyter_output><empty_output><jupyter_text>Create a sample dataset:<jupyter_code># create dataset
sparse_graphs = get_random_graphs(500, 20, 0.2)
dense_graphs = get_random_graphs(500, 20, 0.4)
graphs = sparse_graphs + dense_graphs
graphs = np.stack([nx.to_numpy_array(g) for g in graphs])
graphs = np.repeat(graphs[:, :, :, np.newaxis], 2, axis=3)

# create labels
sparse_labels = [0] * 500
dense_labels = [1] * 500
labels = sparse_labels + dense_labels<jupyter_output><empty_output><jupyter_text>Visualize the edge count of the graphs (we created two groups):<jupyter_code>plot_nx_edge_count(sparse_graphs, dense_graphs)<jupyter_output><empty_output><jupyter_text>Setup the PHOTONAI Pipeline<jupyter_code>my_pipe = Hyperpipe('basic_gcn_pipe',
                    inner_cv=KFold(n_splits=5),
                    outer_cv=KFold(n_splits=5),
                    optimizer='sk_opt',
                    optimizer_params={'n_configurations': 25},
                    metrics=['accuracy', 'balanced_accuracy', 'recall', 'precision'],
                    best_config_metric='accuracy')

my_pipe.add(PipelineElement('GraphConstructorThreshold', threshold=0.95))

my_pipe.add(PipelineElement('GCNClassifier', feature_axis=0))<jupyter_output>Using backend: pytorch<jupyter_text>Fit the Pipeline to our data:<jupyter_code>my_pipe.fit(graphs, labels)<jupyter_output>=====================================================================================================
PHOTONAI ANALYSIS: basic_gcn_pipe
=====================================================================================================

*****************************************************************************************************
Outer Cross validation Fold 1
*****************************************************************************************************
Did not find any hyperparameter to convert into skopt space.
{'fraction_non_alphanumeric': 0.25838176128743856, 'fraction_numerical': 0.014751899865891819, 'mean_word_length': 6.770833333333333, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '411926', 'license': 'MIT', 'n_tokens_mistral': 691, 'n_tokens_neox': 618, 'n_words': 131, 'path': 'documentation/docs/examples/GraphLitmusTest.ipynb', 'repo_name': 'wwu-mmll/photonai_graph', 'size': '2237'}