Jimmy-Lin / GeneralizedOptimalSparseDecisionTrees

Generalized Optimal Sparse Decision Trees
62 stars 41 forks source link

Python installation does not work when calling `fit` #8

Open mrektor opened 3 years ago

mrektor commented 3 years ago

Hi,

After the installation of the dependencies and of the python library, when calling the fit method (executing the code from the example.py) it gives this error:

Traceback (most recent call last):
  File "example.py", line 17, in <module>
    model.fit(X, y)
  File "/home/ettore.mariotti/Documents/gosdt_repo/GeneralizedOptimalSparseDecisionTrees/python/model/gosdt.py", line 99, in fit
    self.__train__(X, y)
  File "/home/ettore.mariotti/Documents/gosdt_repo/GeneralizedOptimalSparseDecisionTrees/python/model/gosdt.py", line 48, in __train__
    dataset.insert(m, "class", y) # It is expected that the last column is the label column
  File "/home/ettore.mariotti/.local/lib/python3.8/site-packages/pandas/core/frame.py", line 4418, in insert
    value = self._sanitize_column(value)
  File "/home/ettore.mariotti/.local/lib/python3.8/site-packages/pandas/core/frame.py", line 4510, in _sanitize_column
    return sanitize_array(value, self.index, copy=True, allow_2d=True)
  File "/home/ettore.mariotti/.local/lib/python3.8/site-packages/pandas/core/construction.py", line 571, in sanitize_array
    subarr = maybe_convert_platform(data)
  File "/home/ettore.mariotti/.local/lib/python3.8/site-packages/pandas/core/dtypes/cast.py", line 126, in maybe_convert_platform
    arr = lib.maybe_convert_objects(arr)
  File "pandas/_libs/lib.pyx", line 2385, in pandas._libs.lib.maybe_convert_objects
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)
Farnazyz commented 2 years ago

Hello @mrektor,

Have you ever figured out how to solve this? Cause when I fit it, it gives me AttributeError: module 'gosdt' has no attribute 'confirue'!

chudizhong commented 1 year ago

We have a new repo with pip install. Please check https://github.com/ubc-systopia/gosdt-guesses and https://pypi.org/project/gosdt/. We also include an example.py and tutorial.ipynb in our new repo.

Farnazyz commented 1 year ago

Thank you for the help. I changed a part of a code, and it ran.

Best, Farnaz


From: Chudi @.> Sent: Monday, December 5, 2022 10:41:49 AM To: Jimmy-Lin/GeneralizedOptimalSparseDecisionTrees @.> Cc: Farnaz Yousefi Zowj @.>; Comment @.> Subject: [EXT] Re: [Jimmy-Lin/GeneralizedOptimalSparseDecisionTrees] Python installation does not work when calling fit (#8)

CAUTION: Email Originated Outside of Auburn.

We have a new repo with pip install. Please check https://github.com/ubc-systopia/gosdt-guesseshttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fubc-systopia%2Fgosdt-guesses&data=05%7C01%7Cfzy0020%40auburn.edu%7C6c45381e84a3496d036908dad6df9e29%7Cccb6deedbd294b388979d72780f62d3b%7C1%7C0%7C638058553165361327%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xTxcag99txLA9VD8qSVrL0VekruxbAW5NmT0FOyfeDo%3D&reserved=0 and https://pypi.org/project/gosdt/https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpypi.org%2Fproject%2Fgosdt%2F&data=05%7C01%7Cfzy0020%40auburn.edu%7C6c45381e84a3496d036908dad6df9e29%7Cccb6deedbd294b388979d72780f62d3b%7C1%7C0%7C638058553165361327%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dyhiXuuwdlJztWVrbzqP4jfbQsQEbzoy7M4ZLZZsxso%3D&reserved=0. We also include an example.py and tutorial.ipynb in our new repo.

— Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FJimmy-Lin%2FGeneralizedOptimalSparseDecisionTrees%2Fissues%2F8%23issuecomment-1337698054&data=05%7C01%7Cfzy0020%40auburn.edu%7C6c45381e84a3496d036908dad6df9e29%7Cccb6deedbd294b388979d72780f62d3b%7C1%7C0%7C638058553165517570%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2tpqB6ESZz1Xh0bXXQJQ%2B3R9iJHTJJeA%2Btg%2FmJjIdTo%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAVDGKGGIRNYTITMRUZ4GO43WLYLM3ANCNFSM5EEYMSPQ&data=05%7C01%7Cfzy0020%40auburn.edu%7C6c45381e84a3496d036908dad6df9e29%7Cccb6deedbd294b388979d72780f62d3b%7C1%7C0%7C638058553165517570%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0JZtF%2FwSP2we2ELk5YxxUrA63uIquRA%2BXfKwKlw6V2U%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>