X1 of shape (200,170000) and X2 of shape (200,170000)

```
def algo(model,X1,X2,y,train,val) :
X_train_1, X_val_1, y_train, y_val = X1[train], X1[val], y[train], y[val]
X_train_2, X_val_2 = X2[train], X2[val]
X_c = np.concatenate((X_train_1,X_train_2),axis=0)
X_v = np.concatenate((X_val_1,X_val_2),axis=0)
X_train_c = FastICA().fit_transform(X_c)
X_val_c= FastICA().fit_transform(X_v)
ward = FeatureAgglomeration(n_clusters=1000,connectivity=connectivity,linkage='ward')
X_red = ward.fit_transform(X_train_c)
model.fit(X_red,y_train)
```

X_train_1 and X_train_2 of shape(150,170000), and X_val1 and X_val_2 of shape (50,170000)

X_c of shape (300,170000) and X_v of shape (100,170000)

i have an error : bescause X_train_c of shape (300,300) while featureAgglomeration take an adjacence matrix (connectivity) of shape (nb_voxels,nb_voxels) …

is there another method that allows us to get only one matrix that containt the shared weight or latent space between X_train_1 and X_train_2 before applying feature agglomeration ?

I know that we can apply featureAgglomeration directly on X_c , but i want to get latent space between X_train_1 and X_train_2 , then, we can apply featureagglomeration on the latent space.

Thank you very much @bthirion