tpot
tpot copied to clipboard
set_sample_weight in operator_utils.py deprecated in Python 3
The function set_sample_weight()
in operator_utils.py
is using inspect.getargspec(obj.fit)
in line 112. This function seems to be deprecated in Python 3 and throws an error when trying to use the fit function fit(x, y, sample_weight=weights)
with sample weights.
Pipelines that include for example XGBClassifier seem to be throwing a Value error, others do not throw an error.
A quick fix for this would be to replace line 112:
if inspect.getargspec(obj.fit).args.count("sample_weight"):
with:
if "sample_weight" in inspect.getfullargspec(obj.fit).args:
This seems to be working fine for me.