Search code examples
machine-learningneural-networkclassification

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??


Solution

  • 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.