Skip to content

Python installation does not work when calling fit #8

@mrektor

Description

@mrektor

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions