{"id":50766,"date":"2021-09-30T00:00:00","date_gmt":"2021-09-30T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/"},"modified":"2025-11-14T07:54:56","modified_gmt":"2025-11-14T15:54:56","slug":"sales-forecasting-with-python-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/","title":{"rendered":"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c"},"content":{"rendered":"<p>\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u4f01\u696d\u306e\u8a08\u753b\u3084\u65b9\u5411\u6027\u3092\u5c0e\u304f\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u81ea\u5df1\u56de\u5e30\u7d71\u5408\u79fb\u52d5\u5e73\u5747\uff08ARIMA\uff09\u3001\u5b63\u7bc0\u81ea\u5df1\u56de\u5e30\u7d71\u5408\u79fb\u52d5\u5e73\u5747\uff08SARIMA\uff09\u3001\u30d9\u30af\u30c8\u30eb\u6570\uff08VAR\uff09\u306a\u3069\u3001\u4e16\u306e\u4e2d\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u3001Keras\u3092\u4f7f\u3063\u3066LSTM\uff08Long Short-term Memory\uff09\u30e2\u30c7\u30eb\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3059\u3002LSTM\u306f\u3001\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u30eb\u30fc\u30d7\u306b\u9811\u5065\u306a\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u4e00\u7a2e\u3067\u3059\u3002<\/p>\n<p>\u30ea\u30ab\u30ec\u30f3\u30c8\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u4e3b\u306a\u554f\u984c\u70b9\u3068\u3057\u3066\u3001\u6642\u9593\u306e\u7d4c\u904e\u3068\u3068\u3082\u306b\u3001\u96a0\u308c\u72b6\u614b\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\u60c5\u5831\u304c\u904e\u8ca0\u8377\u306b\u306a\u308b\u3053\u3068\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002LSTM\u306f\u3001\u30b9\u30c6\u30c3\u30d7\u304b\u3089\u30b9\u30c6\u30c3\u30d7\u3078\u6301\u7d9a\u3059\u308b\u8ffd\u52a0\u306e\u96a0\u308c\u72b6\u614b\u3092\u7dad\u6301\u3059\u308b\u3053\u3068\u3067\u3001\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u8efd\u6e1b\u3057\u307e\u3059\u3002LSTM\u306e\u8a73\u7d30\u306f<a href=\"https:\/\/direct.mit.edu\/neco\/article\/9\/8\/1735\/6109\/Long-Short-Term-Memory\">\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002GridDB\u306f\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u4fe1\u983c\u6027\u304c\u9ad8\u3044\u306e\u3067\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u5b66\u7fd2\u3084\u63a8\u8ad6\u306b\u6700\u9069\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3067\u304d\u307e\u3059\u3002GridDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u7c21\u5358\u3067\u3001<a href=\"https:\/\/docs.griddb.net\/ja\/gettingstarted\/python\/\">\u3053\u3061\u3089<\/a>\u306b\u8a73\u3057\u3044\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u3002Python-GridDB\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/www.youtube.com\/watch?v=yWCVfLoV9_0&amp;t=61s\">\u3053\u3061\u3089\u306e\u30d3\u30c7\u30aa<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>LSTM<\/h2>\n<h2>\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<p>\u307e\u305a\u306fGridDB\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3057\u3087\u3046<\/p>\n<h3>Ubuntu 20.04\u3067GridDB Python Client\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u884c\u3044\u307e\u3059\u3002<\/h3>\n<ul>\n<li>GridDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb <\/li>\n<\/ul>\n<p><a href=\"https:\/\/griddb.net\/ja\/downloads\/\">\u3053\u3061\u3089<\/a>\u304b\u3089deb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>C\u8a00\u8a9e\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b <\/li>\n<\/ul>\n<p><a href=\"https:\/\/software.opensuse.org\/download\/package?project=home:knonomura&amp;package=griddb-c-client\">\u3053\u3061\u3089<\/a>\u304b\u3089Ubuntu\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u5fc5\u8981\u6a5f\u6750\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb <\/li>\n<\/ul>\n<p>1) Swig \u30b3\u30f3\u30bd\u30fc\u30eb<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">\nwget https:\/\/github.com\/swig\/swig\/archive\/refs\/tags\/v4.0.2.tar.gz\ntar xvfz v4.0.2.tar.gz\ncd swig-4.0.2\n.\/autogen.sh\n.\/configure make<\/code><\/pre>\n<\/div>\n<p>2) python\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">\nwget  \nhttps:\/\/github.com\/griddb\/python_client\/archive\/refs\/tags\/0.8.4.zip \nunzip . 0.8.4.zip <\/code><\/pre>\n<\/div>\n<p>\u5bfe\u5fdc\u3059\u308bpython\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5bfe\u5fdc\u3059\u308bpython-dev\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001python 3.8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>3) \u6b63\u3057\u3044\u5834\u6240\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">\nexport CPATH=$CPATH:&lt;python header file directory path> \nexport LIBRARY_PATH=$LIBRARY_PATH:&lt;c client library file directory path> \n&lt;\/c>&lt;\/python><\/code><\/pre>\n<\/div>\n<p>\u307e\u305f\u3001<a href=\"https:\/\/griddb.net\/ja\/blog\/running-griddb-in-docker\/\">\u3053\u3061\u3089<\/a>\u306e\u3088\u3046\u306b\u3001Docker\u3067GridDB\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>Python \u30e9\u30a4\u30d6\u30e9\u30ea<\/h3>\n<p>\u6b21\u306b\u3001Python\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002plotly\u3001numpy\u3001keras\u3001tensorflow\u3001pandas\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001pip install\u3067\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">pip install keras \npip install numpy \npip install tensorflow \npip install plotly \npip install pandas <\/code><\/pre>\n<\/div>\n<h2>\u4e88\u6e2c<\/h2>\n<h3>\u30b9\u30c6\u30c3\u30d71\uff1a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h3>\n<p>\u3053\u306e<a href=\"https:\/\/www.kaggle.com\/kyanyoga\/sample-sales-data\/code\">Kaggle\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/a>\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u306f\u3001Order Info, Sales, Customer, Shipping\u306a\u3069\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001Segmentation, customer analytics, clustering\u306a\u3069\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u58f2\u4e0a\u4e88\u6e2c\u306b\u4f7f\u3046\u306e\u3067\u3001\u58f2\u4e0a\u3068\u6ce8\u6587\u306e\u65e5\u4ed8\u306e\u307f\u3092\u5bfe\u8c61\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u6708\u6b21\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30c6\u30c3\u30d72: \u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/h3>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nimport numpy as np \nimport pandas as pd \nimport plotly.offline as pyoff \nimport plotly.graph_objs as go \n<\/code><\/pre>\n<\/div>\n<h3>\u30b9\u30c6\u30c3\u30d73\uff1a\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\u3068\u51e6\u7406<\/h3>\n<h4>\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f<\/h4>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">data=pd.read_csv('\/content\/sales_data_sample.csv', encoding='cp1252') <\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u3067\u4f7f\u7528\u3057\u305f\u30a8\u30f3\u30b3\u30fc\u30c9\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001GridDB\u3092\u4f7f\u7528\u3057\u3066\u3053\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h4>\u7279\u5fb4\u91cf\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0<\/h4>\n<p>\u307e\u305a\u3001\u6708\u5358\u4f4d\u3067\u30c7\u30fc\u30bf\u3092\u7167\u5408\u3059\u308b\u3002\u5404\u65e5\u4ed8\u3092\u6708\u521d\u306bse\u3059\u308b\u3060\u3051\u3067\u3059\u3002\u305d\u3057\u3066\u3001\u305d\u306e\u6708\u306e\u5e73\u5747\u58f2\u4e0a\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u65e5\u306b\u58f2\u4e0a\u304c\u3042\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">data['ORDERDATE'] = pd.to_datetime(data['ORDERDATE']) \ndata['ORDERDATE'] = data['ORDERDATE'].dt.year.astype('str') + '-' + data['ORDERDATE'].dt.month.astype('str') + '-01' \ndata['ORDERDATE'] = pd.to_datetime(data['ORDERDATE']) \ndata = data.groupby('ORDERDATE').SALES.mean().reset_index() \n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306b\u3001\u58f2\u4e0a\u9ad8\u3092\u30d7\u30ed\u30c3\u30c8\u3057\u3066\u307f\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306b\u306f\u3001\u7279\u306b11\u6708\u9803\u306b\u5b63\u7bc0\u6027\u304c\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">plot_data = [ \n    go.Scatter( \n        x=data['ORDERDATE'], \n        y=data['SALES'], \n    ) \n] \nplot_layout = go.Layout( \n        title='Monthly Sales' \n    ) \nfig = go.Figure(data=plot_data, layout=plot_layout) \npyoff.iplot(fig) <\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/1.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/1.png\" alt=\"\" width=\"1818\" height=\"433\" class=\"aligncenter size-full wp-image-27787\" srcset=\"\/wp-content\/uploads\/2021\/09\/1.png 1818w, \/wp-content\/uploads\/2021\/09\/1-300x71.png 300w, \/wp-content\/uploads\/2021\/09\/1-1024x244.png 1024w, \/wp-content\/uploads\/2021\/09\/1-768x183.png 768w, \/wp-content\/uploads\/2021\/09\/1-1536x366.png 1536w, \/wp-content\/uploads\/2021\/09\/1-600x143.png 600w\" sizes=\"(max-width: 1818px) 100vw, 1818px\" \/><\/a><\/p>\n<p>\u6b21\u306b\u3001\u58f2\u4e0a\u9ad8\u306e\u5dee\u306e\u5217\u3092\u8ffd\u52a0\u3057\u3001\u30cc\u30eb\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u30cc\u30eb\u306f\u6700\u5f8c\u306e\u5024\u3060\u3051\u3067\u3001\u305d\u306e\u5dee\u306f\u4f5c\u308c\u306a\u3044\u306e\u3067\u30cc\u30eb\u306b\u306a\u308a\u307e\u3059\u3002\u30e9\u30b0\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30e2\u30c7\u30eb\u306f\u76f4\u8fd1\u306e\u58f2\u4e0a\u3060\u3051\u3067\u306a\u304f\u3001\u305d\u308c\u4ee5\u524d\u306e\u58f2\u4e0a\u304b\u3089\u3082\u5b66\u7fd2\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">df_supervised = data.copy() \ndf_supervised['prev_sales'] = df_supervised['SALES'].shift(1) \ndf_supervised['diff'] = (df_supervised['SALES'] - df_supervised['prev_sales'])\ndf_supervised = df_supervised.drop(['prev_sales'],axis=1) \nfor inc in range(1,3): \n    field_name = 'lag_' + str(inc) \n    df_supervised[field_name] = df_supervised['diff'].shift(inc) \n#drop null values \ndf_supervised = df_supervised.dropna().reset_index(drop=True) \n<\/code><\/pre>\n<\/div>\n<h4>\u30c7\u30fc\u30bf\u3092\u691c\u8a3c\u7528\u3068\u8a13\u7df4\u7528\u306b\u5206\u5272\u3059\u308b<\/h4>\n<p>\u6b21\u306b\u3001\u30c7\u30fc\u30bf\u3092\u30c6\u30b9\u30c8\u3068\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u306b\u5206\u3051\u307e\u3059\u3002\u30c6\u30b9\u30c8\u306b\u306f\u3001\u904e\u53bb6\u30f6\u6708\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nfrom sklearn.preprocessing import MinMaxScaler \ndf_model = df_supervised.drop(['SALES','ORDERDATE'],axis=1) \n#split train and test set \ntrain_set, test_set = df_model[0:-6].values, df_model[-6:].values \n<\/code><\/pre>\n<\/div>\n<p>\u307e\u305f\u3001\u30c7\u30fc\u30bf\u306e\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3082\u884c\u3044\u307e\u3059\u3002\u30c6\u30b9\u30c8\u30bb\u30c3\u30c8\u3068\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30bb\u30c3\u30c8\u3092\u5225\u3005\u306b\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3059\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001\u8a13\u7df4\u30bb\u30c3\u30c8\u3068\u30c6\u30b9\u30c8\u30bb\u30c3\u30c8\u304c\u72ec\u7acb\u3057\u305f\u307e\u307e\u3067\u3042\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#apply Min Max Scaler \nscaler = MinMaxScaler(feature_range=(-1, 1)) \nscaler = scaler.fit(train_set) \n# reshape training set \ntrain_set = train_set.reshape(train_set.shape[0], train_set.shape[1]) \ntrain_set_scaled = scaler.transform(train_set) \n# reshape test set \ntest_set = test_set.reshape(test_set.shape[0], test_set.shape[1]) \ntest_set_scaled = scaler.transform(test_set) <\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">X_train, y_train = train_set_scaled[:, 1:], train_set_scaled[:, 0:1] \nX_train = X_train.reshape(X_train.shape[0], 1, X_train.shape[1]) \nX_test, y_test = test_set_scaled[:, 1:], test_set_scaled[:, 0:1] \nX_test = X_test.reshape(X_test.shape[0], 1, X_test.shape[1]) <\/code><\/pre>\n<\/div>\n<h3>\u30b9\u30c6\u30c3\u30d74: \u4e88\u6e2c<\/h3>\n<p>\u6b21\u306b\u3001\u4e88\u6e2c\u51e6\u7406\u3092\u958b\u59cb\u3057\u307e\u3059\u3002<\/p>\n<h4>\u521d\u671f\u5316<\/h4>\n<p>\u307e\u305aKeras\u3067LSTM\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u306b<code>LSTM<\/code>\u30ec\u30a4\u30e4\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\"># define the keras model \nfrom keras.models import Sequential \nfrom keras.layers import LSTM, Dense \nmodel = Sequential() \nmodel.add(LSTM(4, batch_input_shape=(1, X_train.shape[1], X_train.shape[2]), stateful=True)) \nmodel.add(Dense(1)) <\/code><\/pre>\n<\/div>\n<h4>\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0<\/h4>\n<p>\u6b21\u306b\u3001\u30e2\u30c7\u30eb\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\u3002\u640d\u5931\u3068\u3057\u3066mean_squared_error\u3092\u4f7f\u7528\u3057\u3001\u7cbe\u5ea6\u3067\u8a55\u4fa1\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy']) <\/code><\/pre>\n<\/div>\n<p>\u6b21\u306b\u3001100\u30a8\u30dd\u30c3\u30af\u5206\u306e\u30e2\u30c7\u30eb\u306e\u5b66\u7fd2\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">history=model.fit(X_train, y_train, epochs=100, batch_size=1, verbose=1, shuffle=False) <\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">Epoch 72\/100 \n\n20\/20 [==============================] - 0s 2ms\/step - loss: 0.1302 - accuracy: 0.0000e+00 \nEpoch 73\/100 \n20\/20 [==============================] - 0s 2ms\/step - loss: 0.1287 - accuracy: 0.0000e+00 \nEpoch 74\/100 \n20\/20 [==============================] - 0s 2ms\/step - loss: 0.1272 - accuracy: 0.0000e+00 \nEpoch 75\/100 \n20\/20 [==============================] - 0s 2ms\/step - loss: 0.1258 - accuracy: 0.0000e+00 \nEpoch 76\/100 \n20\/20 [==============================] - 0s 2ms\/step - loss: 0.1244 - accuracy: 0.0000e+00 <\/code><\/pre>\n<\/div>\n<h4>\u8a55\u4fa1\u3068\u4e88\u6e2c<\/h4>\n<p>\u6700\u5f8c\u306b\u3001\u30c6\u30b9\u30c8\u30bb\u30c3\u30c8\u3092\u8a55\u4fa1\u3057\u3001\u4e88\u6e2c\u5024\u3092\u518d\u30b9\u30b1\u30fc\u30eb\u3057\u3066\u3001\u30b0\u30e9\u30f3\u30c9\u30c8\u30a5\u30eb\u30fc\u30b9\u3068\u3068\u3082\u306b\u30d7\u30ed\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">y_pred = model.predict(X_test,batch_size=1) \ny_pred = y_pred.reshape(y_pred.shape[0], 1, y_pred.shape[1]) \n\npred_test_set = [] \nfor index in range(0,len(y_pred)): \n    pred_test_set.append(np.concatenate([y_pred[index],X_test[index]],axis=1)) \n\npred_test_set = np.array(pred_test_set) \npred_test_set = pred_test_set.reshape(pred_test_set.shape[0], pred_test_set.shape[2]) \npred_test_set_inverted = scaler.inverse_transform(pred_test_set) \n\nresult_list = [] \nsales_dates = list(data[-7:].ORDERDATE) \nact_sales = list(data[-7:].SALES) \nfor index in range(0,len(pred_test_set_inverted)): \n    result_dict = {} \n    result_dict['pred_value'] = int(pred_test_set_inverted[index][0] + act_sales[index]) \n    result_dict['ORDERDATE'] = sales_dates[index] \n    result_list.append(result_dict) \n\ndf_result = pd.DataFrame(result_list) <\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">#merge with actual sales dataframe \ndf_sales_pred = pd.merge(data,df_result,on='ORDERDATE',how='left') \n#plot actual and predicted \nplot_data = [ \n    go.Scatter( \n        x=df_sales_pred['ORDERDATE'], \n        y=df_sales_pred['SALES'], \n        name='actual' \n    ), \n        go.Scatter( \n        x=df_sales_pred['ORDERDATE'], \n        y=df_sales_pred['pred_value'], \n        name='predicted' \n    ) \n] \nplot_layout = go.Layout( \n        title='Sales Prediction' \n    ) \nfig = go.Figure(data=plot_data, layout=plot_layout) \npyoff.iplot(fig) <\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/predicted.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/predicted.png\" alt=\"\" width=\"1818\" height=\"433\" class=\"aligncenter size-full wp-image-27786\" srcset=\"\/wp-content\/uploads\/2021\/09\/predicted.png 1818w, \/wp-content\/uploads\/2021\/09\/predicted-300x71.png 300w, \/wp-content\/uploads\/2021\/09\/predicted-1024x244.png 1024w, \/wp-content\/uploads\/2021\/09\/predicted-768x183.png 768w, \/wp-content\/uploads\/2021\/09\/predicted-1536x366.png 1536w, \/wp-content\/uploads\/2021\/09\/predicted-600x143.png 600w\" sizes=\"(max-width: 1818px) 100vw, 1818px\" \/><\/a><\/p>\n<p>\u4e88\u6e2c\u5024\u306f\u3001\u6570100\u306e\u8aa4\u5dee\u3067\u3001\u8fd1\u3044\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u975e\u5e38\u306b\u5358\u7d14\u306a\u30e2\u30c7\u30eb\u3067\u6570\u5206\u306e\u3046\u3061\u306b\u5341\u5206\u306b\u8fd1\u3044\u4e88\u6e2c\u304c\u3067\u304d\u308b\u3001\u4e88\u6e2c\u306e\u529b\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Keras\u3001python\u3001gridDB\u3092\u4f7f\u7528\u3057\u3066LSTM\u4e88\u6e2c\u30e2\u30c7\u30eb\u3092\u5b66\u7fd2\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u4f01\u696d\u306e\u8a08\u753b\u3084\u65b9\u5411\u6027\u3092\u5c0e\u304f\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u81ea\u5df1\u56de [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":49309,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50766","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>Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb\" \/>\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\/sales-forecasting-with-python-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.griddb.net\/ja\/\u672a\u5206\u985e\/sales-forecasting-with-python-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=\"2021-09-30T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:54:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/sales.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1160\" \/>\n\t<meta property=\"og:image:height\" content=\"653\" \/>\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=\"\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=\"4\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\/sales-forecasting-with-python-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c\",\"datePublished\":\"2021-09-30T07:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/\"},\"wordCount\":63,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/09\/sales.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/\",\"url\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/\",\"name\":\"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/09\/sales.png\",\"datePublished\":\"2021-09-30T07:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:56+00:00\",\"description\":\"\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2021\/09\/sales.png\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/09\/sales.png\",\"width\":1160,\"height\":653},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb.net\/ja\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","description":"\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb","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\/sales-forecasting-with-python-and-griddb\/","og_locale":"ja_JP","og_type":"article","og_title":"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","og_description":"\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb","og_url":"https:\/\/www.griddb.net\/ja\/\u672a\u5206\u985e\/sales-forecasting-with-python-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-09-30T07:00:00+00:00","article_modified_time":"2025-11-14T15:54:56+00:00","og_image":[{"width":1160,"height":653,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/sales.png","type":"image\/png"}],"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":"4\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#article","isPartOf":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c","datePublished":"2021-09-30T07:00:00+00:00","dateModified":"2025-11-14T15:54:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/"},"wordCount":63,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/09\/sales.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/","url":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/","name":"Python\u3068GridDB\u3092\u4f7f\u3063\u305f\u58f2\u4e0a\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/09\/sales.png","datePublished":"2021-09-30T07:00:00+00:00","dateModified":"2025-11-14T15:54:56+00:00","description":"\u58f2\u4e0a\u4e88\u6e2c\u3068\u306f\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u3001\u3042\u308b\u671f\u9593\u306e\u5c06\u6765\u306e\u58f2\u4e0a\u3092\u4e88\u6e2c\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u4e88\u6e2c\u306f\u3001\u591a\u304f\u306e\u4f01\u696d\u306e\u53ce\u76ca\u6027\u3092\u5de6\u53f3\u3059\u308b\u8cb4\u91cd\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308b\u305f\u3081\u3001\u7fd2\u5f97\u3059\u3079\u304d\u91cd\u8981\u306a\u30b9\u30ad\u30eb","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/sales-forecasting-with-python-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2021\/09\/sales.png","contentUrl":"\/wp-content\/uploads\/2021\/09\/sales.png","width":1160,"height":653},{"@type":"WebSite","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.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:\/\/griddb.net\/ja\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/comments?post=50766"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50766\/revisions"}],"predecessor-version":[{"id":51600,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50766\/revisions\/51600"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media\/49309"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media?parent=50766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/categories?post=50766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/tags?post=50766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}