{"id":50879,"date":"2023-11-22T00:00:00","date_gmt":"2023-11-22T08:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/"},"modified":"2025-11-14T07:56:29","modified_gmt":"2025-11-14T15:56:29","slug":"forecasting-timeseries-data-using-djl-and-griddb","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/","title":{"rendered":"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306f\u3069\u3053\u306b\u3067\u3082\u3042\u308a\u307e\u3059\u3002\u682a\u4fa1\u3084\u5929\u5019\u30d1\u30bf\u30fc\u30f3\u304b\u3089\u58f2\u4e0a\u9ad8\u3084\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u307e\u3067\u3001\u79c1\u305f\u3061\u306e\u751f\u6d3b\u306e\u69d8\u3005\u306a\u5834\u9762\u3067\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u3044\u307e\u3059\u3002\u904e\u53bb\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u5c06\u6765\u306e\u5024\u3092\u4e88\u6e2c\u3067\u304d\u308b\u3053\u3068\u306f\u3001\u60c5\u5831\u306b\u57fa\u3065\u3044\u305f\u610f\u601d\u6c7a\u5b9a\u3092\u884c\u3046\u4e0a\u3067\u975e\u5e38\u306b\u8cb4\u91cd\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Deep Java Library\uff08DJL\uff09\u3068GridDB\u3092\u4f7f\u3063\u3066\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u4e88\u6e2c\u3059\u308b\u65b9\u6cd5\u3092\u63a2\u308a\u307e\u3059\u3002<\/p>\n<h2>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u7279\u5fb4<\/h2>\n<p>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3068\u306f\u3001\u6642\u7cfb\u5217\u306b\u4e26\u3093\u3060\u30c7\u30fc\u30bf\u306e\u3053\u3068\u3067\u3001\u5404\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306f\u7279\u5b9a\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u91d1\u878d\u3001\u30d8\u30eb\u30b9\u30b1\u30a2\u3001IoT\u306a\u3069\u69d8\u3005\u306a\u9818\u57df\u3067\u666e\u53ca\u3057\u3066\u3044\u307e\u3059\u3002\u52b9\u679c\u7684\u306a\u6642\u7cfb\u5217\u4e88\u6e2c\u3092\u884c\u3046\u306b\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u6642\u9593\u7684\u30d1\u30bf\u30fc\u30f3\u3092\u6349\u3048\u3001\u7406\u89e3\u3067\u304d\u308b\u30c4\u30fc\u30eb\u3084\u30c6\u30af\u30cb\u30c3\u30af\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h2>Deep Java Library\uff08DJL\uff09\u306e\u7d39\u4ecb<\/h2>\n<p>DJL\u306f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30fb\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001Java\u958b\u767a\u8005\u306b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u30d1\u30ef\u30fc\u3092\u3082\u305f\u3089\u3059\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u8a13\u7df4\u6e08\u307f\u30e2\u30c7\u30eb\u3001\u30ab\u30b9\u30bf\u30e0\u30e2\u30c7\u30eb\u3092\u8a13\u7df4\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\u3001TensorFlow\u3001PyTorch\u3001MXNet\u306e\u3088\u3046\u306a\u69d8\u3005\u306a\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u306e\u30b7\u30fc\u30e0\u30ec\u30b9\u306a\u7d71\u5408\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<h2>\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u305f\u3081\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0<\/h2>\n<p>\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306f\u3001\u8907\u96d1\u306a\u6642\u7cfb\u5217\u4e88\u6e2c\u554f\u984c\u306e\u89e3\u6c7a\u306b\u76ee\u899a\u307e\u3057\u3044\u6210\u679c\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002DeepAR\uff08Deep Autoregressive\uff09\u306e\u3088\u3046\u306a\u30e2\u30c7\u30eb\u306f\u3001\u8907\u96d1\u306a\u6642\u9593\u4f9d\u5b58\u95a2\u4fc2\u3092\u6349\u3048\u3001\u6b63\u78ba\u306a\u4e88\u6e2c\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002DJL\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u30e2\u30c7\u30eb\u3092\u6642\u7cfb\u5217\u4e88\u6e2c\u30bf\u30b9\u30af\u306b\u7c21\u5358\u306b\u5b9f\u88c5\u3001\u5c55\u958b\u3059\u308b\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<h2>\u6642\u7cfb\u5217\u4e88\u6e2c\u306bDJL\u3092\u4f7f\u7528\u3059\u308b<\/h2>\n<p>\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u305f\u3081\u306bDJL\u3092\u4f7f\u3044\u59cb\u3081\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c Maven \u306b\u57fa\u3065\u3044\u3066\u3044\u308b\u3068\u4eee\u5b9a\u3059\u308b\u3068\u3001POM \u30d5\u30a1\u30a4\u30eb\u306e\u4f9d\u5b58\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u3053\u308c\u3089\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">\n        &lt;dependency&gt;\n            &lt;groupId&gt;ai.djl&lt;\/groupId&gt;\n            &lt;artifactId&gt;api&lt;\/artifactId&gt;\n            &lt;version&gt;0.23.0&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;ai.djl.timeseries&lt;\/groupId&gt;\n            &lt;artifactId&gt;timeseries&lt;\/artifactId&gt;\n            &lt;version&gt;0.23.0&lt;\/version&gt;\n        &lt;\/dependency&gt; \n            &lt;groupId&gt;ai.djl.mxnet&lt;\/groupId&gt;\n            &lt;artifactId&gt;mxnet-model-zoo&lt;\/artifactId&gt;\n            &lt;version&gt;${djl.version}&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;!-- ONNXRuntime --&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;ai.djl.onnxruntime&lt;\/groupId&gt;\n            &lt;artifactId&gt;onnxruntime-engine&lt;\/artifactId&gt;\n            &lt;version&gt;${djl.version}&lt;\/version&gt;\n        &lt;\/dependency&gt;<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306b\u3001\u74b0\u5883\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3001\u3044\u304f\u3064\u304b\u306e\u91cd\u8981\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u30fb\u30b9\u30cb\u30da\u30c3\u30c8\u3092\u8a73\u3057\u304f\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\n\/\/ Import necessary libraries\nimport ai.djl.Model;\nimport ai.djl.ModelException;\nimport ai.djl.basicdataset.tabular.utils.Feature;\nimport ai.djl.inference.Predictor;\nimport ai.djl.metric.Metrics;\nimport ai.djl.ndarray.*;\nimport ai.djl.timeseries.Forecast;\nimport ai.djl.timeseries.TimeSeriesData;\nimport ai.djl.timeseries.dataset.FieldName;\nimport ai.djl.timeseries.dataset.TimeFeaturizers;\nimport ai.djl.timeseries.distribution.DistributionLoss;\nimport ai.djl.timeseries.distribution.output.DistributionOutput;\n\/\/ ... other necessary imports ...\n\npublic class MonthlyProductionForecast {\n    \/\/ Constants and configurations\n    \n    final static String FREQ = \"W\";\n    final static int PREDICTION_LENGTH = 4;\n    final static LocalDateTime START_TIME = LocalDateTime.parse(\"2011-01-29T00:00\");\n    final static String MODEL_OUTPUT_DIR = \"outputs\";\n     public static void main(String[] args) throws Exception {\n        Logger.getAnonymousLogger().info(\"Starting...\");        \n        startTraining();\n        final Map result = predict();\n        for (Map.Entry entry : result.entrySet()) {\n            Logger.getAnonymousLogger().info(String.format(\"metric: %s:t%.2f\", entry.getKey(), entry.getValue()));\n        }\n    }\n}<\/code><\/pre>\n<\/div>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u5b8c\u5168\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u3053\u3061\u3089\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\uff1a <a href=\"https:\/\/github.com\/ambagape\/dij-griddb\">GitHub \u30ea\u30dd\u30b8\u30c8\u30ea<\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u3001\u6642\u7cfb\u5217\u4e88\u6e2c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u69cb\u6210\u3092\u8a2d\u5b9a\u3057\u3001\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u3001DJL\u3092\u4f7f\u7528\u3057\u3066DeepAR\u30e2\u30c7\u30eb\u3092\u5b66\u7fd2\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b\u306e\u304b\u3092\u5206\u89e3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>\n<p>\u5fc5\u8981\u306aDJL\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u983b\u5ea6\u3001\u4e88\u6e2c\u9577\u3001\u958b\u59cb\u6642\u9593\u306a\u3069\u306e\u5b9a\u6570\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p><code>main<\/code> \u30e1\u30bd\u30c3\u30c9\u306f\u5b66\u7fd2\u30d7\u30ed\u30bb\u30b9\u3092\u958b\u59cb\u3057\u3001GridDB\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u3066\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u30b7\u30fc\u30c9\u3057\u307e\u3059\u3002GridDB\u306f\u5206\u6563\u578b\u3067\u62e1\u5f35\u6027\u306e\u9ad8\u3044NoSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308a\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e88\u6e2c\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3001\u30c7\u30fc\u30bf\u30ed\u30fc\u30c9\u306e\u305f\u3081\u306e\u69d8\u3005\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>GridDB \u306b\u3064\u3044\u3066<\/h2>\n<p>GridDB\u306f\u3001\u5927\u91cf\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u30fb\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u5f37\u529b\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u305d\u306e\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u53d6\u308a\u8fbc\u307f\u3068\u30af\u30a8\u30ea\u6a5f\u80fd\u306b\u3088\u308a\u3001\u6642\u7cfb\u5217\u4e88\u6e2c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u6700\u9069\u306a\u9078\u629e\u80a2\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>GridDB \u3078\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u683c\u7d0d<\/h2>\n<p>\u307e\u305a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067GridDB\u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306b\u3001maven\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">\n        &lt;dependency&gt;\n            &lt;groupId&gt;com.github.griddb&lt;\/groupId&gt;\n            &lt;artifactId&gt;gridstore-jdbc&lt;\/artifactId&gt;\n            &lt;version&gt;5.3.0&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;com.github&lt;\/groupId&gt;\n            &lt;artifactId&gt;gridstore&lt;\/artifactId&gt;\n            &lt;version&gt;5.3.0&lt;\/version&gt;\n        &lt;\/dependency&gt;  <\/code><\/pre>\n<\/div>\n<p>\u6b21\u306b\u3001\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6295\u5165\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002GridDBDataset\u30af\u30e9\u30b9\u306e <code>seedDatabase<\/code> \u30e1\u30bd\u30c3\u30c9\u3067\u3001GridDB\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6295\u5165\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306f2\u3064\u306ecsv\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u307e\u308c\u30012\u3064\u306e\u5225\u3005\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u305d\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\n  private static void seedDatabase() throws Exception {\n          URL trainingData = Forecaster.class.getClassLoader().getResource(\"data\/weekly_sales_train_validation.csv\");\n            URL validationData = Forecaster.class.getClassLoader().getResource(\"data\/weekly_sales_train_evaluation.csv\");\n            String[] nextRecord;\n            try ( GridStore store = GridDBDataset.connectToGridDB();  CSVReader csvReader = new CSVReader(new InputStreamReader(trainingData.openStream(), StandardCharsets.UTF_8));  CSVReader csvValidationReader = new CSVReader(new InputStreamReader(validationData.openStream(), StandardCharsets.UTF_8))) {\n                store.dropContainer(TRAINING_COLLECTION_NAME);\n                store.dropContainer(VALIDATION_COLLECTION_NAME);\n\n                List columnInfoList = new ArrayList&lt;>();\n\n                nextRecord = csvReader.readNext();\n                for (int i = 0; i &lt; nextRecord.length; i++) {\n                    ColumnInfo columnInfo = new ColumnInfo(nextRecord[i], GSType.STRING);\n                    columnInfoList.add(columnInfo);\n                }\n\n                ContainerInfo containerInfo = new ContainerInfo();\n                containerInfo.setColumnInfoList(columnInfoList);\n                containerInfo.setName(TRAINING_COLLECTION_NAME);\n                containerInfo.setType(ContainerType.COLLECTION);\n\n                Container container = store.putContainer(TRAINING_COLLECTION_NAME, containerInfo, false);\n\n                while ((nextRecord = csvReader.readNext()) != null) {\n                    Row row = container.createRow();\n                    for (int i = 0; i &lt; nextRecord.length; i++) {\n                        row.setString(i, nextRecord[i]);\n                    }\n                    container.put(row);\n                }\n\n                nextRecord = csvValidationReader.readNext();\n                columnInfoList.clear();\n                for (int i = 0; i &lt; nextRecord.length; i++) {\n                    ColumnInfo columnInfo = new ColumnInfo(nextRecord[i], GSType.STRING);\n                    columnInfoList.add(columnInfo);\n                }\n\n                containerInfo = new ContainerInfo();\n                containerInfo.setName(VALIDATION_COLLECTION_NAME);\n                containerInfo.setColumnInfoList(columnInfoList);\n                containerInfo.setType(ContainerType.COLLECTION);\n\n                container = store.putContainer(VALIDATION_COLLECTION_NAME, containerInfo, false);\n                while ((nextRecord = csvValidationReader.readNext()) != null) {\n                    Row row = container.createRow();\n                    for (int i = 0; i &lt; nextRecord.length; i++) {\n                        String cell = nextRecord[i];\n                        row.setString(i, cell);\n                    }\n                    container.put(row);\n                }\n            }\n    }<\/code><\/pre>\n<\/div>\n<h2>DJL \u3068 GridDB \u306e\u7d71\u5408<\/h2>\n<p>DJL\u3068GridDB\u306f\u30b7\u30fc\u30e0\u30ec\u30b9\u306b\u9023\u643a\u3057\u307e\u3059\u3002GridDB\u306b\u63a5\u7d9a\u3057\u3066\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001DJL\u3092\u4f7f\u7528\u3057\u3066\u4e88\u6e2c\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3001\u5b66\u7fd2\u3001\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059\u3002<code>GridDBDataset<\/code> \u30af\u30e9\u30b9\u306f\u3001GridDB\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3068\u3084\u308a\u53d6\u308a\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<p>DJL\u306eTimeSeriesDataset\u306e\u30ab\u30b9\u30bf\u30e0\u5b9f\u88c5\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001DJL\u3068\u30ab\u30b9\u30bf\u30e0\u30c7\u30fc\u30bf\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30b7\u30fc\u30e0\u30ec\u30b9\u306b\u7d71\u5408\u3059\u308b\u305f\u3081\u306e\u6700\u3082\u72ec\u5275\u7684\u306a\u65b9\u6cd5\u306e1\u3064\u3067\u3059\u3002\u305d\u306e\u5b9f\u88c5\u304c\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\n...\npublic class GridDBDataset extends M5Forecast {\n\n    ...\n\n    public static GridStore connectToGridDB() throws GSException {\n        Properties props = new Properties();\n        props.setProperty(\"notificationMember\", \"127.0.0.1:10001\");\n        props.setProperty(\"clusterName\", \"defaultCluster\");\n        props.setProperty(\"user\", \"admin\");\n        props.setProperty(\"password\", \"admin\");\n        return GridStoreFactory.getInstance().getGridStore(props);\n    }\n\n    public static class GridDBBuilder extends M5Forecast.Builder {\n    ...\n\n        private File fetchDBDataAndSaveCSV(GridStore store) throws GSException, FileNotFoundException {\n           File csvOutputFile = new File(this.getContainerName()+ \".csv\");\n            try ( GridStore store2 = store) {\n                Container container = store2.getContainer(this.getContainerName());\n\n                Query query = container.query(\"Select *\");\n                RowSet rowSet = query.fetch();\n\n                int columnCount = rowSet.getSchema().getColumnCount();\n\n                List csv = new LinkedList&lt;>();\n                StringBuilder builder = new StringBuilder();\n\n                \/\/Loan column headers\n                ContainerInfo cInfo = rowSet.getSchema();\n                for (int i = 0; i &lt; cInfo.getColumnCount(); i++) {\n                    ColumnInfo columnInfo = rowSet.getSchema().getColumnInfo(i);\n                    builder.append(columnInfo.getName());\n                    appendComma(builder, i, cInfo.getColumnCount());\n                }\n                csv.add(builder.toString());\n\n                \/\/Load each row\n                while (rowSet.hasNext()) {\n                    Row row = rowSet.next();\n                    builder = new StringBuilder();\n                    for (int i = 0; i &lt; columnCount; i++) {\n                        String val = row.getString(i);\n                        builder.append(val);\n                        appendComma(builder, i, columnCount);\n                    }\n                    csv.add(builder.toString());\n                }\n                try ( PrintWriter pw = new PrintWriter(csvOutputFile)) {\n                    csv.stream()\n                            .forEach(pw::println);\n                }\n            }\n            return csvOutputFile;\n        }\n\n        public GridDBBuilder initData() throws GSException, FileNotFoundException {\n            this.csvFile = fetchDBDataAndSaveCSV(this.store);\n            return this;\n        }\n\n        @Override\n        public GridDBDataset build() {\n            GridDBDataset gridDBDataset = null;\n            try {\n                gridDBDataset = new GridDBDataset(this);\n            } catch (GSException | FileNotFoundException ex) {\n                Logger.getLogger(GridDBDataset.class.getName()).log(Level.SEVERE, null, ex);\n            }\n            return gridDBDataset;\n        }\n\n    }\n}<\/code><\/pre>\n<\/div>\n<h2>\u9ad8\u5ea6\u306a\u6642\u7cfb\u5217\u4e88\u6e2c\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9<\/h2>\n<p>\u6211\u3005\u306e\u4e88\u6e2c\u80fd\u529b\u306e\u4e2d\u6838\u306fDeepAR\u30e2\u30c7\u30eb\u306b\u3042\u308a\u307e\u3059\u3002<code>startTraining<\/code> \u30e1\u30bd\u30c3\u30c9\u3067DeepAR\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3001\u8a13\u7df4\u3001\u8a55\u4fa1\u3057\u307e\u3059\u3002DJL\u306e\u4f7f\u3044\u3084\u3059\u3044API\u306b\u3088\u308a\u3001\u30e2\u30c7\u30eb\u30fb\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3092\u5b9a\u7fa9\u3057\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3067\u8a13\u7df4\u3059\u308b\u3053\u3068\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nprivate static void startTraining() throws IOException, TranslateException, Exception {\n\n        DistributionOutput distributionOutput = new NegativeBinomialOutput();\n\n        Model model = null;\n        Trainer trainer = null;\n        NDManager manager = null;\n        try {\n            manager = NDManager.newBaseManager();\n            model = Model.newInstance(\"deepar\");\n            DeepARNetwork trainingNetwork = getDeepARModel(distributionOutput, true);\n            model.setBlock(trainingNetwork);\n\n            List trainingTransformation = trainingNetwork.createTrainingTransformation(manager);\n\n            Dataset trainSet = getDataset(Dataset.Usage.TRAIN, trainingNetwork.getContextLength(), trainingTransformation);\n\n            trainer = model.newTrainer(setupTrainingConfig(distributionOutput));\n            trainer.setMetrics(new Metrics());\n\n            int historyLength = trainingNetwork.getHistoryLength();\n            Shape[] inputShapes = new Shape[9];\n            \/\/ (N, num_cardinality)\n            inputShapes[0] = new Shape(1, 1);\n            \/\/ (N, num_real) if use_feat_stat_real else (N, 1)\n            inputShapes[1] = new Shape(1, 1);\n            \/\/ (N, history_length, num_time_feat + num_age_feat)\n            inputShapes[2] = new Shape(1, historyLength, TimeFeature.timeFeaturesFromFreqStr(FREQ).size() + 1);\n            inputShapes[3] = new Shape(1, historyLength);\n            inputShapes[4] = new Shape(1, historyLength);\n            inputShapes[5] = new Shape(1, historyLength);\n            inputShapes[6] = new Shape(1, 1, TimeFeature.timeFeaturesFromFreqStr(FREQ).size() + 1);\n            inputShapes[7] = new Shape(1, 1);\n            inputShapes[8] = new Shape(1, 1);\n            trainer.initialize(inputShapes);\n            int epoch = 10;\n            EasyTrain.fit(trainer, epoch, trainSet, null);\n        } finally {\n            if (trainer != null) {\n                trainer.close();\n            }\n            if (model != null) {\n                model.close();\n            }\n            if (manager != null) {\n                manager.close();\n            }\n        }\n    }<\/code><\/pre>\n<\/div>\n<p>\u305d\u308c\u3067\u306f <code>startTraining<\/code> \u30e1\u30bd\u30c3\u30c9\u306e\u5404\u30b9\u30c6\u30c3\u30d7\u3092\u5206\u89e3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 1\uff1a\u30e2\u30c7\u30eb\u306e\u5206\u5e03\u51fa\u529b\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001NegativeBinomialOutput\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u5206\u5e03\u51fa\u529b\u306f\u3001\u30e2\u30c7\u30eb\u304c\u4e88\u6e2c\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 2: getDeepARModel \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001DeepAR \u5b66\u7fd2\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306f\u3001DeepAR \u30e2\u30c7\u30eb\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u91cd\u8981\u306a\u306e\u306f\u3001\u3053\u308c\u304c\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3059\u305f\u3081\u306b true \u3092\u6e21\u3059\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 3: \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u5909\u63db\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u63db\u306f\u5165\u529b\u30c7\u30fc\u30bf\u306b\u9069\u7528\u3055\u308c\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u306b\u5099\u3048\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306e\u6b63\u898f\u5316\u3001\u7279\u5fb4\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u306a\u3069\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 4\uff1agetDataset\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u6e96\u5099\u3057\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306fDeepAR\u30e2\u30c7\u30eb\u306e\u5b66\u7fd2\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u3068\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u306e\u76ee\u6a19\u5024\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 5: \u30e2\u30c7\u30eb\u3092\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3059\u308b\u305f\u3081\u306e\u30c8\u30ec\u30fc\u30ca\u30fc\u3092\u4f5c\u6210\u3057\u3001\u8a2d\u5b9a\u3057\u307e\u3059\u3002setupTrainingConfig\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u640d\u5931\u95a2\u6570\u3001\u8a55\u4fa1\u5b50\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30ea\u30b9\u30ca\u30fc\u3092\u542b\u3080\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u69cb\u6210\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 6\uff1a\u5165\u529b\u5f62\u72b6\u3067\u30c8\u30ec\u30fc\u30ca\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\uff0c\u30c8\u30ec\u30fc\u30ca\u304c\u30e2\u30c7\u30eb\u306b\u671f\u5f85\u3055\u308c\u308b\u5165\u529b\u5f62\u72b6\u3092\u77e5\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0einputShapes \u914d\u5217\u306b\u306f\u3001\u30e2\u30c7\u30eb\u306e\u69d8\u3005\u306a\u5165\u529b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u5f62\u72b6\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30c6\u30c3\u30d7 7: \u6700\u5f8c\u306b\u3001EasyTrain.fit\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u3044\u3066\u30e2\u30c7\u30eb\u306e\u5b66\u7fd2\u3092\u958b\u59cb\u3057\u307e\u3059\u3002\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30a8\u30dd\u30c3\u30af\u6570\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\uff08trainSet\uff09\u3001\u305d\u306e\u4ed6\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30c8\u30ec\u30fc\u30ca\u306f\u30e2\u30c7\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6700\u9069\u5316\u3057\u3066\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u640d\u5931\u95a2\u6570\u3092\u6700\u5c0f\u5316\u3057\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u3067\u306e\u6027\u80fd\u3092\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u5168\u4f53\u3068\u3057\u3066 <code>startTraining<\/code> \u30e1\u30bd\u30c3\u30c9\u306f\u30e2\u30c7\u30eb\u3092\u8a2d\u5b9a\u3057\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u6e96\u5099\u3057\u3001\u30c8\u30ec\u30fc\u30ca\u3092\u521d\u671f\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u305f\u3081\u306e DeepAR \u30e2\u30c7\u30eb\u3092\u8a2d\u5b9a\u3057\u3001\u8a13\u7df4\u3057\u307e\u3059\u3002\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u3088\u308a\u3001\u904e\u53bb\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u6b63\u78ba\u306a\u4e88\u6e2c\u3092\u884c\u3046\u305f\u3081\u306e\u30e2\u30c7\u30eb\u306e\u52b9\u679c\u7684\u306a\u5b66\u7fd2\u304c\u4fdd\u8a3c\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u4e88\u6e2c\u3059\u308b<\/h2>\n<p>\u5b66\u7fd2\u5f8c\u3001<code>predict<\/code> \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u5b66\u7fd2\u3057\u305f\u30e2\u30c7\u30eb\u306b\u57fa\u3065\u3044\u3066\u4e88\u6e2c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u30e2\u30c7\u30eb\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306b\u3001RMSSE (Root Mean Squared Scaled Error)\u3001MSE (Mean Squared Error)\u3001\u5206\u4f4d\u70b9\u640d\u5931\u306a\u3069\u306e\u69d8\u3005\u306a\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001DJL\u3068GridDB\u3092\u4f7f\u7528\u3057\u3066\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u4e88\u6e2c\u3059\u308b\u65b9\u6cd5\u3092\u63a2\u308a\u307e\u3057\u305f\u3002\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3001DJL\u3001GridDB \u306e\u4e3b\u8981\u6982\u5ff5\u3092\u7d39\u4ecb\u3057\u3001\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u305f\u3081\u306e DeepAR \u30e2\u30c7\u30eb\u306e\u69cb\u7bc9\u3068\u5b66\u7fd2\u306b\u95a2\u308f\u308b\u30b3\u30fc\u30c9\u306e\u8a73\u7d30\u306a\u8aac\u660e\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u30d1\u30ef\u30fc\u3068GridDB\u306e\u52b9\u7387\u6027\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u304b\u3089\u8cb4\u91cd\u306a\u6d1e\u5bdf\u3092\u5f15\u304d\u51fa\u3057\u3001\u30d3\u30b8\u30cd\u30b9\u3084\u7814\u7a76\u306e\u305f\u3081\u306b\u60c5\u5831\u306b\u57fa\u3065\u3044\u305f\u610f\u601d\u6c7a\u5b9a\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002DJL\u306e\u4f7f\u3044\u3084\u3059\u3055\u3068\u67d4\u8edf\u6027\u306f\u3001\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u8ab2\u984c\u306b\u53d6\u308a\u7d44\u3082\u3046\u3068\u3059\u308b\u3042\u3089\u3086\u308bJava\u958b\u767a\u8005\u306b\u3068\u3063\u3066\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u7d50\u8ad6\u3068\u3057\u3066\u3001DJL\u3068GridDB\u306e\u76f8\u4e57\u52b9\u679c\u306b\u3088\u308a\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u6f5c\u5728\u80fd\u529b\u3092\u6d3b\u7528\u3057\u3001\u69d8\u3005\u306a\u9818\u57df\u3067\u3088\u308a\u826f\u3044\u610f\u601d\u6c7a\u5b9a\u3092\u4fc3\u9032\u3059\u308b\u6b63\u78ba\u306a\u4e88\u6e2c\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u5f97\u305f\u77e5\u8b58\u306b\u3088\u308a\u3001\u6700\u5148\u7aef\u306e\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u6280\u8853\u3068\u5805\u7262\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30fb\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u65c5\u306b\u51fa\u308b\u305f\u3081\u306e\u5341\u5206\u306a\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>DJL\u3068GridDB\u306e\u878d\u5408\u306f\u3001\u6642\u7cfb\u5217\u4e88\u6e2c\u306e\u4e16\u754c\u306b\u65b0\u305f\u306a\u53ef\u80fd\u6027\u3092\u958b\u304d\u307e\u3059\u3002\u3053\u306e\u5206\u91ce\u3092\u3088\u308a\u6df1\u304f\u6398\u308a\u4e0b\u3052\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u99c6\u52d5\u578b\u6d1e\u5bdf\u306e\u529b\u3068\u3001\u305d\u308c\u304c\u91d1\u878d\u304b\u3089\u30d8\u30eb\u30b9\u30b1\u30a2\u307e\u3067\u5e45\u5e83\u3044\u696d\u754c\u306b\u3069\u306e\u3088\u3046\u306a\u9769\u547d\u3092\u3082\u305f\u3089\u3059\u304b\u3092\u767a\u898b\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002\u63a2\u6c42\u3057\u7d9a\u3051\u307e\u3057\u3087\u3046\u3001\u5b66\u3073\u7d9a\u3051\u3001\u81ea\u4fe1\u3092\u6301\u3063\u3066\u672a\u6765\u3092\u4e88\u6e2c\u3057\u7d9a\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306f\u3069\u3053\u306b\u3067\u3082\u3042\u308a\u307e\u3059\u3002\u682a\u4fa1\u3084\u5929\u5019\u30d1\u30bf\u30fc\u30f3\u304b\u3089\u58f2\u4e0a\u9ad8\u3084\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u307e\u3067\u3001\u79c1\u305f\u3061\u306e\u751f\u6d3b\u306e\u69d8\u3005\u306a\u5834\u9762\u3067\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u3044\u307e\u3059\u3002\u904e\u53bb\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u5c06\u6765\u306e\u5024\u3092\u4e88\u6e2c\u3067\u304d\u308b\u3053\u3068\u306f\u3001\u60c5\u5831\u306b\u57fa\u3065\u3044\u305f\u610f [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":49118,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1005"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u306f\u3058\u3081\u306b\" \/>\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.griddb.net\/ja\/\u672a\u5206\u985e\/forecasting-timeseries-data-using-djl-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u306f\u3058\u3081\u306b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.griddb.net\/ja\/\u672a\u5206\u985e\/forecasting-timeseries-data-using-djl-and-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=\"2023-11-22T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:56:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c\",\"datePublished\":\"2023-11-22T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:56:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/\"},\"wordCount\":92,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/\",\"url\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/\",\"name\":\"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg\",\"datePublished\":\"2023-11-22T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:56:29+00:00\",\"description\":\"\u306f\u3058\u3081\u306b\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg\",\"contentUrl\":\"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg\",\"width\":1920,\"height\":1280},{\"@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\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@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\":\"ja\",\"@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\/ja\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","description":"\u306f\u3058\u3081\u306b","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.griddb.net\/ja\/\u672a\u5206\u985e\/forecasting-timeseries-data-using-djl-and-griddb\/","og_locale":"ja_JP","og_type":"article","og_title":"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","og_description":"\u306f\u3058\u3081\u306b","og_url":"https:\/\/www.griddb.net\/ja\/\u672a\u5206\u985e\/forecasting-timeseries-data-using-djl-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2023-11-22T08:00:00+00:00","article_modified_time":"2025-11-14T15:56:29+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg","type":"image\/jpeg"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"\u57f7\u7b46\u8005":"griddb-admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#article","isPartOf":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c","datePublished":"2023-11-22T08:00:00+00:00","dateModified":"2025-11-14T15:56:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/"},"wordCount":92,"commentCount":0,"publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/","url":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/","name":"Deep Java Library (DJL) \u3068 GridDB \u3092\u7528\u3044\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/www.griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg","datePublished":"2023-11-22T08:00:00+00:00","dateModified":"2025-11-14T15:56:29+00:00","description":"\u306f\u3058\u3081\u306b","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/forecasting-timeseries-data-using-djl-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg","contentUrl":"\/wp-content\/uploads\/2020\/06\/artificial-intelligence-1.jpg","width":1920,"height":1280},{"@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":"ja"},{"@type":"Organization","@id":"https:\/\/www.griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/www.griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@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":"ja","@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\/ja\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/comments?post=50879"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50879\/revisions"}],"predecessor-version":[{"id":51705,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50879\/revisions\/51705"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/media\/49118"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/media?parent=50879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/categories?post=50879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/ja\/wp-json\/wp\/v2\/tags?post=50879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}