aws / aws/amazon-sagemaker-examples

Number of features of the model must match the input. Model n_features is 4 and input n_features is 3

Open
#654 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

For scikit_bring_your_own example, when trying to predict the payload.csv file by running:

`./predict.sh payload.csv text/csv`

There is an error occurring: "Number of features of the model must match the input. Model n_features is 4 and input n_features is 3".

The problem is that payload.csv was not correctly formatted.
**The solution** is to add the header column before the first column.

Here is a zip of the edited CSV file which worked for me:
[payload.csv.zip](https://github.com/awslabs/amazon-sagemaker-examples/files/2917314/payload.csv.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.