sassoftware / python-pipefitter

The SAS pipefitter package provides a Python API for developing pipelines for data transformation and model fitting as stages of a repeatable machine learning workflow in either SAS v9 or SAS Viya.
Apache License 2.0
12 stars 7 forks source link

AttributeError when using gridsearch hyperparameter tuning. #8

Open jannichorst opened 2 years ago

jannichorst commented 2 years ago

I'm following the example from the documentation here: link

Get the following error message when trying to run the gridsearch: AttributeError: 'SASDataFrame' object has no attribute 'ix'

The "train_ct" table is in fact a CASTable and has the attribute 'ix'. As there are no other arguments, I don't know wether this is user error or a bug.

Jincheng-Sun commented 1 year ago

I believe the problem comes from Pandas dependency. Pandas retired DataFrame.ix() method starting from v0.20.0. In Pipefitter's release version 1.0.0 they still use df.ix(), therefore if you are using a Pandas package version later than 0.20.0 you will meet this problem.

I think the solution here will be either:

  1. Downgrade your Pandas version
  2. Install pipefitter package from github (They fixed this issue in this commit)