Caleb Chege
Caleb Chege

Reputation: 35

What does it mean for a classification model to expect more features

I am trying to predict some test data using MLPClassifier but getting this error:

ValueError: X has 17 features, but MLPClassifier is expecting 18 features as input. What could this mean??

Upvotes: 1

Views: 66

Answers (1)

Jafar Isbarov
Jafar Isbarov

Reputation: 1562

A machine learning model is essentially a statistical formula that accepts certain number of inputs and gives a numerical output. In your case, there should be 18 input values, not 17.
Let's assume that you are using logistic regression. In this case, your model is as follows:

yp = 1 / (1 + e^-(a1x1 + a2x1 ... a18*x18))

If you don't provide a18, the model has now way of predicting it.

Upvotes: 2

Related Questions