EpistasisLab / EpistasisLab/tpot
XGBRegressor ValueError: feature_names mismatch:
- Dominant language
- Jupyter Notebook
- Stars
- 10.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
I am having an issue every time I tried to run the following code:
pipeline:
housing2 = pd.read_csv('https://raw.githubusercontent.com/byui-cse/cse450-course/master/data/housing_holdout_test.csv')
overall_model = XGBRegressor(max_depth=6, colsample_bytree=0.7)
overall_model.fit(X_train, y_train)
new_predictions = overall_model.predict(housing2[['view', 'sqft_living', 'grade', 'waterfront', 'lat', 'zipcode']])
print(new_predictions)
ValueError: feature_names mismatch: ['f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17'] ['view', 'sqft_living', 'grade', 'waterfront', 'lat', 'zipcode']
expected f5, f8, f10, f6, f12, f1, f4, f9, f13, f3, f14, f17, f0, f2, f11, f16, f7, f15 in input data
training data did not have the following fields: waterfront, zipcode, view, lat, grade, sqft_living
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.