Import statsmodels.tsa.api as tsa
The alias in the `statsmodels` documentation
This commit is contained in:
parent
07e90b7851
commit
9b844b16e7
2 changed files with 3 additions and 2 deletions
|
|
@ -552,6 +552,7 @@ banned-from = [
|
||||||
"sqlalchemy" = "sa"
|
"sqlalchemy" = "sa"
|
||||||
"sqlalchemy.dialects.postgresql" = "psql"
|
"sqlalchemy.dialects.postgresql" = "psql"
|
||||||
"sqlalchemy.ext.hybrid" = "sa_hybrid"
|
"sqlalchemy.ext.hybrid" = "sa_hybrid"
|
||||||
|
"statsmodels.tsa.api" = "tsa"
|
||||||
"typing" = "t"
|
"typing" = "t"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"""Forecast by linear extrapolation of a seasonal component."""
|
"""Forecast by linear extrapolation of a seasonal component."""
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from statsmodels.tsa import api as ts_stats
|
from statsmodels.tsa import api as tsa
|
||||||
|
|
||||||
|
|
||||||
def predict(
|
def predict(
|
||||||
|
|
@ -46,7 +46,7 @@ def predict(
|
||||||
# Obtain all `observations` of the same seasonal lag and
|
# Obtain all `observations` of the same seasonal lag and
|
||||||
# fit a straight line through them (= `trend`).
|
# fit a straight line through them (= `trend`).
|
||||||
observations = training_ts[slice(lag, 999_999_999, frequency)]
|
observations = training_ts[slice(lag, 999_999_999, frequency)]
|
||||||
trend = observations - ts_stats.detrend(observations)
|
trend = observations - tsa.detrend(observations)
|
||||||
|
|
||||||
# Create a point forecast by linear extrapolation
|
# Create a point forecast by linear extrapolation
|
||||||
# for one or even more time steps ahead.
|
# for one or even more time steps ahead.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue