Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass a dataframe into the fit() function? #14

Open
offrok opened this issue Dec 12, 2023 · 0 comments
Open

How to pass a dataframe into the fit() function? #14

offrok opened this issue Dec 12, 2023 · 0 comments

Comments

@offrok
Copy link

offrok commented Dec 12, 2023

I wanted to try your pyod wrapper. I am working with pyspark dataframes in databricks. the model_data is a spark dataframe with 24 floattype features (columns) and many rows. It is actually a time series (so this this wrapper also work for TODS ?) This is my code:

`from pyod.models.lof import LOF

from kakapo import PyodWrapper
from kakapo import get_default_model_space

params = {
"type": "lof",
"n_neighbors":20,
"contamination": 0.01
}
model_space = {
"lof": LOF
}

model = PyodWrapper(**params)
model.set_model_space(model_space)

model.fit(model_data)`

When i simply try to fit the model on the dataframe i get the following error:
ValueError: Expected 2D array, got scalar array instead:

So my Question is, what type of dataframe should i pass into the model.fit() function / is there any more preprocessing necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant