{"id":46665,"date":"2021-09-24T00:00:00","date_gmt":"2021-09-24T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/neural-networks-with-python-and-griddb\/"},"modified":"2025-11-13T12:55:35","modified_gmt":"2025-11-13T20:55:35","slug":"neural-networks-with-python-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/","title":{"rendered":"Neural Networks with Python and GridDB"},"content":{"rendered":"<p>Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex relationships in data and have been shown to work for a variety of applications from finance to robotics. Inspired by the human brain, Neural Networks work on the principle of signal transmission from one neuron to the other. Neural networks comprise of mainly three types of node layers &#8212; an input layer, one or more hidden layers, and an output layer. Each node is an artificial neuron which connects to another using a nonlinear function and has an associated weight and threshold. The neuron is activated only if the output is above the specified threshold value. This is how the data is passed along to the next layer of the network.<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/nn.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/nn.png\" alt=\"\" width=\"1200\" height=\"1443\" class=\"aligncenter size-full wp-image-27758\" srcset=\"\/wp-content\/uploads\/2021\/09\/nn.png 1200w, \/wp-content\/uploads\/2021\/09\/nn-249x300.png 249w, \/wp-content\/uploads\/2021\/09\/nn-852x1024.png 852w, \/wp-content\/uploads\/2021\/09\/nn-768x924.png 768w, \/wp-content\/uploads\/2021\/09\/nn-600x722.png 600w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>Toshiba GridDB is a highly scalable database optimized for IoT and Big Data. GridDB lets us collect, store and query large amount of data easily. Moreover, GridDB is highly scalable and ensures high reliability, as a result it can server as a great database for neural networks training and inference. Installing GridDB is pretty simple, and is well documented <a href=\"https:\/\/docs.griddb.net\/gettingstarted\/python\/\">here<\/a>. To checkout the python-gridDB client please refer to <a href=\"https:\/\/www.youtube.com\/watch?v=yWCVfLoV9_0&amp;t=61s\">this video<\/a>.<\/p>\n<p>In this post we will create train a simple neural network based classification model in python with GridDB. We will use Keras, which is an easy-to-use free open source Python library for developing and evaluating deep learning models.<\/p>\n<h2>Setup<\/h2>\n<p>Let&#8217;s setup GridDB first!<\/p>\n<h3>Quick setup of GridDB Python Client on Ubuntu 20.04:<\/h3>\n<ul>\n<li>\n<p>Install GridDB Download and install the deb from <a href=\"https:\/\/griddb.net\/en\/downloads\/\">here<\/a>.<\/p>\n<\/li>\n<li>\n<p>Install C client Download and install the Ubuntu from <a href=\"https:\/\/software.opensuse.org\/download\/package?project=home:knonomura&amp;package=griddb-c-client\">here<\/a>.<\/p>\n<\/li>\n<li>\n<p>Install requirements 1) Swig<\/p>\n<\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">wget 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\nmake<\/code><\/pre>\n<\/div>\n<p>2) Install python client<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">wget \nhttps:\/\/github.com\/griddb\/python_client\/archive\/refs\/tags\/0.8.4.zip\nunzip . 0.8.4.zip<\/code><\/pre>\n<\/div>\n<p>Make sure you have python-dev installed for the corresponding python version. We will use python 3.8 for this post.<\/p>\n<p>3) We also need to point to the correct locations<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">export CPATH=$CPATH:&lt;python header file directory path>\nexport LIBRARY_PATH=$LIBRARY_PATH:&lt;c client library file directory path>&lt;\/c>&lt;\/python><\/code><\/pre>\n<\/div>\n<p>We can also use GridDB with docker as shown <a href=\"https:\/\/griddb.net\/en\/blog\/running-griddb-in-docker\/\">here<\/a><\/p>\n<h3>Python libraries<\/h3>\n<p>Next we install the python libraries. Installing matplotlib, numpy, keras, tensorflow and pandas is a simple pip install.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">pip install keras\npip install numpy\npip install tensorflow\npip install matplotlib\npip install pandas<\/code><\/pre>\n<\/div>\n<h2>Prediction<\/h2>\n<h3>Step 1: Downloading Dataset<\/h3>\n<p>We will use a publicly available dataset from Kaggle. For this post we have picked the <a href=\"https:\/\/www.kaggle.com\/iabhishekofficial\/mobile-price-classification?select=train.csv\">mobile price classification<\/a>. The aim is to classify cellphones into four price categories. Below is the description of the dataset.<\/p>\n<table>\n<thead>\n<tr>\n<th>column<\/th>\n<th>description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>battery_power<\/td>\n<td>Total energy a battery can store in one time measured in mAh<\/td>\n<\/tr>\n<tr>\n<td>blue<\/td>\n<td>Has Bluetooth or not<\/td>\n<\/tr>\n<tr>\n<td>clock_speed<\/td>\n<td>speed at which microprocessor executes instructions<\/td>\n<\/tr>\n<tr>\n<td>dual_sim<\/td>\n<td>Has dual sim support or not<\/td>\n<\/tr>\n<tr>\n<td>fc<\/td>\n<td>Front Camera megapixels<\/td>\n<\/tr>\n<tr>\n<td>four_g<\/td>\n<td>Has 4G or not<\/td>\n<\/tr>\n<tr>\n<td>int_memory<\/td>\n<td>Internal Memory in Gigabytes<\/td>\n<\/tr>\n<tr>\n<td>m_dep<\/td>\n<td>Mobile Depth in cm<\/td>\n<\/tr>\n<tr>\n<td>mobile_wt<\/td>\n<td>Weight of mobile phone<\/td>\n<\/tr>\n<tr>\n<td>n_cores<\/td>\n<td>Number of cores of processor<\/td>\n<\/tr>\n<tr>\n<td>pc<\/td>\n<td>Primary Camera mega pixels<\/td>\n<\/tr>\n<tr>\n<td>px_height<\/td>\n<td>Pixel Resolution Height<\/td>\n<\/tr>\n<tr>\n<td>px_width<\/td>\n<td>Pixel Resolution Width<\/td>\n<\/tr>\n<tr>\n<td>ram<\/td>\n<td>Random Access Memory in MegaBytes<\/td>\n<\/tr>\n<tr>\n<td>sc_h<\/td>\n<td>Screen Height of mobile in cm<\/td>\n<\/tr>\n<tr>\n<td>sc_w<\/td>\n<td>Screen Width of mobile in cm<\/td>\n<\/tr>\n<tr>\n<td>talk_time<\/td>\n<td>longest time that a single battery charge will last when you are<\/td>\n<\/tr>\n<tr>\n<td>three_g<\/td>\n<td>Has 3G or not<\/td>\n<\/tr>\n<tr>\n<td>touch_screen<\/td>\n<td>Has touch screen or not<\/td>\n<\/tr>\n<tr>\n<td>wifi<\/td>\n<td>Has wifi or not<\/td>\n<\/tr>\n<tr>\n<td>price_range<\/td>\n<td>This is the target variable with values of 0(low cost), 1(medium cost), 2(high cost), and 3(very high cost).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Step 2: Importing Libraries<\/h3>\n<p>We first import relevant libraries i.e pandas for loading the dataset, matplotlib for visualisations and tensorflow for the deep learning model.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import tensorflow as tf\nimport numpy as np\nimport pandas as pd\nfrom tensorflow import keras\nfrom tensorflow.keras import layers<\/code><\/pre>\n<\/div>\n<h3>Step 3: Data Loading and Processing<\/h3>\n<h4>Loading Data<\/h4>\n<p>First we load the data. For this we use the read_csv functionality in pandas. Note that the dataset has the test and train already sperated into two files.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">dataframe = pd.read_csv('train.csv')<\/code><\/pre>\n<\/div>\n<p>Alternatively, we can use GridDB to get this dataframe.<\/p>\n<h4>Feature Encoding<\/h4>\n<p>We first encode the data sets into categorical and numeric format. For numeric we will normalize the data and for categorical we will convert the data type. We also create a set of features and remove the target from the set of features.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">numeric_feats = [\"mobile_wt\", \"m_dep\", \"int_memory\", \"fc\", \"clock_speed\", \"talk_time\",\"n_cores\", \"sc_w\", \"sc_h\", \"ram\", \"px_width\",\"px_height\",\"pc\", \"battery_power\"]\n\ndataframe[numeric_feats] = dataframe[numeric_feats].apply(lambda x: (x - np.mean(x)) \/ (np.max(x) - np.min(x)))\n\ncategorical_feats = [\"blue\", \"four_g\", \"dual_sim\", \"wifi\", \"touch_screen\", \"three_g\",\"price_range\"]\ndataframe[categorical_feats] =  dataframe[categorical_feats].astype(\"category\")\n\nfeatures = numeric_feats + categorical_feats \nfeatures.remove(\"price_range\")<\/code><\/pre>\n<\/div>\n<p>We can now describe the dataset and check the distribution.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">dataframe[numeric_feats].describe()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/num.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/num.png\" alt=\"\" width=\"617\" height=\"256\" class=\"aligncenter size-full wp-image-27767\" srcset=\"\/wp-content\/uploads\/2021\/09\/num.png 617w, \/wp-content\/uploads\/2021\/09\/num-300x124.png 300w, \/wp-content\/uploads\/2021\/09\/num-600x249.png 600w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/a><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">dataframe[categorical_feats].describe()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/cat.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/cat.png\" alt=\"\" width=\"617\" height=\"140\" class=\"aligncenter size-full wp-image-27769\" srcset=\"\/wp-content\/uploads\/2021\/09\/cat.png 617w, \/wp-content\/uploads\/2021\/09\/cat-300x68.png 300w, \/wp-content\/uploads\/2021\/09\/cat-600x136.png 600w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/a><\/p>\n<h4>Splitting Data into Validation and Train<\/h4>\n<p>We then create a small validation set to test data on while training to make sure we do not overfit on the data. We take 20% of the data as validation set.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">val_dataframe = dataframe.sample(frac=0.2, random_state=1337)\ntrain_dataframe = dataframe.drop(val_dataframe.index)\n\nprint(\"Number of training samples:\", len(train_dataframe))\nprint(\"Number of validation samples:\", len(val_dataframe))\n<\/code><\/pre>\n<\/div>\n<h4>Preparing data for Keras<\/h4>\n<p>Since this is a multiclass classification problem. We have to convert the target to one-hot encoding. We do that with <code>tf.keras.utils.to_categorical<\/code>. As keras takes in numpy arrays, we convert the pandas dataframe to numpy.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">Y_train = tf.keras.utils.to_categorical(train_dataframe[\"price_range\"], num_classes=4)\nY_val = tf.keras.utils.to_categorical(val_dataframe[\"price_range\"], num_classes=4)\n\nX_train = train_dataframe[features].values\nX_val = val_dataframe[features].values<\/code><\/pre>\n<\/div>\n<h3>Step 4: Prediction<\/h3>\n<p>Next we start the prediction process.<\/p>\n<h4>Initializing<\/h4>\n<p>We will create a simple model for our prediction. We will add 12 dense layers. Note that we will make the input dimensions 20. Then we add a dropout module that helps with overfitting. Finally w e add a few more hidden layers and then end it with a softmax. The softmax gives us four probability scores for the four classes. We can play around with the model configurations, adding or deleting layers.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\"># define the keras model\nmodel =  keras.Sequential()\nmodel.add(layers.Dense(12, input_dim=20, activation='relu'))\nmodel.add(layers.Dropout(0.5))\nmodel.add(layers.Dense(8, activation='relu'))\nmodel.add(layers.Dense(4, activation='softmax'))<\/code><\/pre>\n<\/div>\n<h4>Training<\/h4>\n<p>Next we compile the model. We use the categorical cross entropy as the loss and evaluate it on accuracy. Ideally we can use AUC or any other metric we seem fit.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])<\/code><\/pre>\n<\/div>\n<p>Next we train the model for 200 epochs.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">num_epochs = 200 \nhistory = model.fit(X_train,\n                   Y_train,\n                   epochs=num_epochs ,\n                   validation_data=(X_val, Y_val))<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">Epoch 1\/200\n50\/50 [==============================] - 0s 2ms\/step - loss: 0.1648 - accuracy: 0.9431 - val_loss: 0.2359 - val_accuracy: 0.9125\nEpoch 2\/200\n50\/50 [==============================] - 0s 2ms\/step - loss: 0.1871 - accuracy: 0.9388 - val_loss: 0.1986 - val_accuracy: 0.9175\nEpoch 3\/200\n....\nEpoch 199\/200\n50\/50 [==============================] - 0s 1ms\/step - loss: 0.1245 - accuracy: 0.9575 - val_loss: 0.4880 - val_accuracy: 0.8075\nEpoch 200\/200\n50\/50 [==============================] - 0s 1ms\/step - loss: 0.1267 - accuracy: 0.9600 - val_loss: 0.4585 - val_accuracy: 0.8150<\/code><\/pre>\n<\/div>\n<h4>Evaluation<\/h4>\n<p>Next we plot the loss and the accuracy for the train and validation. Ideally the loss should go down and the accuracy would go up.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">history = history.history<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\n%matplotlib inline\nepochs = list(range(num_epochs))\nloss = history[\"loss\"]\nval_loss = history[\"val_loss\"]\nplt.plot(epochs, loss, 'bo', label=\"Training Loss\")\nplt.plot(epochs, val_loss, 'b', label=\"Validation Loss\")\n\nplt.title('Training and Validation Loss')\nplt.xlabel('Epochs')\nplt.ylabel('Loss Value')\nplt.legend()\nplt.show()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/loss.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/loss.png\" alt=\"\" width=\"392\" height=\"278\" class=\"aligncenter size-full wp-image-27756\" srcset=\"\/wp-content\/uploads\/2021\/09\/loss.png 392w, \/wp-content\/uploads\/2021\/09\/loss-300x213.png 300w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/a><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">epochs = list(range(num_epochs))\naccuracy = history[\"accuracy\"]\nval_accuracy = history[\"val_accuracy\"]\nplt.plot(epochs, accuracy, 'bo', label=\"Accuracy\")\nplt.plot(epochs, val_accuracy, 'b', label=\"Val Accuracy\")\n\nplt.title('Training and Validation Accuracy')\nplt.xlabel('Epochs')\nplt.ylabel('Loss Value')\nplt.legend()\nplt.show()<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/accuracy.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/accuracy.png\" alt=\"\" width=\"398\" height=\"278\" class=\"aligncenter size-full wp-image-27768\" srcset=\"\/wp-content\/uploads\/2021\/09\/accuracy.png 398w, \/wp-content\/uploads\/2021\/09\/accuracy-300x210.png 300w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/a><\/p>\n<p>Note that the val accuracy is going down but the tain accuracy is constant this may imply that the model is overfitting. In that case we can either try several strategies: reduce epochs, use a different loss function, argument the data and so on.<\/p>\n<h4>Predictions<\/h4>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\"># evaluate the keras model\ntest = pd.read_csv('test.csv')\ntest[numeric_feats] = test[numeric_feats].apply(lambda x: (x - np.mean(x)) \/ (np.max(x) - np.min(x)))\n\nif \"price_range\" in categorical_feats:\n  categorical_feats.remove(\"price_range\")\n\ntest[categorical_feats] =  test[categorical_feats].astype(\"category\")\nfeats = test[features].values\npredictions = model.predict(feats)\npredictions = np.argmax(predictions, axis=1)<\/code><\/pre>\n<\/div>\n<p>Finally we load the testing data and predict. Note that keras will return probabilities for each class, so we take the argmax to get the class.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this article we learnt how to train a simple neural network for a classification task.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex relationships in data and have been shown to work for a variety of applications from finance to robotics. Inspired by the human brain, Neural Networks work on the principle of [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":27797,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46665","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>Neural Networks with Python and GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex\" \/>\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\/neural-networks-with-python-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Neural Networks with Python and GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/neural-networks-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-24T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:55:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg\" \/>\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=\"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=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Neural Networks with Python and GridDB\",\"datePublished\":\"2021-09-24T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/\"},\"wordCount\":978,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/\",\"name\":\"Neural Networks with Python and GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg\",\"datePublished\":\"2021-09-24T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:35+00:00\",\"description\":\"Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg\",\"width\":1920,\"height\":1280},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/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:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/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:\/\/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:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/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:\/\/griddb.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Neural Networks with Python and GridDB | GridDB: Open Source Time Series Database for IoT","description":"Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex","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\/neural-networks-with-python-and-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Neural Networks with Python and GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex","og_url":"https:\/\/griddb.net\/en\/blog\/neural-networks-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-24T07:00:00+00:00","article_modified_time":"2025-11-13T20:55:35+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg","type":"image\/jpeg"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Neural Networks with Python and GridDB","datePublished":"2021-09-24T07:00:00+00:00","dateModified":"2025-11-13T20:55:35+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/"},"wordCount":978,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/","url":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/","name":"Neural Networks with Python and GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg","datePublished":"2021-09-24T07:00:00+00:00","dateModified":"2025-11-13T20:55:35+00:00","description":"Neural Networks have taken the world of machine learning and predictive modelling in the last 5 years. Neural network have the ability to learn complex","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/neural-networks-with-python-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg","contentUrl":"\/wp-content\/uploads\/2021\/09\/board-game_1920x1280.jpeg","width":1920,"height":1280},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/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:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/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:\/\/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:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/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:\/\/griddb.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46665"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46665\/revisions"}],"predecessor-version":[{"id":51340,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46665\/revisions\/51340"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media\/27797"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}