Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the ARIMA model from the statsmodels library.
ML Python
from statsmodels.tsa.arima.model import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing unrelated models like LinearRegression or KMeans.
Using incorrect module paths.
✗ Incorrect
The ARIMA model is imported from statsmodels.tsa.arima.model as ARIMA.
2fill in blank
mediumComplete the code to create an ARIMA model with order (1, 1, 1) for the time series data 'data'.
ML Python
model = ARIMA(data, order=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using order with zero differencing when data is non-stationary.
Confusing the order tuple values.
✗ Incorrect
The order (1, 1, 1) means AR=1, differencing=1, MA=1, which is a common ARIMA setup.
3fill in blank
hardFix the error in the code to fit the ARIMA model and save the result in 'fitted_model'.
ML Python
fitted_model = model.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using predict() before fitting the model.
Using non-existent methods like train().
✗ Incorrect
The fit() method trains the ARIMA model on the data.
4fill in blank
hardFill both blanks to generate predictions for the next 5 time points using the fitted ARIMA model.
ML Python
forecast = fitted_model.[1](steps=[2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using predict() instead of forecast() for future points.
Setting steps to a wrong number.
✗ Incorrect
The forecast() method with steps=5 predicts the next 5 points.
5fill in blank
hardFill all three blanks to print the summary of the fitted ARIMA model and extract the AIC value.
ML Python
print(fitted_model.[1]()) aic_value = fitted_model.[2] print('AIC:', [3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to call aic as a method instead of attribute.
Printing the attribute directly without storing.
✗ Incorrect
summary() prints model details; aic attribute holds the AIC value; we print the variable aic_value.