{"id":52024,"date":"2022-06-24T00:00:00","date_gmt":"2022-06-24T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/"},"modified":"2022-06-24T00:00:00","modified_gmt":"2022-06-24T07:00:00","slug":"stroke-prediction-using-machine-learning-python-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/","title":{"rendered":"Stroke Prediction using Machine Learning, Python, and GridDB"},"content":{"rendered":"<p>Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption, the brain is not able to receive oxygen and nutrients for its correct functioning. The other way around, the brain is not able to drain and expulse through blood vessels all of its waste, like dead cells. In a question of minutes, the brain is in a critical condition as brain cells will imminently begin to die.<\/p>\n<p>The<a href=\"https:\/\/www.stroke.org\/en\/\"> American Stroke Association<\/a> indicates that stroke is the fifth cause of death and disability in the United States. For this reason, stroke is considered a severe disease and has been the subject of extensive research, not only in the medical field but also in data science and machine learning studies. In this article, we propose a machine learning model to predict stroke diseases given patient records using Python and GridDB.<\/p>\n<h2><strong>Setting up your environment<\/strong><\/h2>\n<p>To accomplish the solution presented in this article, we begin by setting up the correct environment in your machine to correctly execute the presented code. Here are some of the requirements that need to be configured in your environment:<\/p>\n<ul>\n<li>\n<p><strong>Windows 10<\/strong>. We are using Windows 10 as our main operating system.<\/p>\n<\/li>\n<li>\n<p><strong>GridDB.<\/strong> We use GridDB as our main database that stores the data used in the machine learning model.<\/p>\n<\/li>\n<li>\n<p><strong>Python 3.9.<\/strong> We use Python thanks Anaconda Navigator that allow deploying isolated working environments<\/p>\n<\/li>\n<li>\n<p><strong>Jupyter Notebook<\/strong> is used as our main computing platform to execute Python cells.<\/p>\n<\/li>\n<li>\n<p><strong>Microsoft Visual C++ 14.0<\/strong> or greater. This is needed for JPype1 used by GridDB to execute commands on Jupyter Notebook.<\/p>\n<\/li>\n<li>\n<p>Finally, we need to install any missing libraries that will be used in <strong>Jupyter Notebook<\/strong>. In our case, we were missing <code>JPype1<\/code>, <code>scikit-plot<\/code>, <code>imblearn<\/code>. Here is how we install missing libraries, thanks to <code>pip<\/code> command, in the Jupyter terminal:<\/p>\n<\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">  pip install imblearn   \n  pip install scikit-plot   \n  pip install JayDeBeApi JPype1==0.6.3  \n  pip install pywaffle\n  <\/code><\/pre>\n<\/div>\n<p>Once we have successfully installed and configured our environment, we can step right into our dataset.<\/p>\n<h2><strong>Introduction to the dataset<\/strong><\/h2>\n<p>The dataset used in this article contains 5110 records of patients. Each patient has 12 columns each referring to a concrete attribute. Most of these attributes correspond to medical records or the results of clinical trials. Some of the key attributes are hypertension, heart diseases, average glucose levels in the blood, and body mass index (BMI). As we can observe from these first attributes, the dataset provides relevant data regarding the likelihood of patients suffering from stroke disease. It\u2019s is easy to understand that a patient with high glucose levels and BMI, who has suffered from heart diseases and\/or hypertension, is more likely to suffer from stroke. In fact, stroke is also an attribute in the dataset and indicates in each medical record if the patient suffered from a stroke disease or not.<\/p>\n<p>The dataset is obtained from <a href=\"https:\/\/www.kaggle.com\/code\/joshuaswords\/predicting-a-stroke-shap-lime-explainer-eli5\/data\">Kaggle <\/a>and is available for download. The following table provides an extract of the dataset used in this article.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/almahdibakkali96\/Stroke-Prediction-using-Machine-Learning-Python-and-GridDB-\/blob\/main\/stroke.PNG?raw=true\" alt=\"\" \/><\/p>\n<h2><strong>Importing the necessary libraries<\/strong><\/h2>\n<p>In this article we will be using multiple python libraries, that we will organize according to their usage:<\/p>\n<ul>\n<li>Libraries for linear algebra and data processing: <\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">  import numpy as np \n  import pandas as pd\n  <\/code><\/pre>\n<\/div>\n<ul>\n<li>Libraries for plotting graphs<\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">  import matplotlib.pyplot as plt\n  import matplotlib.ticker as mtick\n  import matplotlib.gridspec as grid_spec\n  import seaborn as sns\n  from imblearn.over_sampling import SMOTE\n  import scikitplot as skplt\n  <\/code><\/pre>\n<\/div>\n<ul>\n<li>Libraries for building the model<\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">  from sklearn.pipeline import Pipeline\n  from sklearn.preprocessing import StandardScaler,LabelEncoder\n  from sklearn.model_selection import train_test_split,cross_val_score\n  \n  from sklearn.metrics import classification_report, confusion_matrix\n  from sklearn.metrics import accuracy_score, recall_score, roc_auc_score, precision_score, f1_score\n  <\/code><\/pre>\n<\/div>\n<ul>\n<li>Libraries for evaluating the model using different algorithms<\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">from sklearn.linear_model import LinearRegression,LogisticRegression\n  from sklearn.tree import DecisionTreeRegressor,DecisionTreeClassifier\n  from sklearn.ensemble import RandomForestClassifier\n  <\/code><\/pre>\n<\/div>\n<ul>\n<li>Library for reading data from GridDB in Jupyter Notebook<\/li>\n<\/ul>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import jaydebeapi\n <\/code><\/pre>\n<\/div>\n<p>After we have successfully imported the required libraries, we begin by loading our dataset.<\/p>\n<h2><strong>Loading the Dataset<\/strong><\/h2>\n<p>In order to load the dataset we have two options that are described in more detail in the next paragraphs:<\/p>\n<p>For the purpose of this article, we have already designed and loaded our data into a GridDB container. The article about using <a href=\"https:\/\/griddb.net\/en\/blog\/using-pandas-dataframes-with-griddb\/\">Pandas with GridDB<\/a> can be useful if you want to write your data.<\/p>\n<p>However, in this article, we do not read data from GridDB using Pandas, but we achieve this operation directly from the Jupyter Notebook, using the GridDB JDBC connector. The article on using <a href=\"https:\/\/docs.griddb.net\/tutorial\/jupyter\/\">GridDB in Jupyter<\/a> can be very useful if more details are needed on this step. Here is the code to achieve this:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">   def query_sensor(curs, table):\n       curs.execute(\"select count(*) from \"+table)\n       return curs.fetchall()[0][0]\n   \n   conn = jaydebeapi.connect(\"com.toshiba.mwcloud.gs.sql.Driver\", \"jdbc:gs:\/\/239.0.0.1:41999\/defaultCluster\", [\"admin\", \"admin\"], \"gridstore-jdbc-4.6.0.jar\")\n   curs = conn.cursor()\n   curs.execute(\"select * from \"#tables\"\")\n   tables = []\n   data = []\n   \n   for table in curs.fetchall():\n       try:\n           if table[1].split(\"_\")[1].startswith(\"M\"):\n               tables.append(table[1])\n               data.append(query_sensor(curs, table[1]))\n       except:\n           pass\n   <\/code><\/pre>\n<\/div>\n<p>You can also load the dataset using the CSV file downloaded from Kaggle. Make sure to place the file in the root directory of your Jupyter project, and it should be ready to be used:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">   df = pd.read_csv('healthcare-dataset-stroke-data.csv')\n   <\/code><\/pre>\n<\/div>\n<p>For the purposes of this article, we will proceed with the data provided in the <code>df<\/code> variable.<\/p>\n<h2><strong>Exploratory Data Analysis<\/strong><\/h2>\n<p>Before we proceed to build our machine learning model, we must begin with an exploratory data analysis that will allow us to find any inconsistencies in our data, as well as overall visualization of the dataset.<\/p>\n<p>First, we begin by checking for any null values in our dataset. This is achieved with the following lines of code:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">df.isnull().sum()<\/code><\/pre>\n<\/div>\n<p>This cell outputs the following results, indicating that we have 201 missing values for the BMI attribute:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">id                     0\ngender                 0\nage                    0\nhypertension           0\nheart_disease          0\never_married           0\nwork_type              0\nResidence_type         0\navg_glucose_level      0\nbmi                  201\nsmoking_status         0\nstroke                 0\ndtype: int64<\/code><\/pre>\n<\/div>\n<p>In this case, we can simply opt for removing the missing values, but we will use a decision tree in order to predict the BMI values for the missing entries, a method described in a <a href=\"https:\/\/www.kaggle.com\/thomaskonstantin\/analyzing-and-modeling-stroke-data\">Kaggle notebook<\/a>. This is achieved with the following code:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">DT_bmi_pipe = Pipeline( steps=[ \n                               ('scale',StandardScaler()),\n                               ('lr',DecisionTreeRegressor(random_state=42))\n                              ])\nX = df[['age','gender','bmi']].copy()\nX.gender = X.gender.replace({'Male':0,'Female':1,'Other':-1}).astype(np.uint8)\n\nMissing = X[X.bmi.isna()]\nX = X[~X.bmi.isna()]\nY = X.pop('bmi')\nDT_bmi_pipe.fit(X,Y)\npredicted_bmi = pd.Series(DT_bmi_pipe.predict(Missing[['age','gender']]),index=Missing.index)\ndf.loc[Missing.index,'bmi'] = predicted_bmi<\/code><\/pre>\n<\/div>\n<p>Now we have replaced all missing values, we can move to visualize our data. The first graph provides a numeric variable distribution of three key attributes that are age, average glucose levels, and BMI. This plot gives us a clear initial visualization of our data, being able to detect frequent age ranges, glucose levels, and BMIs. The code used to generate this plot is attached to the notebook in the <a href=\"https:\/\/github.com\/almahdibakkali96\/Stroke-Prediction-using-Machine-Learning-Python-and-GridDB-\">public repository<\/a> for this article.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/almahdibakkali96\/Stroke-Prediction-using-Machine-Learning-Python-and-GridDB-\/blob\/main\/stroke1.png?raw=true\" alt=\"\" \/><\/p>\n<p>The previous plot takes more importance when applied to our current study. The following plot makes a relation with the previous numeric attributes with the patient condition of suffering a stroke or not. This plot gives us great insights, and the code is also available in the <a href=\"https:\/\/github.com\/almahdibakkali96\/Stroke-Prediction-using-Machine-Learning-Python-and-GridDB-\">GitHub repository<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/github.com\/almahdibakkali96\/Stroke-Prediction-using-Machine-Learning-Python-and-GridDB-\/blob\/main\/stroke2.png?raw=true\" alt=\"\" \/><\/p>\n<p>As we can observe, age seems to play a decisive factor in increasing the risk of a patient suffering from a stroke attack. We can observe that the older a patient, the increased the likelihood of suffering from stroke.<\/p>\n<h2><strong>Machine Learning Model<\/strong><\/h2>\n<p>In this section, we design and prepare our machine learning model. For this purpose, we begin by encoding the categorical variables present in our dataset. These include gender, residence type, and work type. We achieve this operation with the following code:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">df['gender'] = df['gender'].replace({'Male':0,'Female':1,'Other':-1}).astype(np.uint8)\ndf['Residence_type'] = df['Residence_type'].replace({'Rural':0,'Urban':1}).astype(np.uint8)\ndf['work_type'] = df['work_type'].replace({'Private':0,'Self-employed':1,'Govt_job':2,'children':-1,'Never_worked':-2}).astype(np.uint8)<\/code><\/pre>\n<\/div>\n<p>Now we have prepared our dataset, we will proceed to split our data into a training and testing data. Also, we need to make sure that the <code>stoke<\/code> attribute is not present in the dataset so we can correctly make the predictions. This is achieved thanks to the following code:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">X = df[['gender','age','hypertension','heart_disease','work_type','avg_glucose_level','bmi']]y = df['stroke']\nfrom sklearn.model_selection import train_test_split\nX_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.3, random_state=42)<\/code><\/pre>\n<\/div>\n<p>The dataset presented in this article is imbalanced. We have detected that the dataset is biased, so we have opted for SMOTE (Synthetic Minority Over-sampling Technique) to solve this issue. The following lines of code apply SMOTE over-sampling to our dataset, and result in a balanced dataset:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">oversample = SMOTE()\nX_train_resh, y_train_resh = oversample.fit_resample(X_train, y_train.ravel())<\/code><\/pre>\n<\/div>\n<h2>Model Evaluation<\/h2>\n<p>At this moment, we are ready to evaluate our model. In this example, we will use a random forest algorithm in order to evaluate the model that was designed in previous sections. In fact, we can use other classification models, like logistic regression, but we have noticed that the random forest obtains the highest accuracy. First, we begin by scaling our data in the pipeline and split it, thanks to the following lines of code:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">rf_pipeline = Pipeline(steps = [('scale',StandardScaler()),('RF',RandomForestClassifier(random_state=42))])<\/code><\/pre>\n<\/div>\n<p>To execute the algorithm, we use 10 fold cross validation:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print('Random Forest mean :',cross_val_score(rf_pipeline,X_train_resh,y_train_resh,cv=10,scoring='f1').mean())<\/code><\/pre>\n<\/div>\n<p>The previous line of code outputs the following result:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">Random Forest mean: 0.9342717632419655<\/code><\/pre>\n<\/div>\n<p>As we can see, the random forest model was able to reach an accuracy of 93% in predicting patient records of suffering or not from stroke disease.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>The combination of medical studies with machine learning and data science research can provide unprecedented insights for different diseases. In this article, we have explored the use of a machine learning model to predict the likelihood of medical patients suffering from stroke disease, a severe illness that affects the correct functioning of the human brain.<\/p>\n<h2>Reference<\/h2>\n<ol>\n<li>https:\/\/www.stroke.org\/en\/<\/li>\n<li>https:\/\/github.com\/almahdibakkali96\/Stroke-Prediction-using-Machine-Learning-Python-and-GridDB-<\/li>\n<li>https:\/\/www.kaggle.com\/code\/joshuaswords\/predicting-a-stroke-shap-lime-explainer-eli5<\/li>\n<li>https:\/\/www.kaggle.com\/code\/thomaskonstantin\/analyzing-and-modeling-stroke-data\/notebook<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption, the brain is not able to receive oxygen and nutrients for its correct functioning. The other way around, the brain is not able to drain and expulse through blood vessels [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":52025,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-52024","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>Stroke Prediction using Machine Learning, Python, and GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption,\" \/>\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\/stroke-prediction-using-machine-learning-python-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stroke Prediction using Machine Learning, Python, and GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-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=\"2022-06-24T07:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1260\" \/>\n\t<meta property=\"og:image:height\" content=\"834\" \/>\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=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Stroke Prediction using Machine Learning, Python, and GridDB\",\"datePublished\":\"2022-06-24T07:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/\"},\"wordCount\":1347,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/\",\"name\":\"Stroke Prediction using Machine Learning, Python, and GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg\",\"datePublished\":\"2022-06-24T07:00:00+00:00\",\"description\":\"Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption,\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg\",\"contentUrl\":\"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg\",\"width\":1260,\"height\":834},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.griddb.net\/en\/#website\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stroke Prediction using Machine Learning, Python, and GridDB | GridDB: Open Source Time Series Database for IoT","description":"Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption,","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\/stroke-prediction-using-machine-learning-python-and-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Stroke Prediction using Machine Learning, Python, and GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption,","og_url":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2022-06-24T07:00:00+00:00","og_image":[{"width":1260,"height":834,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.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":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Stroke Prediction using Machine Learning, Python, and GridDB","datePublished":"2022-06-24T07:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/"},"wordCount":1347,"commentCount":0,"publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/","url":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/","name":"Stroke Prediction using Machine Learning, Python, and GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/www.griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg","datePublished":"2022-06-24T07:00:00+00:00","description":"Stroke is a severe cerebrovascular disease caused by an interruption of blood flow from and to the brain. As a direct consequence of this interruption,","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/stroke-prediction-using-machine-learning-python-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg","contentUrl":"\/wp-content\/uploads\/2025\/12\/ambulance_preview_2ca4.jpeg","width":1260,"height":834},{"@type":"WebSite","@id":"https:\/\/www.griddb.net\/en\/#website","url":"https:\/\/www.griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/www.griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/52024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/comments?post=52024"}],"version-history":[{"count":0,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/52024\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media\/52025"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media?parent=52024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/categories?post=52024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/tags?post=52024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}