You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used the demo_pipeline without problem and now face this bug.
Description of the bug: the following code results in an error
frommelusine.dataimportload_email_datafrommelusine.pipelineimportMelusinePipeline# Load an email datasetdf=load_email_data()
# Load a pipelinepipeline=MelusinePipeline.from_config("demo_pipeline")
# Run the pipelinedf=pipeline.transform(df)
TypeError Traceback (most recent call last)
Cell In[1], [line 11](vscode-notebook-cell:?execution_count=1&line=11)
[8](vscode-notebook-cell:?execution_count=1&line=8) pipeline = MelusinePipeline.from_config("demo_pipeline")
[10](vscode-notebook-cell:?execution_count=1&line=10) # Run the pipeline
---> [11](vscode-notebook-cell:?execution_count=1&line=11) df = pipeline.transform(df)
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\melusine\pipeline.py:403, in MelusinePipeline.transform(self, X)
[389](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:389) """
[390](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:390) Transform input dataset.
[391](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:391)
(...)
[400](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:400) Output Dataset.
[401](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:401) """
[402](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:402) self.validate_input_fields(X)
--> [403](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/melusine/pipeline.py:403) return super().transform(X)
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\sklearn\pipeline.py:1082, in Pipeline.transform(self, X, **params)
[1050](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1050) """Transform the data, and apply `transform` with the final estimator.
[1051](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1051)
[1052](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1052) Call `transform` of each transformer in the pipeline. The transformed
(...)
[1079](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1079) Transformed data.
[1080](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1080) """
[1081](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1081) # TODO(1.8): Remove the context manager and use check_is_fitted(self)
-> [1082](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1082) with _raise_or_warn_if_not_fitted(self):
[1083](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1083) _raise_for_params(params, self, "transform")
[1085](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1085) # not branching here since params is only available if
[1086](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1086) # enable_metadata_routing=True
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\contextlib.py:142, in _GeneratorContextManager.__exit__(self, typ, value, traceback)
[140](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/contextlib.py:140) if typ is None:
[141](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/contextlib.py:141) try:
--> [142](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/contextlib.py:142) next(self.gen)
[143](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/contextlib.py:143) except StopIteration:
[144](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/contextlib.py:144) return False
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\sklearn\pipeline.py:60, in _raise_or_warn_if_not_fitted(estimator)
[58](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:58) # we only get here if the above didn't raise
[59](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:59) try:
---> [60](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:60) check_is_fitted(estimator)
[61](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:61) except NotFittedError:
[62](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:62) warnings.warn(
[63](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:63) "This Pipeline instance is not fitted yet. Call 'fit' with "
[64](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:64) "appropriate arguments before using other methods such as transform, "
(...)
[67](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:67) FutureWarning,
[68](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:68) )
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\sklearn\utils\validation.py:1756, in check_is_fitted(estimator, attributes, msg, all_or_any)
[1753](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1753) if not tags.requires_fit and attributes is None:
[1754](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1754) return
-> [1756](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1756) if not _is_fitted(estimator, attributes, all_or_any):
[1757](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1757) raise NotFittedError(msg % {"name": type(estimator).__name__})
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\sklearn\utils\validation.py:1665, in _is_fitted(estimator, attributes, all_or_any)
[1662](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1662) return all_or_any([hasattr(estimator, attr) for attr in attributes])
[1664](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1664) if hasattr(estimator, "__sklearn_is_fitted__"):
-> [1665](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1665) return estimator.__sklearn_is_fitted__()
[1667](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1667) fitted_attrs = [
[1668](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1668) v for v in vars(estimator) if v.endswith("_") and not v.startswith("__")
[1669](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1669) ]
[1670](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1670) return len(fitted_attrs) > 0
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\sklearn\pipeline.py:1310, in Pipeline.__sklearn_is_fitted__(self)
[1303](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1303) return True
[1305](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1305) try:
[1306](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1306) # check if the last step of the pipeline is fitted
[1307](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1307) # we only check the last step since if the last step is fit, it
[1308](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1308) # means the previous steps should also be fit. This is faster than
[1309](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1309) # checking if every step of the pipeline is fit.
-> [1310](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1310) check_is_fitted(last_step)
[1311](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1311) return True
[1312](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/pipeline.py:1312) except NotFittedError:
File d:\Users\cdiet\Program\miniconda3\envs\test_env\lib\site-packages\sklearn\utils\validation.py:1749, in check_is_fitted(estimator, attributes, msg, all_or_any)
[1743](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1743) msg = (
[1744](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1744) "This %(name)s instance is not fitted yet. Call 'fit' with "
[1745](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1745) "appropriate arguments before using this estimator."
[1746](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1746) )
[1748](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1748) if not hasattr(estimator, "fit"):
-> [1749](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1749) raise TypeError("%s is not an estimator instance." % (estimator))
[1751](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1751) tags = get_tags(estimator)
[1753](file:///D:/Users/cdiet/Program/miniconda3/envs/test_env/lib/site-packages/sklearn/utils/validation.py:1753) if not tags.requires_fit and attributes is None:
TypeError: EmergencyDetector(name='emergency') is not an estimator instance.
Debug Information
Please write the debug information inside ``` quotes in order to prevent text interpretation by the text editor.
Operating System: (run cat /etc/os-release in a terminal if running on a GNU/Linux distribution)
Microsoft Windows [Version 10.0.22631.4460]
Python version: (run python --version in the environment running Melusine)
Python 3.10.16
Melusine version: (run pip freeze |grep melusine in your Python environment)
melusine 3.1.0 pypi_0 pypi
Python packages: (run pip freeze in your Python environment)
Simple environment set-up built with conda create -n test_env python=3.10 and pip install melusine, nothing else.
Observation: Rolling back to Scikit-learn version 1.5.2 resolves the issue, and the code runs as expected.
Root Cause: It appears that Melusine has a compatibility issue with Scikit-learn 1.6.0.
Behavior: When running pip install melusine, the latest version of Scikit-learn (1.6.0) is installed automatically, causing the issue.
I have used the demo_pipeline without problem and now face this bug.
Description of the bug: the following code results in an error
Same as in the demonstration code here.
Error :
Debug Information
Please write the debug information inside
```
quotes in order to prevent text interpretation by the text editor.Operating System: (run
cat /etc/os-release
in a terminal if running on a GNU/Linux distribution)Python version: (run
python --version
in the environment running Melusine)Melusine version: (run
pip freeze |grep melusine
in your Python environment)Python packages: (run
pip freeze
in your Python environment)Simple environment set-up built with conda create -n test_env python=3.10 and pip install melusine, nothing else.
The text was updated successfully, but these errors were encountered: