\begin{algorithm}[h!]
\caption{Motifs mining} 
\label{alg:1}
\textbf{Input:} 
Training set samples $\textbf{T}$ with labeled binary classes C = [0, 1]\\
\textbf{Output:} 
Extracted motifs for each class
\begin{algorithmic}[1]
\State Motifs = $\emptyset$
\State N = length($\textbf{T}$[0])
\Comment{Number of time series samples}
\State m = length($\textbf{T}$[0][0]) 
\Comment{Length of time series}
\For{$\textbf{T}_i$ $\leftarrow$ $\textbf{T}_1$ to $\textbf{T}_N$}
    \State Motifs $\gets$ $\emptyset$
    \For{l in [0.3m, 0.5m, 0.7m]}
         \State $W_{i,l}$  $\gets$ generateCandidates($\textbf{T}_i$, l)
         \For{all subsequences S in $W_{i,l}$}
             \State $D_S$ $\gets$ findDistances(S, $W_{i,l}$)
             \State quality $\gets$ assessCandidate(S, $D_S$)
             \State Motifs.add(i,start\_idx, end\_idx, S, quality)
             \Comment{The index of time series, the start idx and end idx of motifs will be stored}
         \EndFor
    \EndFor
\State sortByQuality(Motifs)
\EndFor
\State \Return $[[i\_0, start\_idx\_0, start\_idx\_0] , [i\_1, start\_idx\_1, start\_idx\_1]]$
\Comment{return the index information for motifs of different classes }
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
[h!]
\caption{Motifs mining}
\textbf{Input:}
Training set samples $\textbf{T}$ with labeled binary classes C = [0, 1]\\
\textbf{Output:}
Extracted motifs for each class
\begin{algorithmic}
[1]
\State Motifs = $\emptyset$
\State N = length($\textbf{T}$[0])
\Comment{Number of time series samples}
\State m = length($\textbf{T}$[0][0])
\Comment{Length of time series}
\For{$\textbf{T}_i$ $\leftarrow$ $\textbf{T}_1$ to $\textbf{T}_N$}
\State Motifs $\gets$ $\emptyset$
\For{l in [0.3m, 0.5m, 0.7m]}
\State $W_{i,l}$ $\gets$ generateCandidates($\textbf{T}_i$, l)
\For{all subsequences S in $W_{i,l}$}
\State $D_S$ $\gets$ findDistances(S, $W_{i,l}$)
\State quality $\gets$ assessCandidate(S, $D_S$)
\State Motifs.add(i,start\_idx, end\_idx, S, quality)
\Comment{The index of time series, the start idx and end idx of motifs will be stored}
\EndFor
\EndFor
\State sortByQuality(Motifs)
\EndFor
\State \Return $[[i\_0, start\_idx\_0, start\_idx\_0] , [i\_1, start\_idx\_1, start\_idx\_1]]$
\Comment{return the index information for motifs of different classes }
\end{algorithmic}
\end{algorithm}
{
    "title": "motif-guided time series counterfactual explanations",
    "id": "2211.04411",
    "abstract": "with the rising need of interpretable machine learning methods, there is a necessity for a rise in human effort to provide diverse explanations of the influencing factors of the model decisions. to improve the trust and transparency of ai-based systems, the explainable artificial intelligence (xai) field has emerged. the xai paradigm is bifurcated into two main categories: feature attribution and counterfactual explanation methods. while feature attribution methods are based on explaining the reason behind a model decision, counterfactual explanation methods discover the smallest input changes that will result in a different decision. in this paper, we aim at building trust and transparency in time series models by using motifs to generate counterfactual explanations. we propose motif-guided counterfactual explanation (mg-cf), a novel model that generates intuitive post-hoc counterfactual explanations that make full use of important motifs to provide interpretive information in decision-making processes. to the best of our knowledge, this is the first effort that leverages motifs to guide the counterfactual explanation generation. we validated our model using five real-world time-series datasets from the ucr repository. our experimental results show the superiority of mg-cf in balancing all the desirable counterfactual explanations properties in comparison with other competing state-of-the-art baselines.",
    "categories": "cs.lg",
    "doi": "",
    "created": "2022-11-08",
    "updated": "2024-02-01",
    "authors": [
        "peiyu li",
        "soukaina filali boubrahimi",
        "shah muhammad hamdi"
    ],
    "affiliation": [],
    "url": "https://arxiv.org/abs/2211.04411"
}
{
    "ToxicityFilter": {
        "text_to_toxicity_attributes": {
            "mybib.bbl": {
                "toxicity_score": 0.011874928,
                "severe_toxicity_score": 0.0011348724,
                "identity_attack_score": 0.003866276,
                "insult_score": 0.0075508766,
                "profanity_score": 0.014532468,
                "threat_score": 0.007521313,
                "sexually_explicit_score": 0.010969753,
                "flirtation_score": 0.27629572
            },
            "mybib.bib": {
                "toxicity_score": 0.004869349,
                "severe_toxicity_score": 0.0008916855,
                "identity_attack_score": 0.0009943173,
                "insult_score": 0.006173368,
                "profanity_score": 0.012585391,
                "threat_score": 0.0057347976,
                "sexually_explicit_score": 0.00896453,
                "flirtation_score": 0.31566563
            },
            "mybib.tex": {
                "toxicity_score": 0.012880214,
                "severe_toxicity_score": 0.0010967255,
                "identity_attack_score": 0.0040512653,
                "insult_score": 0.007892879,
                "profanity_score": 0.014976538,
                "threat_score": 0.0076766624,
                "sexually_explicit_score": 0.012149297,
                "flirtation_score": 0.23857248
            },
            "llncs.cls": {
                "toxicity_score": 0.0025289198,
                "severe_toxicity_score": 0.00032424927,
                "identity_attack_score": 0.00068446033,
                "insult_score": 0.0057316152,
                "profanity_score": 0.009135309,
                "threat_score": 0.005618286,
                "sexually_explicit_score": 0.0040399362,
                "flirtation_score": 0.61743
            },
            "readme.txt": {
                "toxicity_score": 0.022964042,
                "severe_toxicity_score": 0.0014400482,
                "identity_attack_score": 0.005512681,
                "insult_score": 0.012338906,
                "profanity_score": 0.016616182,
                "threat_score": 0.007598988,
                "sexually_explicit_score": 0.00979021,
                "flirtation_score": 0.26585522
            },
            "splncs04.bst": {
                "toxicity_score": 0.0109324735,
                "severe_toxicity_score": 0.0010919571,
                "identity_attack_score": 0.0029598286,
                "insult_score": 0.007797878,
                "profanity_score": 0.015454767,
                "threat_score": 0.0067445673,
                "sexually_explicit_score": 0.012916001,
                "flirtation_score": 0.39611804
            }
        },
        "reason": null
    }
}
{
    "num_done": {
        "figure": 0,
        "algorithm": 3,
        "plot": 0
    }
}
{
    "NonTrivialRenderingFilter": {
        "white_pixels_ratio": 90.91747693841936,
        "hash": "033f3f8f87833f01",
        "most_frequent_color_ratio": 90.91747693841936
    }
}