BernoulliRBM is an uncontrolled method, so you won’t be able to use clf.fit(X_train, y_train)it rather clf.fit(X_train). It is mainly used to extract nonlinear features that can be passed to the classifier. It will look like this:
logistic = linear_model.LogisticRegression()
rbm = BernoulliRBM(random_state=0, verbose=True)
classifier = Pipeline(steps=[('rbm', rbm), ('logistic', logistic)])
, , rbm, LogisticRegression. .