to include an adjacency matrix as a feature in CatBoost? I want to use CatBoost rather than a graph neural network as I would also like to include categorical features however I am not sure how to do this.
Hi! I see 2 possible ways: 1) If you have a dense graph than for each of N vertices add N binary features. 2) If you have a sparse graph than for each vertex add a single “text” feature with space-separated adjacency list.
Interesting and good to know!
Hi Ivan, Thanks for your reply. The order of my nodes is important as they represent a specific connection so I came up with this python solution based on option (1): v = np.tril_indices(adj.shape[0]) trilAdj = adj[v] This gives an Nx1 vector that I could then feed into CatBoost. Is this a good solution?
Обсуждают сегодня