我需要为每种产品(例如 A、B、C)找到最佳折扣,以便我可以最大限度地提高总销售额。我有每个产品的现有随机森林模型,将折扣和季节映射到销售。我如何组合这些模型并将它们提供给优化器以找到每个产品的最佳折扣?
选型理由:
输入数据:用于在产品级别构建模型的示例数据。数据一览如下:

我遵循的想法/步骤:
# pre-processed data
products_pre_processed_data = {key:pre_process_data(df, key) for key, df in df_basepack_dict.items()}
# rf models
products_rf_model = {key:rf_fit(df) for key, df in products_pre_processed_data .items()}
Run Code Online (Sandbox Code Playgroud)
sudo/示例代码# …
python optimization machine-learning mathematical-optimization particle-swarm
在 databricks 中导入Pycaret time-series(beta)模块时,我收到以下错误(我们之前运行成功)。请求您帮助解决问题。
\n使用中的 pycaret 版本:
\nimport pycaret\npycaret.__version__ # Out[1]: '3.0.0'\nRun Code Online (Sandbox Code Playgroud)\n使用的python版本:
\nimport sys\nsys.version #Out[9]: '3.8.10 (default, Mar 15 2022, 12:22:08) \\n[GCC 9.4.0]'\nRun Code Online (Sandbox Code Playgroud)\n以下是该问题的堆栈跟踪。
\nfrom pycaret.time_series import TSForecastingExperiment\n\n/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)\n 160 # Import the desired module. If you\xe2\x80\x99re seeing this while debugging a failed import,\n 161 # look at preceding stack frames for relevant error information.\n--> 162 original_result = python_builtin_import(name, globals, locals, fromlist, level)\n 163 \n 164 is_root_import …Run Code Online (Sandbox Code Playgroud)