datamllab / tods

TODS: An Automated Time-series Outlier Detection System
http://tods-doc.github.io
Apache License 2.0
1.47k stars 193 forks source link

d3m.exceptions.InvalidArgumentValueError: Cannot add step 4. #74

Open sagarshankar opened 2 years ago

sagarshankar commented 2 years ago

I am attempting to implement an isolation forests pipeline with cross validation, but when I run the pipeline I get error saying that my step 4 where I implement k-folds cross validation cannot be added to the pipeline. I have attached my script for generating this pipeline and I am wondering if there is anything that is currently out of order possibly?

Capture_kfold Capture
lhenry15 commented 2 years ago

To add a new primitive, you may want to 1) register the primitive into the entry.ini file, 2) re-install the package with "pip install -e ." to reload the registration. For debugging, you may want to check the "input" of the produce function to make sure the input and the output are consistently as "d3m_dataframe".

sagarshankar commented 2 years ago

I get this error in return for some reason as well. Also, I checked the "entry.ini" file and it seems that the K-Fold primitive I am using is in there. I also got this other error as well. Which I am trying to figure out why that would be the case. Any feedback would be great.

raise exceptions.InvalidArgumentValueError("Cannot add step {step_index}.".format(step_index=step.index)) from error

lhenry15 commented 2 years ago

Based on the provided snapshots, I don't think there is a problem. Would you mind to provide the full error message?

sagarshankar commented 2 years ago

Yeah this is the full error. It mentions that the K-Fold_Split seems to require some additional arguments and that seems to be the main cause, but I am not sure why that is.

full_error
sagarshankar commented 2 years ago

So I also noticed in the "KFoldSplit.py" file, that there is no function called "produce" which is used in many of the other primitives. There is a function called "def _get_splits", but when I say step_4.add_output('_get_splits), I get the following error as well.

error_2
lhenry15 commented 2 years ago

In our backend D3M system, only certain APIs of a primitive (e.g., "produce", "fit", "fit_produce") will be approachable by the pipeline constructor. Therefore, you might want to make sure the produce function is the one performing the functionality.

sagarshankar commented 2 years ago

So what exactly is the acceptable API for the K Fold primitive? I have tried "produce", "fit" and "fit_produce" but none of them sem to be working so far