本文整理汇总了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()
示例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()