def build_signature_model(X,gidx,n_alphas=5): model = RidgeCV(alphas=(.1,1,10,100,1000,10000,100000),cv=5) model.fit(X[gidx].T,X.T) return model