【问题标题】:How to impelement Arima time series forecasting using python with cassandra database?如何使用 python 和 cassandra 数据库实现 Arima 时间序列预测?
【发布时间】:2018-12-05 12:19:46
【问题描述】:

大家好,我有用于 arima 时间序列预测的 cassandra 表,您能分享一些如何实现它的基本步骤吗?

【问题讨论】:

  • 您能否说得更具体一点:这是关于从 Cassandra 获取历史数据,还是关于 ARIMA 算法?
  • 是的,我正在寻找有关从 Cassandra 获取历史数据或 ARIMA 算法的信息?

标签: python data-science arima


【解决方案1】:

让我们从 Cassandra 数据库开始。

python 中的常见做法是使用 PIP 包中的数据库客户端。在这种情况下,cassandra-driver 就是您需要的包。

https://datastax.github.io/python-driver/installation.html

然后以下页面提供了一个带有 Cassandra 数据库查询的工作 python 示例:

https://techfossguru.com/apache-cassandra-python-step-step-guide-ubuntu-example/

# simple example without security
from cassandra.cluster import Cluster

server_address = "localhost" # or where Cassandra is hosted
keyspace = "my_keyspace" # or whatever you select

cluster = Cluster(server_address)
session = cluster.connect(keyspace)
session.execute('select * from mytable limit 100 where somecolumn > 10;')  # get 100 matching lines from mytable
cluster.shutdown()

对于 ARIMA,这是一个相当复杂的算法。见https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average

我建议先弄清楚算法的作用,然后浏览参考实现。

【讨论】:

    猜你喜欢
    • 2017-05-01
    • 1970-01-01
    • 2020-09-06
    • 2020-12-06
    • 2017-12-07
    • 2017-12-24
    • 2022-10-22
    • 1970-01-01
    • 2020-07-27
    相关资源
    最近更新 更多