Last answered:

23 Oct 2024

Posted on:

22 Oct 2024

0

Machine Learning - Simplifying the Model - Backward Elimination Error

Hi, 

I am currently reviewing the SQL+Tableau+Python Course > Machine Learning > Simplify the Mode (Backward Elimination) Section, where I run the Custom Scaler Class, and I am getting the error: 

"TypeError: StandardScaler.__init__() takes 1 positional argument but 4 were given"  after running the code: 'absenteeism_scaler = CustomScaler(columns_to_scale)' 
and then the error:
TypeError: CustomScaler.fit() missing 1 required positional argument: 'X'
after running: absenteeism_scaler.fit(unscaled_inputs).
Hope you can help me sort this out. 
Thanks
1 answers ( 0 marked as helpful)
Instructor
Posted on:

23 Oct 2024

0
Hi Bianca!

Thanks for reaching out.

Can you please also provide the code you executed prior to obtaining this error ? This will help us assist you better.
In the meantime, consider restarting the kernel and executing all steps in the suggested order from top to bottom, as otherwise different state of a certain input might affect the use of a certain function/operation.

Hope this helps.
Looking forward to your answer. 
Best,
Martin

Submit an answer