Last answered:

06 Jul 2023

Posted on:

12 Mar 2023

0

Fix this problem "The feature names should match those that were passed during fit."

In line [37] I got this error:

ValueError: The feature names should match those that were passed during fit.
Feature names unseen at fit time:
- Price_Range
- Promotion
Feature names seen at fit time, yet now missing:
- Mean_Price
- Mean_Promotion

4 answers ( 0 marked as helpful)
Instructor
Posted on:

14 Mar 2023

0

Hi Le, 

thanks for reaching out! Could you send a screenshot of your notebook with the cell in question, which causes the error?

Thanks in advance!


Best, 

365 Eli

Posted on:

20 Mar 2023

0

change columns names:

- Price_Range
- Promotion
and
- Mean_Price
- Mean_Promotion


to the same ones, ie eg Price, Promotion for both data frames



Posted on:

05 Apr 2023

0

 ValueError

Cell In[99], line 1

----> 1 Y_promotion = model_incidence_promotion.predict_proba(df_price_elasticity_promotion)

...
- Promotion

Feature names seen at fit time, yet now missing:

- Mean_Price

- Mean_Promotion

Posted on:

06 Jul 2023

0

Run the model_incidence_promotion.fit(X, Y) again before going on to using it as a feature in the predict_proba. That way it will contain the newly defined characteristics

Submit an answer