I am using graph_tool to create and manage graph. I want to use this graph as input for sklearn AffinityPropagation algorithm. edge Weight will be used as precomputed affinity measure.
A = gt.adjacency(graph.graph_tool_graph, operator=True)
clustering = sklearn.cluster.AffinityPropagation(random_state=5).fit(A)
The result
raise ValueError( ValueError: Expected 2D array, got scalar array instead: array=<17x17 AdjacencyOperator with dtype=float64>. Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.