You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在时间序列数据中找到使count最大化的最优points值?

寻找使count值最大的最优points值(高中数学解法)

原始数据集包含百万行年度数据,以下是前十行的结构化数据:

import pandas as pd

df = pd.DataFrame({'time': {0: '2020-12-08',
  1: '2020-12-08',
  2: '2020-12-08',
  3: '2020-12-08',
  4: '2020-12-08',
  5: '2020-12-08',
  6: '2020-12-08',
  7: '2020-12-08',
  8: '2020-12-08',
  9: '2020-12-08'},
 'points': {0: 200,
  1: 50,
  2: 0,
  3: 0,
  4: 150,
  5: 200,
  6: 200,
  7: 50,
  8: 100,
  9: 200},
 'count': {0: 19,
  1: 9,
  2: 32,
  3: 28,
  4: 22,
  5: 17,
  6: 22,
  7: 17,
  8: 28,
  9: 24}})

观察完整数据集可发现:points值过高或过低时,count值都会下降。现在需要找到能让count值达到最大的最优points值,希望用高中数学层面的方法解决。

我想到一个可行思路:把points作为特征X、count作为目标y,训练一个机器学习模型(无需划分训练测试集);接着生成包含1到500所有points值的数据集,用模型预测对应的count值;最后统计出count值最大的那个points值,就是我们要找的最优值,还能估算出比如90、106这类特定points值对应的count值。

内容的提问来源于stack exchange,提问作者Mystic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 07:25:26