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

Error in model fitting #21

Open
albertoHdzE opened this issue Sep 11, 2023 · 0 comments
Open

Error in model fitting #21

albertoHdzE opened this issue Sep 11, 2023 · 0 comments

Comments

@albertoHdzE
Copy link

Hello guys!
Super amazing job! Thank you.
I have tried first examples, but some don´t run well, could you help me please?
thank you so much.

CODE:

# customized model on ADBench's datasets
from adbench.run import RunPipeline
from adbench.baseline.Customized.run import Customized

# notice that you should specify the corresponding category of your customized AD algorithm
# for example, here we use Logistic Regression as customized clf, which belongs to the supervised algorithm
# for your own algorithm, you can realize the same usage as other baselines by modifying the fit.py, model.py, and run.py files in the adbench/baseline/Customized
pipeline = RunPipeline(suffix='ADBench', parallel='supervise', realistic_synthetic_mode=None, noise_type=None)
results = pipeline.run(clf=Customized)

# customized model on customized dataset
import numpy as np
dataset = {}
dataset['X'] = np.random.randn(1000, 20)
dataset['y'] = np.random.choice([0, 1], 1000)
results = pipeline.run(dataset=dataset, clf=Customized)
print(results)

KIND OF REPETITIVE OUTPUT:

generating duplicate samples for dataset 39_vertebral...
current noise type: None
{'Samples': 1000, 'Features': 6, 'Anomalies': 138, 'Anomalies Ratio(%)': 13.8}
Error in model fitting. Model:Customized, Error: scikit-learn estimators should always specify their parameters in the signature of their __init__ (no varargs). <class 'adbench.baseline.Customized.model.LR'> with constructor (self, *args, **kwargs) doesn't  follow this convention.
Current experiment parameters: ('39_vertebral', 1.0, 2), model: Customized, metrics: {'aucroc': nan, 'aucpr': nan}, fitting time: None, inference time: None

python 3.10.11
pyod = 1.0.0
MAC M2, Ventura 13

I FOUND THAT probably has to do with how parameters are feed, but i really dont think this could be the solution in t his ca se
https://stackoverflow.com/questions/40025406/inherit-from-scikit-learns-lassocv-model

Thank you again for your help

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