首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TypeError:分析器()缺少一个必需的位置参数:'self‘

TypeError:分析器()缺少一个必需的位置参数:'self‘
EN

Stack Overflow用户
提问于 2021-12-02 17:42:16
回答 1查看 596关注 0票数 0

当试图从https://github.com/evidentlyai/evidently/blob/main/evidently/tutorials/historical_drift_visualization.ipynb执行公开可用的代码(第200-205行“特性漂移”部分)时,我会收到以下错误

代码语言:javascript
复制
TypeError                                 Traceback (most recent call last)
<ipython-input-17-0cdbc9afe012> in <module>
      3 
      4 for date in experiment_batches:
----> 5     drifts = detect_features_drift(raw_data.loc[reference_dates[0]:reference_dates[1]], 
      6                            raw_data.loc[date[0]:date[1]],
      7                            column_mapping=data_columns,

<ipython-input-16-044c700989fb> in detect_features_drift(reference, production, column_mapping, confidence, threshold, get_pvalues)
      8     """
      9 
---> 10     data_drift_profile = Profile(sections=[DataDriftProfileSection])
     11     data_drift_profile.calculate(reference, production, column_mapping=column_mapping)
     12     report = data_drift_profile.json()

~\AppData\Roaming\Python\Python38\site-packages\evidently\model_profile\model_profile.py in __init__(self, sections, options)
     16 
     17     def __init__(self, sections: Sequence[ProfileSection], options: Optional[list] = None):
---> 18         super().__init__(sections, options if options is not None else [])
     19         self.result = {}
     20 

~\AppData\Roaming\Python\Python38\site-packages\evidently\pipeline\pipeline.py in __init__(self, stages, options)
     20         self.analyzers_results = {}
     21         self.options_provider = OptionsProvider()
---> 22         self._analyzers = list(itertools.chain.from_iterable([stage.analyzers() for stage in stages]))
     23         for option in options:
     24             self.options_provider.add(option)

~\AppData\Roaming\Python\Python38\site-packages\evidently\pipeline\pipeline.py in <listcomp>(.0)
     20         self.analyzers_results = {}
     21         self.options_provider = OptionsProvider()
---> 22         self._analyzers = list(itertools.chain.from_iterable([stage.analyzers() for stage in stages]))
     23         for option in options:
     24             self.options_provider.add(option)

TypeError: analyzers() missing 1 required positional argument: 'self'

在尝试执行第195-196行(部分:数据漂移)之后,我获得了一个类似的错误。

我使用Python3.8.8。

我显然安装了一些问题。在成功安装(pip install --user Evidently)之后,我得到了以下错误:

mitosheet 0.1.361需要plotly==5.3.0,但您的策略是4.12.0,它不兼容

(pip install plotly==5.3.0)皮普告诉我

0.1.34.dev0需要plotly~=4.12.0,但是您有一个不兼容的5.3.0。

EN

回答 1

Stack Overflow用户

发布于 2022-02-21 09:20:14

只需在前面加上括号即可。

例如:

代码语言:javascript
复制
data_and_target_drift_report = Dashboard(tabs=[DataDriftTab(),CatTargetDriftTab()])
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70204140

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档