当前位置: 首页>>代码示例>>Python>>正文


Python Timeseries.interp方法代码示例

本文整理汇总了Python中orangecontrib.timeseries.Timeseries.interp方法的典型用法代码示例。如果您正苦于以下问题:Python Timeseries.interp方法的具体用法?Python Timeseries.interp怎么用?Python Timeseries.interp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在orangecontrib.timeseries.Timeseries的用法示例。


在下文中一共展示了Timeseries.interp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: set_forecast

# 需要导入模块: from orangecontrib.timeseries import Timeseries [as 别名]
# 或者: from orangecontrib.timeseries.Timeseries import interp [as 别名]
        self.varmodel.wrap([var for var in data.domain.variables
                            if var.is_continuous and var != data.time_variable])

    @Inputs.forecast
    def set_forecast(self, forecast, id):
        if forecast is not None:
            self.forecasts[id] = forecast
        else:
            self.forecasts.pop(id, None)
        # TODO: update currently shown plots


if __name__ == "__main__":
    from AnyQt.QtWidgets import QApplication
    from orangecontrib.timeseries import ARIMA, VAR

    a = QApplication([])
    ow = OWLineChart()

    airpassengers = Timeseries('airpassengers')
    ow.set_data(airpassengers),

    msft = airpassengers.interp()
    model = ARIMA((3, 1, 1)).fit(airpassengers)
    ow.set_forecast(model.predict(10, as_table=True), 0)
    model = VAR(4).fit(msft)
    ow.set_forecast(model.predict(10, as_table=True), 1)

    ow.show()
    a.exec()
开发者ID:biolab,项目名称:orange3-timeseries,代码行数:32,代码来源:owlinechart.py

示例2: isinstance

# 需要导入模块: from orangecontrib.timeseries import Timeseries [as 别名]
# 或者: from orangecontrib.timeseries.Timeseries import interp [as 别名]
        self.chart.enable_rangeSelector(
            isinstance(data.time_variable, TimeVariable))

    def set_forecast(self, forecast, id):
        if forecast is not None:
            self.forecasts[id] = forecast
        else:
            self.forecasts.pop(id, None)
        # TODO: update currently shown plots


if __name__ == "__main__":
    from PyQt4.QtGui import QApplication
    from orangecontrib.timeseries import ARIMA, VAR

    a = QApplication([])
    ow = OWLineChart()

    msft = Timeseries('yahoo_MSFT')
    ow.set_data(msft),
    # ow.set_data(Timeseries('UCI-SML2010-1'))

    msft = msft.interp()
    model = ARIMA((3, 1, 1)).fit(msft)
    ow.set_forecast(model.predict(10, as_table=True), 0)
    model = VAR(4).fit(msft)
    ow.set_forecast(model.predict(10, as_table=True), 1)

    ow.show()
    a.exec()
开发者ID:ajdapretnar,项目名称:orange3-timeseries,代码行数:32,代码来源:owlinechart.py


注:本文中的orangecontrib.timeseries.Timeseries.interp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。