<jupyter_start><jupyter_text><jupyter_code>def what_is_installed():
    import pycaret
    from pycaret import show_versions
    show_versions()

try:
    what_is_installed()
except:
    !pip install pycaret-ts-alpha
    what_is_installed()
import numpy as np
import pandas as pd
from pycaret.datasets import get_data
from pycaret.time_series import TSForecastingExperiment
#### Intermittent Demand ----
from scipy.stats import poisson
np.random.seed(42)
data = pd.DataFrame({"demand": poisson.rvs(mu=0.25, size=144)})
#### Create Time Series Forecasting Experiment ----
exp = TSForecastingExperiment()
global_plot_settings = {"renderer": "colab"}
exp.setup(data=data, seasonal_period=1, fh=12, fig_kwargs=global_plot_settings, session_id=42)
#### EDA ----
exp.plot_model(plot="diagnostics", fig_kwargs={"height": 600, "width": 1200})
#### Croston Model for intermittent demand ----
model = exp.create_model("croston")
exp.plot_model(model)
#### Croston compared to other models ----
best = exp.compare_models(sort="RMSSE")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13580246913580246, 'fraction_numerical': 0.01899335232668566, 'mean_word_length': 5.8441558441558445, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '418317', 'license': 'MIT', 'n_tokens_mistral': 377, 'n_tokens_neox': 346, 'n_words': 79, 'path': 'time_series/pycaret_ts_croston.ipynb', 'repo_name': 'ngupta23/pycaret_faqs', 'size': '1053'}