scikit-learn-contrib / skope-rules

machine learning with logical rules in Python
http://skope-rules.readthedocs.io
Other
615 stars 95 forks source link

Error while loading credit data #43

Open shubhamgupta-dat opened 4 years ago

shubhamgupta-dat commented 4 years ago

I was trying to read credit data from the example page. Pandas cannot read from excel sheet because of the incorrect variable name sheetname and should be renamed to sheet_name.

Adding the log trace for Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-d1105f71ff0d> in <module>
      1 # Importing data
----> 2 dataset = load_credit_data()
      3 X = dataset.data
      4 y = dataset.target
      5 # Shuffling data, preparing target and variables

/opt/conda/lib/python3.7/site-packages/skrules/datasets/credit_data.py in load_credit_data()
     37 
     38     data = pd.read_excel(join(sk_data_dir, archive.filename),
---> 39                          sheetname='Data', header=1)
     40 
     41     dataset = Bunch(

/opt/conda/lib/python3.7/site-packages/pandas/util/_decorators.py in wrapper(*args, **kwargs)
    294                 )
    295                 warnings.warn(msg, FutureWarning, stacklevel=stacklevel)
--> 296             return func(*args, **kwargs)
    297 
    298         return wrapper

TypeError: read_excel() got an unexpected keyword argument 'sheetname'
shubhamgupta-dat commented 4 years ago

I will make the changes and create a pull request for the same.

ngoix commented 4 years ago

I will make the changes and create a pull request for the same.

thanks for reporting, yes please don't hesitate to open a pull request changing deprecated sheetname to sheet_name