Skip to content
Advertisement

TypeError: fit_transform() missing 1 required positional argument: ‘X’

I am trying to do Feature Scaling in a dataset, but I get an error and have no idea how to proceed:

JavaScript

and here is my code:

JavaScript

Advertisement

Answer

You are assigning sc_X a reference to the StandardScaler class. but fit_transform() is is not a class method, but an instance method. This means that you have to create an instance of the class.

So,

JavaScript

should be:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement