Debug School

rakesh kumar
rakesh kumar

Posted on

Machine learning Error:ValueError at columns are missing: {'Unnamed: 0'} in prediction

Error:ValueError at /prediction/add/
columns are missing: {'Unnamed: 0'} in prediction=model.predict(data)
my code is

car=pd.read_csv('data/Cleaned_Car_data.csv')
print(car)
x=car.drop(columns='Price')
y=car['Price']

my=x.info()
print(my)

Image description

Reason
A "ValueError" in machine learning typically occurs when there is an issue related to the values or data types being used. It signifies that the input or output values do not match the expected format or fall outside the valid range

Solution

x = x.drop('Unnamed: 0', axis=1)  

Enter fullscreen mode Exit fullscreen mode
  my=x.info()
        print(my)
        x = x.drop('Unnamed: 0', axis=1)               
        print('cleaned data x target')
        z=x.info()
        print(z)
Enter fullscreen mode Exit fullscreen mode

Image description

Reference

Top comments (0)