{"id":5226,"date":"2023-02-21T10:18:19","date_gmt":"2023-02-21T18:18:19","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=5226"},"modified":"2025-04-29T14:06:37","modified_gmt":"2025-04-29T14:06:37","slug":"credit-card-fraud-detection-with-autoencoders","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/","title":{"rendered":"Credit Card Fraud Detection With Autoencoders"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter size-full wp-image-6993\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"928\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.13.35-PM.png\" alt=\"credit card fraud detection with autoencoders and comet ML\" class=\"wp-image-6993\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.13.35-PM.png 1348w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.13.35-PM-300x207.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.13.35-PM-1024x705.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.13.35-PM-768x529.png 768w\" sizes=\"auto, (max-width: 1348px) 100vw, 1348px\" \/><figcaption class=\"wp-element-caption\">Photo by Karolina Grabowska on pexels.com<\/figcaption><\/figure>\n\n\n\n<p>In this article, we\u2019ll leverage the power of autoencoders to address a key issue for banks and their customers: credit card fraud detection. Feel free to follow along with the full code tutorial in <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/colab.research.google.com\/drive\/1Jy3IiJenxeEO6TtfctlnZSaoNJo3sIZv?usp=sharing#scrollTo=9WgH9NGPf04E\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/colab.research.google.com\/drive\/1Jy3IiJenxeEO6TtfctlnZSaoNJo3sIZv?usp=sharing#scrollTo=9WgH9NGPf04E\">this Colab<\/a> and get <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.kaggle.com\/datasets\/mlg-ulb\/creditcardfraud\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.kaggle.com\/datasets\/mlg-ulb\/creditcardfraud\">the Kaggle dataset here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Credit Card&nbsp;Fraud<\/h2>\n\n\n\n<p class=\"graf graf--p\">Credit card fraud represents an important, yet complex challenge for banks. In 2021 alone, <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/nilsonreport.com\/mention\/1515\/1link\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/nilsonreport.com\/mention\/1515\/1link\/\">Nilson<\/a> estimated that credit card fraud had surpassed $28.5 billion dollars worldwide. And while effective fraud detection efforts, like the use of machine learning and deep learning algorithms, have helped bring about a steady decline in fraud since its peak in 2016, fraud still represents about 6.8% of international credit card transactions.<\/p>\n\n\n\n<p class=\"graf graf--p\">But fraudulent financial data comes with its own set of unique challenges. Fraudulent transactions represent anomalous data that make up a very small percentage of total transactions. This results in significant class imbalances that make many traditional evaluation metrics, like <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/machinelearningmastery.com\/failure-of-accuracy-for-imbalanced-class-distributions\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/machinelearningmastery.com\/failure-of-accuracy-for-imbalanced-class-distributions\/\">accuracy<\/a>, irrelevant.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote graf graf--blockquote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>If you aren\u2019t already, you can follow along with the full code in <a class=\"markup--anchor markup--blockquote-anchor\" href=\"https:\/\/colab.research.google.com\/drive\/1Jy3IiJenxeEO6TtfctlnZSaoNJo3sIZv?usp=sharing#scrollTo=9WgH9NGPf04E\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/colab.research.google.com\/drive\/1Jy3IiJenxeEO6TtfctlnZSaoNJo3sIZv?usp=sharing#scrollTo=9WgH9NGPf04E\"><strong class=\"markup--strong markup--blockquote-strong\">this Colab<\/strong><\/a>.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">The Data<\/h2>\n\n\n\n<p class=\"graf graf--p\">Our data consists of two days\u2019 worth of real bank transactions made by European cardholders in 2013. In this dataset, fraud makes up just 0.172% of all transactions, meaning a model that predicted \u201cno fraud\u201d for every single observation would still achieve an accuracy of over 98%! In the pie chart below, fraudulent transactions are represented by the tiny orange sliver.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5232\"><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"239\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-1.17.44-PM.png\" alt=\"A pie chart of normal and fraudulent credit card transactions, where the fraudulent transactions comprise a tiny sliver, demonstrating a major challenge of credit card fraud detection.\" class=\"wp-image-5232\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-1.17.44-PM.png 412w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-1.17.44-PM-300x174.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><figcaption class=\"wp-element-caption\">Image by author; note the tiny proportion of fraudulent samples<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">Additionally, in order to protect all personal identifiable information (<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.techtarget.com\/searchsecurity\/definition\/personally-identifiable-information-PII\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.techtarget.com\/searchsecurity\/definition\/personally-identifiable-information-PII\">PII<\/a>) in this dataset, all features (besides <code class=\"markup--code markup--p-code\">Time<\/code> and <code class=\"markup--code markup--p-code\">Amount<\/code>) have undergone a <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Principal_component_analysis\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Principal_component_analysis\">PCA<\/a> transformation. This means that we cannot use any domain knowledge for the purposes of feature engineering or selection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Data Visualization and Pre-processing<\/h2>\n\n\n\n<p class=\"graf graf--p\">Let\u2019s start out by visualizing our data. It would be impossible to plot 30 dimensions, so first we\u2019ll apply <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.manifold.TSNE.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.manifold.TSNE.html\">Scikit-Learn\u2019s implementation of t-SNE<\/a> to the data. <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/T-distributed_stochastic_neighbor_embedding\">t-SNE<\/a> is a dataset decomposition technique. Here we only plot the first two components with maximum information.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5245\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"484\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.20.10-PM.png\" alt=\"Scatterplot of the first two t-SNE components of credit card fraud data, where the two classes are practically indistinguishable.\" class=\"wp-image-5245\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.20.10-PM.png 728w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.20.10-PM-300x199.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><figcaption class=\"wp-element-caption\">Image by author; the two classes are effectively indistinguishable<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">We can observe in this graph that there is little difference between fraudulent and non-fraudulent transactions. Most machine learning models would struggle to classify this data as-is.<\/p>\n\n\n\n<p class=\"graf graf--p\">First, we\u2019ll perform some very basic transformations to the data before feeding it to our model. The original <code class=\"markup--code markup--p-code\">Time<\/code> feature represents the number of seconds elapsed between each transaction and the first transaction in the data. We\u2019ll convert this relative time measure to hour-of-the-day.<\/p>\n\n\n\n<p class=\"graf graf--p\">We also scale the <code class=\"markup--code markup--p-code\">Time<\/code> and <code class=\"markup--code markup--p-code\">Amount<\/code> features, as all other features (<code class=\"markup--code markup--p-code\">V1<\/code>, <code class=\"markup--code markup--p-code\">V2<\/code>,&nbsp;\u2026 <code class=\"markup--code markup--p-code\">V28<\/code>) were previously scaled during the PCA transformation. Finally, because we are training an autoencoder to \u201clearn\u201d the embeddings of a normal transaction, we\u2019ll subset just normal samples as our training dataset, and use a 50:50 split of normal and fraudulent samples for our validation set. We\u2019ll also set aside 250 samples for a test dataset of completely unseen data.<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/anmorgan24\/a14cc296692fcd3ded998bbd7fddbd25.js\"><\/script><\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Attacking Data Imbalance With Autoencoders<\/h2>\n\n\n\n<p class=\"graf graf--p\">Due to the stark class imbalances in this dataset, for this challenge we will use an Autoencoder. Autoencoders learn an implicit representation of normality from the \u201cnormal\u201d samples, allowing us to reserve our sparse fraudulent data samples for testing. During inference, new samples are compared against the embeddings of normal samples to determine whether or not they are fraudulent.<\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Model Training and Inference<\/h2>\n\n\n\n<p class=\"graf graf--p\">We define a simple Autoencoder model with two fully connected linear layers and the Tanh activation function. We\u2019ll be using mean squared error as our loss function and an Adam optimizer. We\u2019ll log all of this information to <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.comet.com\/site\/?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.comet.com\/site\/?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\">Comet<\/a>, an experiment tracking tool, so we can compare how different experiment runs performed later on.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/anmorgan24\/3cc61940b961b7becbdf44976a6872f8.js\"><\/script><\/p>\n\n\n\n<p class=\"graf graf--p\">We can quickly visualize this model architecture with the following diagram. Note that we start with 30 input nodes, then encode this information down to seven nodes, and then decode back to 30 output nodes.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5255\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"900\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/1_S3ziCrDR5SUkfH1MFdZB1w.png\" alt=\"A black and white diagram of our credit card fraud detection autoencoder in the FCNN style, where the layers contain 30, 14, 7, 14, and 30 nodes, respectively.\" class=\"wp-image-5255\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/1_S3ziCrDR5SUkfH1MFdZB1w.png 1600w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/1_S3ziCrDR5SUkfH1MFdZB1w-300x169.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/1_S3ziCrDR5SUkfH1MFdZB1w-1024x576.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/1_S3ziCrDR5SUkfH1MFdZB1w-768x432.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/1_S3ziCrDR5SUkfH1MFdZB1w-1536x864.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><figcaption class=\"wp-element-caption\">Image by author; A diagram of our simple autoencoder<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">Next, we define our training and validation loops. Note that we create our <code class=\"markup--code markup--p-code\">val_predictions<\/code> table by defining a pandas DataFrame within our validation loop and appending the relevant columns. We\u2019ll use this DataFrame to examine sample-level metrics in Comet after inference.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/anmorgan24\/0213c47906b12f120ece868e77eb7b4a.js\"><\/script><\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Precision-recall Curve vs Threshold Values<\/h2>\n\n\n\n<p class=\"graf graf--p\">Now that we\u2019ve run training and validation loops, let\u2019s examine the precision-recall tradeoff of our model at various threshold levels and plot the reconstruction error against our chosen threshold. To see how we defined our custom plotting functions, see the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/colab.research.google.com\/drive\/1Jy3IiJenxeEO6TtfctlnZSaoNJo3sIZv?usp=sharing#scrollTo=9WgH9NGPf04E\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/colab.research.google.com\/drive\/1Jy3IiJenxeEO6TtfctlnZSaoNJo3sIZv?usp=sharing#scrollTo=9WgH9NGPf04E\">Colab here<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5257\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"432\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/threshold_values_1.png\" alt=\"Line plot of our model's precision and recall scores across threshold values, where the values converge at an ideal threshold of 0.75.\" class=\"wp-image-5257\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/threshold_values_1.png 576w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/threshold_values_1-300x225.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><figcaption class=\"wp-element-caption\">Image by author; the ideal threshold is around 0.75<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">From the plot above, we can see the optimal threshold value for fraudulent transactions is around 0.75. Now let\u2019s plot the precision-recall tradeoff of the model with the threshold set to this value.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5258\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"432\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/precision_recall_curve_1.png\" alt=\"Line plot of the model's precision score plotted against its recall score, showing strong values for each.\" class=\"wp-image-5258\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/precision_recall_curve_1.png 576w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/precision_recall_curve_1-300x225.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><figcaption class=\"wp-element-caption\">Image by author; Precision-recall curve of our autoencoder&#8217;s performance on the dataset<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Visualizing Reconstruction Error of Credit Card Fraud<\/h2>\n\n\n\n<p class=\"graf graf--p\">Finally, let\u2019s visualize the reconstruction error with the threshold level applied to see how well it separates fraudulent transactions from non-fraudulent transactions.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5259\"><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"387\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.13.33-PM.png\" alt=\"Scatterplot of reconstruction error per normal and fraudulent sample, where the threshold does a good job of separating the classes.\" class=\"wp-image-5259\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.13.33-PM.png 545w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.13.33-PM-300x213.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><figcaption class=\"wp-element-caption\">Image by author; reconstructed labels with threshold of 0.75<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">Although some outliers are still misclassified, the threshold separates the vast majority of the reconstructed labels. Note that we used a 50:50 split of fraudulent and non-fraudulent data for the validation split.<\/p>\n\n\n\n<p class=\"graf graf--p\">To get a better understanding of how our autoencoder has learned to distinguish between the two classes, let\u2019s visualize plots of the raw data (before encoding) and the transformed data (after reconstruction). Here again, we\u2019ll apply t-SNE to each dataset and plot the first two components with maximum information.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1740\" height=\"536\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-7.27.28-PM.png\" alt=\"\" class=\"wp-image-5260\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-7.27.28-PM.png 1740w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-7.27.28-PM-300x92.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-7.27.28-PM-1024x315.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-7.27.28-PM-768x237.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-7.27.28-PM-1536x473.png 1536w\" sizes=\"auto, (max-width: 1740px) 100vw, 1740px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"graf graf--p\">Clearly the data on the right is much easier to separate (and therefore classify), than the data plotted on the left. It would be very difficult for a machine learning algorithm to classify the data on the left at all, so our autoencoder has proven very helpful.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"482\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.24.11-PM.png\" alt=\"\" class=\"wp-image-5261\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.24.11-PM.png 747w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-05-at-2.24.11-PM-300x194.png 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Classification Report and Evaluation<\/h2>\n\n\n\n<p class=\"graf graf--p\">Let\u2019s also take a look at the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.classification_report.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.classification_report.html\">classification report<\/a> of our validation data. Note that although the original dataset was highly imbalanced, we made a validation set that was roughly equally split between normal and fraudulent transactions. This gives our model a better opportunity to predict both classes, and also makes the evaluation metrics much more relevant.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-5262\"><img loading=\"lazy\" decoding=\"async\" width=\"1310\" height=\"474\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-8.29.38-AM.png\" alt=\"Sklearn classification report of our credit card fraud detection autoencoder\" class=\"wp-image-5262\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-8.29.38-AM.png 1310w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-8.29.38-AM-300x109.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-8.29.38-AM-1024x371.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2022-12-20-at-8.29.38-AM-768x278.png 768w\" sizes=\"auto, (max-width: 1310px) 100vw, 1310px\" \/><figcaption class=\"wp-element-caption\">Classification report from the first pass of our credit card fraud detection model<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">With a <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Precision_and_recall\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Precision_and_recall\">precision<\/a>, <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Precision_and_recall\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Precision_and_recall\">recall<\/a>, and <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/F-score\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/F-score\">F1-score<\/a> of 0.91, our model has done well! But can we do any better? Let\u2019s take a look at the data we logged to Comet to identify where our model might be improved. We can also check out how to monitor testing data statistics as our model gets a chance to look at new, unseen data.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter wp-image-5263\"><img loading=\"lazy\" decoding=\"async\" width=\"1070\" height=\"610\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-06-at-10.43.22-PM.png\" alt=\"Confusion matrix for our credit card fraud detection autoencoder after its first pass\" class=\"wp-image-5263\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-06-at-10.43.22-PM.png 1070w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-06-at-10.43.22-PM-300x171.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-06-at-10.43.22-PM-1024x584.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-06-at-10.43.22-PM-768x438.png 768w\" sizes=\"auto, (max-width: 1070px) 100vw, 1070px\" \/><figcaption class=\"wp-element-caption\">Image by author; confusion matrix of autoencoder predictions<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Debugging Our Fraud Detection Model With Data Panels<\/h2>\n\n\n\n<p class=\"graf graf--p\">Once we\u2019ve run training and inference, we can head over the <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.comet.com\/site\/?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.comet.com\/site\/?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\">Comet UI<\/a> to check out our Data Panels. Follow along with <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.comet.com\/anmorgan24\/datapanels\/view\/ndkH4IkEmrTdYr0hvO97AxjeY\/panels?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.comet.com\/anmorgan24\/datapanels\/view\/ndkH4IkEmrTdYr0hvO97AxjeY\/panels?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\">my public project here<\/a> and feel free to experiment with customization options like join types, column order, and more. We\u2019ll also take a peek at how to filter and sort the Data Panel to identify misclassified samples for retraining.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1422\" height=\"725\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/add_data_panels.gif\" alt=\"\" class=\"wp-image-5264\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"graf graf--p\">Data Panels are interactive so we can filter samples based on the ground truth labels and compare them to the model\u2019s predictions. Since not detecting fraudulent cases when they are actually occurring could potentially cost financial institutions a lot of money, we specifically want to look at instances where there was fraud, but the model predicted there wasn\u2019t (<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/False_positives_and_false_negatives\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/False_positives_and_false_negatives\">false negatives<\/a>).<\/p>\n\n\n\n<p class=\"graf graf--p\">We can also gather all instances where the model predicted there was fraud but there wasn\u2019t (<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/False_positives_and_false_negatives\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/False_positives_and_false_negatives\">false positives<\/a>). By re-training the autoencoder on these problematic samples, we can improve the model\u2019s representation of \u201cnormality\u201d for future runs.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1445\" height=\"777\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_c3YV4yhKvkqSHOaC.gif\" alt=\"\" class=\"wp-image-5265\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"graf graf--p\">We can also track how prediction columns are changing for the same samples across experiments. By concatenating the tables via columns, we can see side-by-side how our predictions compare to previous runs.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full wp-image-5267\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"624\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_QRvwIWlvS-rcFhIc-1.gif\" alt=\"Tracking sample credit card fraud predictions across experiment runs in Comet Data Panels\" class=\"wp-image-5267\"\/><figcaption class=\"wp-element-caption\">GIF by author;tracking sample predictions across experiment runs<\/figcaption><\/figure>\n\n\n\n<p class=\"graf graf--p\">Finally, we can also compare distribution shifts in the input data. If we were using different versions of data across experiments or running experiments over time, it would be a good idea to log some basic summary statistics (like those calculated with <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/pandas.pydata.org\/docs\/reference\/api\/pandas.DataFrame.describe.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/pandas.pydata.org\/docs\/reference\/api\/pandas.DataFrame.describe.html\">pd.df.describe<\/a>) of the input data. This will allow us to quantify the statistical differences between data and whether this is having a substantial impact on model performance.<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/anmorgan24\/5b5e9b39fbd8194de9ce4ec7cc3cbb87.js\"><\/script><\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"655\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_zEp-QRYbiPlZpj55.png\" alt=\"\" class=\"wp-image-5268\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_zEp-QRYbiPlZpj55.png 1600w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_zEp-QRYbiPlZpj55-300x123.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_zEp-QRYbiPlZpj55-1024x419.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_zEp-QRYbiPlZpj55-768x314.png 768w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/0_zEp-QRYbiPlZpj55-1536x629.png 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">Conclusion<\/h2>\n\n\n\n<p class=\"graf graf--p\">Thanks for making it all the way to the end and we hope you found this tutorial useful! To recap everything we\u2019ve accomplished, we:<\/p>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li>Loaded a notoriously imbalanced dataset<\/li>\n\n\n\n<li>Constructed a simple Autoencoder model<\/li>\n\n\n\n<li>Plotted reconstruction labels and defined a classification threshold<\/li>\n\n\n\n<li>Calculated validation metrics<\/li>\n\n\n\n<li>Logged sample and project-level data to Comet, an experiment tracking tool<\/li>\n\n\n\n<li>Examined specific instances where the model struggled and identified areas for improvement<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading graf graf--h3\">References and Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list postList\">\n<li><a class=\"markup--anchor markup--li-anchor\" data-href=\"https:\/\/nilsonreport.com\/mention\/1515\/1link\/\" href=\"https:\/\/nilsonreport.com\/mention\/1515\/1link\/\" target=\"_blank\" rel=\"noopener\">Nilson Report: Card Losses Dip to $28.58 Billion<\/a><\/li>\n\n\n\n<li><a class=\"markup--anchor markup--li-anchor\" data-href=\"https:\/\/www.kaggle.com\/datasets\/mlg-ulb\/creditcardfraud\" href=\"https:\/\/www.kaggle.com\/datasets\/mlg-ulb\/creditcardfraud\" target=\"_blank\" rel=\"noopener\">Kaggle\u2019s Credit Card Fraud Detection Dataset<\/a><\/li>\n\n\n\n<li><a class=\"markup--anchor markup--li-anchor\" data-href=\"https:\/\/www.comet.com\/anmorgan24\/datapanels\/view\/ndkH4IkEmrTdYr0hvO97AxjeY\/panels?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" href=\"https:\/\/www.comet.com\/anmorgan24\/datapanels\/view\/ndkH4IkEmrTdYr0hvO97AxjeY\/panels?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" target=\"_blank\" rel=\"noopener\">Comet public project with Data Panels<\/a><\/li>\n\n\n\n<li><a class=\"markup--anchor markup--li-anchor\" data-href=\"https:\/\/cometml.slack.com\/join\/shared_invite\/zt-1fa356mer-2AMqwrzobWAJNx1oo1KSpQ#\/shared-invite\/email?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" href=\"https:\/\/cometml.slack.com\/join\/shared_invite\/zt-1fa356mer-2AMqwrzobWAJNx1oo1KSpQ#\/shared-invite\/email?utm_source=Medium&amp;utm_medium=referral&amp;utm_content=data_panels_blog\" target=\"_blank\" rel=\"noopener\">Comet Community Slack channel<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we\u2019ll leverage the power of autoencoders to address a key issue for banks and their customers: credit card fraud detection. Feel free to follow along with the full code tutorial in this Colab and get the Kaggle dataset here. Credit Card&nbsp;Fraud Credit card fraud represents an important, yet complex challenge for banks. [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":6991,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,6,9,7],"tags":[18,25,14,26,27],"coauthors":[133],"class_list":["post-5226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-comet-community-hub","category-machine-learning","category-product","category-tutorials","tag-anomaly-detection","tag-autoencoders","tag-comet-ml","tag-credit-card-fraud-detection","tag-data-panels"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Credit Card Fraud Detection With Autoencoders<\/title>\n<meta name=\"description\" content=\"Leverage the power of Autoencoders and Comet Data Panels to address a key issue for banks and their customers: credit card fraud detection.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Credit Card Fraud Detection With Autoencoders\" \/>\n<meta property=\"og:description\" content=\"Leverage the power of Autoencoders and Comet Data Panels to address a key issue for banks and their customers: credit card fraud detection.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-21T18:18:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-29T14:06:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"304\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abby Morgan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@anmorgan2414\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abby Morgan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Credit Card Fraud Detection With Autoencoders","description":"Leverage the power of Autoencoders and Comet Data Panels to address a key issue for banks and their customers: credit card fraud detection.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/","og_locale":"en_US","og_type":"article","og_title":"Credit Card Fraud Detection With Autoencoders","og_description":"Leverage the power of Autoencoders and Comet Data Panels to address a key issue for banks and their customers: credit card fraud detection.","og_url":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-02-21T18:18:19+00:00","article_modified_time":"2025-04-29T14:06:37+00:00","og_image":[{"width":300,"height":304,"url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png","type":"image\/png"}],"author":"Abby Morgan","twitter_card":"summary_large_image","twitter_creator":"@anmorgan2414","twitter_site":"@Cometml","twitter_misc":{"Written by":"Abby Morgan","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/"},"author":{"name":"Abby Morgan","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/826ee39a2e30cf9d8d73155de09bb7b2"},"headline":"Credit Card Fraud Detection With Autoencoders","datePublished":"2023-02-21T18:18:19+00:00","dateModified":"2025-04-29T14:06:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/"},"wordCount":1495,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png","keywords":["Anomaly Detection","Autoencoders","Comet ML","Credit Card Fraud Detection","Data Panels"],"articleSection":["Comet Community Hub","Machine Learning","Product","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/","url":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/","name":"Credit Card Fraud Detection With Autoencoders","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png","datePublished":"2023-02-21T18:18:19+00:00","dateModified":"2025-04-29T14:06:37+00:00","description":"Leverage the power of Autoencoders and Comet Data Panels to address a key issue for banks and their customers: credit card fraud detection.","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#primaryimage","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png","width":300,"height":304,"caption":"zoomed in picture of Abraham Lincoln with 2 red lines across his face"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/credit-card-fraud-detection-with-autoencoders\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"Credit Card Fraud Detection With Autoencoders"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/826ee39a2e30cf9d8d73155de09bb7b2","name":"Abby Morgan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/dbbf1ae921ee179c768f508340415946","url":"https:\/\/secure.gravatar.com\/avatar\/28d4934d14261b4afe12e226f0eaa57c4fb0c2761ad4586eb9a5bec3b8160bc9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/28d4934d14261b4afe12e226f0eaa57c4fb0c2761ad4586eb9a5bec3b8160bc9?s=96&d=mm&r=g","caption":"Abby Morgan"},"description":"AI\/ML Growth Engineer @ Comet","sameAs":["https:\/\/www.comet.com\/","https:\/\/www.linkedin.com\/in\/anmorgan24\/","https:\/\/x.com\/anmorgan2414"],"url":"https:\/\/www.comet.com\/site\/blog\/author\/abigailmcomet-com\/"}]}},"jetpack_featured_media_url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-07-28-at-12.10.21-PM.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/5226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=5226"}],"version-history":[{"count":2,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/5226\/revisions"}],"predecessor-version":[{"id":15815,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/5226\/revisions\/15815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media\/6991"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=5226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=5226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=5226"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=5226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}