0
$\begingroup$

I want to do a text classification problem for which I want to train use Adaboost Classifier from sklearn using a Keras estimator. I do know how to use the Keras wrappers for using sklearn functions. So that is not the problem. I have a 3D input data (number_sentences, number_words, features) and when I checked the source code of Adaboost, it shows that X can be only 1D or 2D.

  • Why is that so?
  • Is there any other way for me to use Adaboost for 3D input data?
$\endgroup$
2
1
$\begingroup$

Adaboost doesn't care about the order of the features, so no matter how many dimensions your samples have, you can just flatten them. Flattening them gives you a 2D X with shape (n_samples, n_features) which you can feed to the Adaboost classifier.

$\endgroup$
2
  • $\begingroup$ but if I do change the X to be passed onto the Adaboost, the base_estimator which is Keras RNN in my case might throw an error because it expects a 3D Input $\endgroup$ – Hima Varsha Oct 27 '16 at 11:34
  • $\begingroup$ Could you add a piece of code to you question that shows how you're trying to combine the keras RNN with the Adaboost classifier? $\endgroup$ – stmax Oct 27 '16 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.