### Installing mSSA Package from Source (Shell) Source: https://github.com/abdullaho/mssa/blob/master/README.md This snippet demonstrates how to install the mSSA package from its source directory using pip3. It assumes the user has already cloned the repository and is executing the command from the root of the cloned directory. ```Shell pip3 install . ``` -------------------------------- ### Loading Time Series Data with Pandas (Python) Source: https://github.com/abdullaho/mssa/blob/master/README.md This Python snippet shows how to load a CSV file containing time series data into a pandas DataFrame. It uses the `pandas.read_csv` function to read an example dataset provided with the mSSA package, which serves as input for the mSSA model. ```Python import pandas as pd df = pd.read_csv("mssa/examples/testdata/tables/mixturets_var.csv") ``` -------------------------------- ### Predicting Time Series with mSSA in Python Source: https://github.com/abdullaho/mssa/blob/master/API.md This method performs predictions using the mSSA model. It takes a column name (`col_name`), a start time (`t1`), and an optional end time (`t2`) for the prediction range. It allows configuring the number of models to use (`num_models`), whether to return confidence intervals (`confidence_interval`, `confidence`, `uq_method`), and options for using imputed values (`use_imputed`) or returning variance (`return_variance`). ```Python predict(col_name, t1, t2=None, num_models=10, confidence_interval=True, use_imputed=False, return_variance=False, confidence=95, uq_method='Gaussian') ``` -------------------------------- ### Initializing and Fitting mSSA Model (Python) Source: https://github.com/abdullaho/mssa/blob/master/README.md This Python snippet demonstrates how to import the `mSSA` class, initialize an mSSA model instance, and fit it to a specific time series column ('ts') from a pandas DataFrame. The `update_model` method is used to train the model on the provided data. ```Python from mssa.mssa import mSSA model = mSSA() model.update_model(df.loc[:,['ts']]) ``` -------------------------------- ### Initializing mSSA Class in Python Source: https://github.com/abdullaho/mssa/blob/master/API.md This snippet defines the constructor for the `mssa.mSSA` class, used for Multivariate Singular Spectrum Analysis. It allows configuration of various model parameters such as the number of singular values to retain (`rank`, `rank_var`), segmentation behavior (`segment`, `T`, `gamma`, `T0`), matrix dimensions (`col_to_row_ratio`, `L`), data preprocessing (`agg_interval`, `agg_method`, `normalize`, `fill_in_missing`), and uncertainty quantification settings (`uncertainty_quantification`, `p`, `direct_var`). The `persist_L` parameter is also available for specific use cases. ```Python class mssa.mSSA(rank=None, rank_var=None,segment=False, T=int(2.5e7), T_var=None, gamma=0.2, T0=10, col_to_row_ratio=5, agg_interval=None, agg_method='average', uncertainty_quantification=True, p=None, direct_var=True, L=None, persist_L=None, normalize=True, fill_in_missing=False ) ``` -------------------------------- ### Forecasting Multiple Time Series Entries with mSSA (Python) Source: https://github.com/abdullaho/mssa/blob/master/README.md This Python snippet shows how to use the `predict` function of the mSSA model to forecast a range of future entries. It targets the 'ts' time series and predicts values from index 100001 up to 100100, demonstrating its forecasting capability. ```Python prediction = model.predict('ts', 100001,100100) ``` -------------------------------- ### Updating mSSA Model with New Data in Python Source: https://github.com/abdullaho/mssa/blob/master/API.md This method updates the `mSSA` model with new time series entries provided in a pandas DataFrame. It serves both for initial model fitting and subsequent updates. If `self.segment` is enabled, the function dynamically builds or updates sub-models based on `T` and `gamma` parameters. The `df` parameter is a pandas DataFrame containing the new data. ```Python update_model(df) ``` -------------------------------- ### Imputing a Single Time Series Entry with mSSA (Python) Source: https://github.com/abdullaho/mssa/blob/master/README.md This Python snippet illustrates how to use the `predict` function of the mSSA model to impute a single missing or corrupted entry. It targets the 'ts' time series and predicts the value at the 1000th entry. ```Python prediction = model.predict('ts',1000) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.