{"id":46830,"date":"2025-03-21T00:00:00","date_gmt":"2025-03-21T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/"},"modified":"2025-11-13T12:57:17","modified_gmt":"2025-11-13T20:57:17","slug":"time-series-classification-with-amazon-chronos-model-with-griddb","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/","title":{"rendered":"Time Series Classification with Amazon Chronos Model with GridDB"},"content":{"rendered":"<p>This article shows how to build a time series forecasting model for electricity production using <a href=\"https:\/\/www.amazon.science\/code-and-datasets\/chronos-learning-the-language-of-time-series\">Amazon Chronos<\/a> and <a href=\"https:\/\/griddb.net\/en\/\">GridDB<\/a> database.<\/p>\n<p>We will retrieve historical electricity production data from Kaggle, insert it into a GridDB time series container, and use the data to train a forecasting model with Amazon Chronos, a specialized collection of time series models based on the T5 architecture.<\/p>\n<p>GridDB is a robust NOSQL database optimized for efficiently handling large volumes of real-time data. Its advanced in-memory processing and time series data management make it ideal for big data and IoT applications.<\/p>\n<p>GridDB&#8217;s real-time data processing capabilities and Chronos&#8217; state-of-the-art forecasting methods make them a powerful combination for time forecasting applications.<\/p>\n<h2>Prerequisites<\/h2>\n<p>You need to install the following libraries to run codes in this article.<\/p>\n<ol>\n<li>GridDB C Client<\/li>\n<li>GridDB Python client<\/li>\n<\/ol>\n<p>Instructions for installing these clients are available on <a href=\"https:\/\/pypi.org\/project\/griddb-python\/\">GridDB Python Package Index (Pypi)<\/a>.<\/p>\n<p>You must also install Amazon Chronos, Numpy, Pandas, and Matplotlib libraries.<\/p>\n<p>The scripts below will help you install and import the necessary libraries for running codes.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">%pip install git+https:\/\/github.com\/amazon-science\/chronos-forecasting.git\n%pip install matplotlib seaborn numpy pandas scikit-learn<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\nfrom matplotlib.dates import DateFormatter\nimport seaborn as sns\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom chronos import ChronosPipeline\nimport griddb_python as griddb\nfrom sklearn.metrics import mean_absolute_error<\/code><\/pre>\n<\/div>\n<h2>Inserting Time Series Data Into GriddB<\/h2>\n<p>The first step is to insert the time series data we want to forecast into GridDB. This section explains the steps involved.<\/p>\n<h3>Downloading and Importing Electricity Production Data from Kaggle<\/h3>\n<p>We will forecast future electricity production requirements using the <a href=\"https:\/\/www.kaggle.com\/datasets\/shenba\/time-series-datasets\">Electricity Production dataset from Kaggle<\/a>.<\/p>\n<p>The following script imports the CSV file containing the dataset into a pandas DataFrame.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">dataset = pd.read_csv(\"Electric_Production.csv\")\ndataset.head(10)<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img1-electricity-production-data.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img1-electricity-production-data.png\" alt=\"\" width=\"250\" height=\"430\" class=\"aligncenter size-full wp-image-31413\" srcset=\"\/wp-content\/uploads\/2025\/03\/img1-electricity-production-data.png 250w, \/wp-content\/uploads\/2025\/03\/img1-electricity-production-data-174x300.png 174w\" sizes=\"(max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>The dataset consists of monthly electricity production from 1st January 1985 to 1st January 2018.<\/p>\n<p>You can draw line plots to see that electricity production highly depends on the month of the year.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\"># Create the line plot\nsns.set_style(\"darkgrid\")\nplt.figure(figsize=(12, 7))\nsns.lineplot(data=dataset, x='DATE', y='IPG2211A2N', label='Electricity Production')\nplt.xlabel('Date')\nplt.ylabel('Electricity Production (IPG2211A2N)')\nplt.title('Electricity Production Over Time')\nplt.legend()\n\nplt.show()<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img2-electricity-production-line-plot.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img2-electricity-production-line-plot.png\" alt=\"\" width=\"1005\" height=\"624\" class=\"aligncenter size-full wp-image-31414\" srcset=\"\/wp-content\/uploads\/2025\/03\/img2-electricity-production-line-plot.png 1005w, \/wp-content\/uploads\/2025\/03\/img2-electricity-production-line-plot-300x186.png 300w, \/wp-content\/uploads\/2025\/03\/img2-electricity-production-line-plot-768x477.png 768w, \/wp-content\/uploads\/2025\/03\/img2-electricity-production-line-plot-600x373.png 600w\" sizes=\"(max-width: 1005px) 100vw, 1005px\" \/><\/a><\/p>\n<p>Once we have our dataset, we can insert this data into GridDB.<\/p>\n<h3>Connect to GriddB<\/h3>\n<p>To connect to GridDB, you need to create an object of the <code>StoreFactory<\/code> class. Next, call the <code>get_store()<\/code> method on the store factory object and pass the DB host and cluster names, user, and password.<\/p>\n<p>To test if the connection is successful, call the <code>get_container()<\/code> method and pass it the name of any container. If you see the following output, your connection is successful.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\"># GridDB connection details\nDB_HOST = \"127.0.0.1:10001\"\nDB_CLUSTER = \"myCluster\"\nDB_USER = \"admin\"\nDB_PASS = \"admin\"\n\n# creating a connection\n\nfactory = griddb.StoreFactory.get_instance()\n\ntry:\n    gridstore = factory.get_store(\n        notification_member = DB_HOST,\n        cluster_name = DB_CLUSTER,\n        username = DB_USER,\n        password = DB_PASS\n    )\n\n    container1 = gridstore.get_container(\"container1\")\n    if container1 == None:\n        print(\"Container does not exist\")\n    print(\"Successfully connected to GridDB\")\n\nexcept griddb.GSException as e:\n    for i in range(e.get_error_stack_size()):\n        print(\"[\", i, \"]\")\n        print(e.get_error_code(i))\n        print(e.get_location(i))\n        print(e.get_message(i))\n<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">Container does not exist\nSuccessfully connected to GridDB<\/code><\/pre>\n<\/div>\n<h3>Create Container for Electricity Production Data in GridDB<\/h3>\n<p>GrirDB stores data containers. You need the container name and column information to create a container.<\/p>\n<p>You can assign any name to your container. However, the container information must be a list of lists, each nested list containing the column name and the column type.<\/p>\n<p>For example, in the script below we have two columns: <code>TimeStamp<\/code> with column type <code>griddb.Type.TIMESTAP<\/code>, and <code>Production<\/code> with <code>griddb.Type.DOUBLE<\/code> type.<\/p>\n<p>Next, you need to create an object of the <code>ContainerInfo<\/code> class and pass the container name and column info to the <code>ContainerInfo<\/code> class constructor.<\/p>\n<p>Finally, call the <code>put_container()<\/code> method and pass to it the <code>ContainerInfo<\/code> class object to create a container in the GridDB.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">dataset['DATE'] = pd.to_datetime(dataset['DATE'])\n\n\ncontainer_name = \"Electricity_Production\"\ncolumn_info = [\n    [\"Timestamp\", griddb.Type.TIMESTAMP],\n    [\"Production\", griddb.Type.DOUBLE]\n]\ncontainer_info = griddb.ContainerInfo(container_name, column_info, griddb.ContainerType.TIME_SERIES)\n\n# Creating Container\ntry:\n    gridstore.put_container(container_info)\n    container = gridstore.get_container(container_name)\n    if container is None:\n        print(f\"Failed to create container: {container_name}\")\n    else:\n        print(f\"Successfully created container: {container_name}\")\n\nexcept griddb.GSException as e:\n    print(f\"Error creating or retrieving container {container_name}:\")\n    for i in range(e.get_error_stack_size()):\n        print(f\"[{i}]\")\n        print(f\"Error code: {e.get_error_code(i)}\")\n        print(f\"Location: {e.get_location(i)}\")\n        print(f\"Message: {e.get_message(i)}\")\n<\/code><\/pre>\n<\/div>\n<p><strong>Output<\/strong><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">Successfully created container: Electricity_Production<\/code><\/pre>\n<\/div>\n<p>You can retrieve the container you created using the <code>get_container()<\/code> method.<\/p>\n<p>The next step is to store our dataset in the container we just created.<\/p>\n<h3>Insert Electricity Production Data into GridDB Container<\/h3>\n<p>To insert data into our GridDB container, we will iterate through all the rows in our dataset, call our container object&#8217;s <code>put()<\/code> method, and pass the values from the <code>DATE<\/code> and <code>IPG2211A2N<\/code> columns to the method.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">try:\n    for index, row in dataset.iterrows():\n        container.put([row['DATE'].to_pydatetime(), row['IPG2211A2N']])\n    print(f\"Successfully inserted {len(dataset)} rows of data into {container_name}\")\n\nexcept griddb.GSException as e:\n    print(f\"Error inserting data into container {container_name}:\")\n    for i in range(e.get_error_stack_size()):\n        print(f\"[{i}]\")\n        print(f\"Error code: {e.get_error_code(i)}\")\n        print(f\"Location: {e.get_location(i)}\")\n        print(f\"Message: {e.get_message(i)}\")\n<\/code><\/pre>\n<\/div>\n<p><strong>Output<\/strong><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">Successfully inserted 397 rows of data into Electricity_Production<\/code><\/pre>\n<\/div>\n<p>We have successfully inserted the electricity production data into the GridDB. The next step is to forecast electricity production using Amazon&#8217;s Chronos model.<\/p>\n<h2>Forecasting Electricity Production using Amazon&#8217;s Chronos Time Series Model<\/h2>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2403.07815\">Amazon Chronos is a collection of pre-trained language models<\/a> specifically designed for time series forecasting. These models are based on the T5 (Text-to-Text Transfer Transformer) architecture, which has been adapted to handle time series data.<\/p>\n<h3>Retrieving Data from GridDB<\/h3>\n<p>We first need to retrieve data we stored in GridDB to forecast electricity production. To do so, you can use the <code>get_container()<\/code> method and pass it the container name you want to retrieve.<\/p>\n<p>Call the <code>SELECT *<\/code> query using the container&#8217;s <code>query()<\/code> method. Next, call the <code>fetch()<\/code> method to retrieve the dataset object. Finally, call the <code>fetch_rows()<\/code> method to store the dataset into a pandas DataFrame.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">def retrieve_data_from_griddb(container_name):\n\n    try:\n        stock_data_container = gridstore.get_container(container_name)\n\n        # Query all data from the container\n        query = stock_data_container.query(\"select *\")\n        rs = query.fetch()  # Adjust the number based on your data size\n\n        data = rs.fetch_rows()\n        data .set_index(\"Timestamp\", inplace=True)\n        return data\n\n    except griddb.GSException as e:\n        print(f\"Error retrieving data from GridDB: {e.get_message()}\")\n        return None\n\n\nelectric_production_data = retrieve_data_from_griddb(\"Electricity_Production\")\nelectric_production_data.head()<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img3-griddb-retrieved-data.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img3-griddb-retrieved-data.png\" alt=\"\" width=\"202\" height=\"222\" class=\"aligncenter size-full wp-image-31415\" \/><\/a><\/p>\n<h3>Forecasting Electricity Production using Amazon Chronos Model<\/h3>\n<p>Amazon Chronos models are available for free on <a href=\"https:\/\/huggingface.co\/collections\/amazon\/chronos-models-and-datasets-65f1791d630a8d57cb718444\">Hugging Face<\/a>. For making inferences, you can simply install the <a href=\"https:\/\/github.com\/amazon-science\/chronos-forecasting\">model from GitHub<\/a>.<\/p>\n<p>We will divide our dataset into a training and test set. Then, we will use the Amazon Chronos model to forecast electricity production for the months in the test set. Finally, we will evaluate the model&#8217;s performance by comparing the forecasted electricity production with the actual production.<\/p>\n<p>The following script divides the dataset into train and test sets. The dataset has a total of 397 records. We will use the last 47 records for testing.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\"># Define the test size and calculate the split index\ntest_size = 47\nsplit_index = len(electric_production_data) - test_size\n\n# Check if the data length is shorter than the test size\nif split_index &lt; 0:\n    train_production = pd.Series(dtype=float)\n    test_production = electric_production_data['Production']\nelse:\n    # Splitting the Production column into training and test sets\n    train_production = electric_production_data['Production'].iloc[:split_index]\n    test_production = electric_production_data['Production'].iloc[split_index:]\n\n# Display the results\nprint(\"Training Set:\")\nprint(train_production.shape)\nprint(\"nTest Set:\")\nprint(test_production.shape)<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">Training Set:\n(350,)\n\nTest Set:\n(47,)<\/code><\/pre>\n<\/div>\n<p>Next, we will import the pretrained Chronos t5 large model using the <code>ChronosPipeline.from_pretrained()<\/code> method.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">pipeline = ChronosPipeline.from_pretrained(\n  \"amazon\/chronos-t5-large\",\n  device_map=\"cuda\",\n  torch_dtype=torch.bfloat16,\n)<\/code><\/pre>\n<\/div>\n<p>Chronos models expect data to be in torch tensor format. The script below converts the data into torch tensors. Next, we use the <code>pipeline.predict()<\/code> method to forecast the next 47 months of electricity production based on the training data (context).<\/p>\n<p>We divide the predictions into three quantiles (0.1, 0.5, 0.9).<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">context = torch.tensor(train_production)\nprediction_length = test_size\nforecast = pipeline.predict(context, prediction_length)\nlow, median, high = np.quantile(forecast[0].numpy(), [0.1, 0.5, 0.9], axis=0)<\/code><\/pre>\n<\/div>\n<p>Next, we evaluate the model performance.<\/p>\n<h3>Evaluating Model Performance<\/h3>\n<p>We will plot the median forecast values against the test values. To do so, we will create a pandas DataFrame that contains our predictions.<\/p>\n<p>The following script plots the training set, test set, and predictions.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\ntest_production.index = pd.to_datetime(test_production.index)\nmedian_forecast = pd.Series(median, index=test_production.index, name=\"Median Forecast\")\n\nplt.figure(figsize=(12, 6))\nplt.plot(train_production.index, train_production, color='blue', label=\"Training Set\", linestyle=\"-\")\nplt.plot(test_production.index, test_production, color='green', linestyle=\"--\", label=\"Test Set\")\nplt.plot(median_forecast.index, median_forecast, color='red', linestyle=\":\", label=\"Median Forecast\")\n\n# Vertical line to mark the start of the test set\nplt.axvline(x=test_production.index[0], color='black', linestyle=\"--\", label=\"Test Set Start\")\n\nplt.xlabel(\"Timestamp\")\nplt.ylabel(\"Production\")\nplt.title(\"Production - Training, Test, and Predictions (Median Forecast)\")\nplt.legend()\nplt.show() <\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\" alt=\"\" width=\"1202\" height=\"650\" class=\"aligncenter size-full wp-image-31416\" srcset=\"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png 1202w, \/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot-300x162.png 300w, \/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot-768x415.png 768w, \/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot-1024x554.png 1024w, \/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot-600x324.png 600w\" sizes=\"(max-width: 1202px) 100vw, 1202px\" \/><\/a><\/p>\n<p>The above output shows that our model performs well and can capture the trends in the training dataset. The predictions are close to the values in the test set.<\/p>\n<p>Next, we will plot only the test values against the median prediction values and the 80% prediction interval.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">median_forecast = pd.Series(median, index=test_production.index, name=\"Median Forecast\")\nlower_bound = pd.Series(low, index=test_production.index, name=\"Lower Bound\")\nupper_bound = pd.Series(high, index=test_production.index, name=\"Upper Bound\")\n\n\nplt.figure(figsize=(12, 6))\n\nplt.plot(test_production.index, test_production, color='green', linestyle=\":\", label=\"Actual Production\")\nplt.plot(median_forecast.index, median_forecast, color='red', linestyle=\":\", label=\"Median Forecast\")\n\n# Plot the 80% prediction interval as an orange shaded area\nplt.fill_between(test_production.index, lower_bound, upper_bound, color='orange', alpha=0.3, label=\"80% Prediction Interval\")\n\nplt.xlabel(\"Timestamp\")\nplt.ylabel(\"Production\")\nplt.title(\"Production - Actual vs. Forecast with 80% Prediction Interval\")\nplt.legend()\nplt.show()<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval.png\" alt=\"\" width=\"1200\" height=\"656\" class=\"aligncenter size-full wp-image-31417\" srcset=\"\/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval.png 1200w, \/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval-300x164.png 300w, \/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval-1024x560.png 1024w, \/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval-768x420.png 768w, \/wp-content\/uploads\/2025\/03\/img5-prediction-with-80-percent-interval-600x328.png 600w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>The above output shows that prediction values in 80% intervals cover almost all the test data, showing that our model performs exceptionally well for forecasting time series data.<\/p>\n<p>Finally, we will plot the mean absolute error (MAE) values for the predictions to quantify the results.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">mae = mean_absolute_error(test_production, median_forecast)\n\n# Print results\nprint(\"Average electricity production values in the training set:\", train_production.mean())\nprint(\"Mean Absolute Error (MAE):\", mae)<\/code><\/pre>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre><code>Average electricity production values in the training set: 86.9775362857143\nMean Absolute Error (MAE): 3.2303302385930803\n<\/code><\/pre>\n<p>We obtain an MAE value of 3.23, indicating that, on average, our model\u2019s predictions are only 3.23 units off from the actual test values, just a 3.4% deviation from the average electricity production in the training set.<\/p>\n<h2>Conclusion<\/h2>\n<p>This article covered the complete workflow for time series forecasting with GridDB and Amazon Chronos. You saw how to connect to GridDB, insert time series data, and train an Amazon Chronos model to forecast electricity production. The results showed accurate predictions, capturing seasonal trends and providing reliable forecasts within an 80% confidence interval.<\/p>\n<p>Combining GridDB\u2019s robust time series data management with Chronos\u2019 specialized forecasting models provides a scalable solution for accurate time-series predictions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve historical electricity production data from Kaggle, insert it into a GridDB time series container, and use the data to train a forecasting model with Amazon Chronos, a specialized collection of time series [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":31416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46830","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Time Series Classification with Amazon Chronos Model with GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Time Series Classification with Amazon Chronos Model with GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-21T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:57:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1202\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Time Series Classification with Amazon Chronos Model with GridDB\",\"datePublished\":\"2025-03-21T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:57:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\"},\"wordCount\":1074,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\",\"name\":\"Time Series Classification with Amazon Chronos Model with GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\",\"datePublished\":\"2025-03-21T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:57:17+00:00\",\"description\":\"This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\",\"contentUrl\":\"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png\",\"width\":1202,\"height\":650},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.griddb.net\/en\/#website\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/www.griddb.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Time Series Classification with Amazon Chronos Model with GridDB | GridDB: Open Source Time Series Database for IoT","description":"This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve","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:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Time Series Classification with Amazon Chronos Model with GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve","og_url":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2025-03-21T07:00:00+00:00","article_modified_time":"2025-11-13T20:57:17+00:00","og_image":[{"width":1202,"height":650,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png","type":"image\/png"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Time Series Classification with Amazon Chronos Model with GridDB","datePublished":"2025-03-21T07:00:00+00:00","dateModified":"2025-11-13T20:57:17+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/"},"wordCount":1074,"commentCount":0,"publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/","url":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/","name":"Time Series Classification with Amazon Chronos Model with GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/www.griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png","datePublished":"2025-03-21T07:00:00+00:00","dateModified":"2025-11-13T20:57:17+00:00","description":"This article shows how to build a time series forecasting model for electricity production using Amazon Chronos and GridDB database. We will retrieve","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/time-series-classification-with-amazon-chronos-model-with-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png","contentUrl":"\/wp-content\/uploads\/2025\/03\/img4-train-test-prediction-lineplot.png","width":1202,"height":650},{"@type":"WebSite","@id":"https:\/\/www.griddb.net\/en\/#website","url":"https:\/\/www.griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/www.griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/www.griddb.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46830"}],"version-history":[{"count":2,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46830\/revisions"}],"predecessor-version":[{"id":51488,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46830\/revisions\/51488"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/31416"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}