{"id":50779,"date":"2022-01-27T00:00:00","date_gmt":"2022-01-27T08:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/"},"modified":"2025-11-14T07:55:07","modified_gmt":"2025-11-14T15:55:07","slug":"heart-failure-prediction-using-machine-learning-python-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/","title":{"rendered":"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c"},"content":{"rendered":"<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u3044\u304f\u3064\u304b\u306e\u63a2\u7d22\u7684\u30c7\u30fc\u30bf\u89e3\u6790\u3092\u884c\u3044\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001\u5c06\u6765\u306e\u4e88\u6e2c\u3092\u884c\u3046\u305f\u3081\u306e\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u30a2\u30a6\u30c8\u30e9\u30a4\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/li>\n<li>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u7d39\u4ecb<\/li>\n<li>\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/li>\n<li>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u8aad\u307f\u8fbc\u307f<\/li>\n<li>\u63a2\u7d22\u7684\u30c7\u30fc\u30bf\u89e3\u6790<\/li>\n<li>\u30ab\u30c6\u30b4\u30ea\u5909\u6570\u306e\u53d6\u308a\u6271\u3044<\/li>\n<li>\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb<\/li>\n<li>\u30e2\u30c7\u30eb\u8a55\u4fa1<\/li>\n<li>\u7d50\u8ad6<\/li>\n<li>\u53c2\u8003\u6587\u732e<\/li>\n<\/ol>\n<p>Jupyter\u30d5\u30a1\u30a4\u30eb\u306f\u3053\u3061\u3089\u304b\u3089\u3054\u89a7\u3044\u305f\u3060\u3051\u307e\u3059\uff1a https:\/\/github.com\/griddbnet\/Blogs\/blob\/main\/Heart%20Failure%20Prediction.ipynb<\/p>\n<h2>1&#46; \u74b0\u5883\u8a2d\u5b9a<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u3001Jupyter Notebooks (Anaconda version 4.8.3) \u3068 Python version 3.8 on Windows 10 Operating system \u3067\u5b9f\u65bd\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u30b3\u30fc\u30c9\u5b9f\u884c\u306e\u524d\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li><a href=\"https:\/\/pandas.pydata.org\/docs\/getting_started\/install.html\">Pandas<\/a><\/li>\n<li><a href=\"https:\/\/numpy.org\/install\/\">NumPy<\/a><\/li>\n<li><a href=\"https:\/\/seaborn.pydata.org\/installing.html\">Seaborn<\/a><\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/plotly\/\">Plotly<\/a><\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/scikit-learn\/\">scikit-learn<\/a><\/li>\n<li><a href=\"https:\/\/pypi.org\/project\/matplotlib\/\">Matplotlib<\/a><\/li>\n<\/ol>\n<p>\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u958b\u59cb\u3055\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u5358\u306b <code>pip install package-name<\/code> \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002Anaconda\u306e\u5834\u5408\u306f\u3001<code>conda install package-name<\/code>\u3068\u5165\u529b\u3057\u3066\u3082\u3046\u307e\u304f\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30ed\u30fc\u30c9\u3059\u308b\u969b\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306fGridDB\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3068Pandas\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306e2\u3064\u3092\u53d6\u308a\u4e0a\u3052\u307e\u3059\u3002Python\u3092\u4f7f\u7528\u3057\u3066GridDB\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3082\u4e8b\u524d\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li><a href=\"https:\/\/github.com\/griddb\/c_client\">GridDB C-\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<\/a><\/li>\n<li>SWIG (Simplified Wrapper and Interface Generator) <\/li>\n<li><a href=\"https:\/\/github.com\/griddb\/python_client\">GridDB Python\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<\/a><\/li>\n<\/ol>\n<h2>2&#46; \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u7d39\u4ecb<\/h2>\n<p>\u5faa\u74b0\u5668\u75be\u60a3\u306f\u3001\u4e16\u754c\u7684\u306a\u6b7b\u56e0\u306e1\u3064\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u6a5f\u68b0\u5b66\u7fd2\u3067\u5fc3\u4e0d\u5168\u4e88\u77e5\u304c\u3067\u304d\u308c\u3070\u3001\u305d\u306e\u8ca2\u732e\u5ea6\u306f\u5927\u304d\u3044\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u3001BMC Medical Informatics and Decision Making\u306eDavide Chicco, Giuseppe Jurman\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u3082\u306e\u3067\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u5316\u3055\u308c\u3066\u304a\u308a\u3001<a href=\"https:\/\/www.kaggle.com\/fedesoriano\/heart-failure-prediction\">Kaggle<\/a>\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306f12\u306e\u5c5e\u6027\uff08\u307e\u305f\u306f\u5217\uff09\u3092\u6301\u3064\u5408\u8a08918\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff08\u307e\u305f\u306f\u884c\uff09\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e12\u5c5e\u6027\u306e\u3046\u3061\u30015\u3064\u306f\u30ab\u30c6\u30b4\u30ea\u30fc\u3067\u30017\u3064\u306f\u6570\u5024\u306e\u6027\u8cea\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u3067\u306f\u3001\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>3&#46; \u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/h2>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nimport plotly.graph_objects as go\nimport plotly.exprs as px\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import classification_report\nfrom sklearn.metrics import plot_confusion_matrix<\/code><\/pre>\n<\/div>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u6210\u529f\u3057\u305f\u5834\u5408\u3001\u4e0a\u8a18\u306e\u30bb\u30eb\u306f\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3084\u8b66\u544a\u3092\u51fa\u3055\u305a\u306b\u6b63\u5e38\u306b\u5b9f\u884c\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u3082\u3057\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306f&#8230;<\/p>\n<ol>\n<li>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f\u304b\u3069\u3046\u304b\u518d\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u6210\u529f\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001<code>pip install package-name<\/code> \u3092\u518d\u5ea6\u5b9f\u884c\u3057\u307e\u3059\u3002<\/li>\n<li>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u3042\u306a\u305f\u306e anaconda\/system \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u4e92\u63db\u6027\u304c\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<h2>4&#46; \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u30ed\u30fc\u30c9<\/h2>\n<h3>4&#46;1 GridDB\u306e\u5229\u7528<\/h3>\n<p>GridDB\u306f\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u30a4\u30f3\u30e1\u30e2\u30ea\u306aNo SQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002GridDB\u306epython-client\u3092\u4f7f\u3063\u3066\u3001pandas\u306edataframe\u3068\u3057\u3066python\u74b0\u5883\u306b\u76f4\u63a5\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002GridDB\u3092\u521d\u3081\u3066\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001<a href=\"https:\/\/griddb.net\/ja\/blog\/using-pandas-dataframes-with-griddb\/\">GridDB\u3078\u306e\u8aad\u307f\u66f8\u304d<\/a>\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u304c\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u524d\u63d0\u306b\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306eSQL\u30af\u30a8\u30ea\u3092python\u3067\u8a18\u8ff0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">import griddb_python as griddb\n\nsql_statement = ('SELECT * FROM heart_failure_prediction')\nheart_dataset = pd.read_sql_query(sql_statement, cont)<\/code><\/pre>\n<\/div>\n<p>\u5909\u6570 <code>cont<\/code> \u306b\u306f\u3001\u30c7\u30fc\u30bf\u304c\u683c\u7d0d\u3055\u308c\u308b\u30b3\u30f3\u30c6\u30ca\u60c5\u5831\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>4&#46;2 Pandas\u306e\u4f7f\u7528<\/h3>\n<p>\u307e\u305f\u3001pandas \u306e <code>read_csv()<\/code> \u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u3069\u3061\u3089\u306e\u65b9\u6cd5\u3082\u3001pandas \u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u3001\u540c\u3058\u51fa\u529b\u306b\u306a\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">heart_dataset = pd.read_csv('heart.csv')<\/code><\/pre>\n<\/div>\n<h2>5&#46; \u63a2\u7d22\u7684\u30c7\u30fc\u30bf\u89e3\u6790<\/h2>\n<p>\u307e\u305a\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u5f62\u72b6\u3001\u3059\u306a\u308f\u3061\u884c\u6570\u3068\u5217\u6570\u3092\u6c7a\u5b9a\u3057\u3088\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">heart_dataset.shape<\/code><\/pre>\n<\/div>\n<pre><code>(918, 12)\n<\/code><\/pre>\n<p>\u3053\u3053\u3067\u3001\u30c7\u30fc\u30bf\u304c\u3069\u306e\u3088\u3046\u306b\u898b\u3048\u308b\u304b\u306e\u6982\u8981\u3092\u77e5\u308b\u305f\u3081\u306b\u3001pandas\u306e <code>head<\/code> \u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u306e\u6700\u521d\u306e5\u884c\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">heart_dataset.head()<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }<\/p>\n<p>    .dataframe tbody tr th {\n        vertical-align: top;\n    }<\/p>\n<p>    .dataframe thead th {\n        text-align: right;\n    }\n  <\/style>\n<table border=\"1\" class=\"dataframe\">\n<thead>\n<tr style=\"text-align: right;\">\n<th>\n        <\/th>\n<th>\n          Age\n        <\/th>\n<th>\n          Sex\n        <\/th>\n<th>\n          ChestPainType\n        <\/th>\n<th>\n          RestingBP\n        <\/th>\n<th>\n          Cholesterol\n        <\/th>\n<th>\n          FastingBS\n        <\/th>\n<th>\n          RestingECG\n        <\/th>\n<th>\n          MaxHR\n        <\/th>\n<th>\n          ExerciseAngina\n        <\/th>\n<th>\n          Oldpeak\n        <\/th>\n<th>\n          ST_Slope\n        <\/th>\n<th>\n          HeartDisease\n        <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>\n          0\n        <\/th>\n<td>\n          40\n        <\/td>\n<td>\n          M\n        <\/td>\n<td>\n          ATA\n        <\/td>\n<td>\n          140\n        <\/td>\n<td>\n          289\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          172\n        <\/td>\n<td>\n          N\n        <\/td>\n<td>\n          0.0\n        <\/td>\n<td>\n          Up\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          1\n        <\/th>\n<td>\n          49\n        <\/td>\n<td>\n          F\n        <\/td>\n<td>\n          NAP\n        <\/td>\n<td>\n          160\n        <\/td>\n<td>\n          180\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          156\n        <\/td>\n<td>\n          N\n        <\/td>\n<td>\n          1.0\n        <\/td>\n<td>\n          Flat\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          2\n        <\/th>\n<td>\n          37\n        <\/td>\n<td>\n          M\n        <\/td>\n<td>\n          ATA\n        <\/td>\n<td>\n          130\n        <\/td>\n<td>\n          283\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          ST\n        <\/td>\n<td>\n          98\n        <\/td>\n<td>\n          N\n        <\/td>\n<td>\n          0.0\n        <\/td>\n<td>\n          Up\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          3\n        <\/th>\n<td>\n          48\n        <\/td>\n<td>\n          F\n        <\/td>\n<td>\n          ASY\n        <\/td>\n<td>\n          138\n        <\/td>\n<td>\n          214\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          108\n        <\/td>\n<td>\n          Y\n        <\/td>\n<td>\n          1.5\n        <\/td>\n<td>\n          Flat\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          4\n        <\/th>\n<td>\n          54\n        <\/td>\n<td>\n          M\n        <\/td>\n<td>\n          NAP\n        <\/td>\n<td>\n          150\n        <\/td>\n<td>\n          195\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          122\n        <\/td>\n<td>\n          N\n        <\/td>\n<td>\n          0.0\n        <\/td>\n<td>\n          Up\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/01\/chest_pain_type.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/01\/chest_pain_type.png\" alt=\"\" width=\"983\" height=\"525\" class=\"aligncenter size-full wp-image-28027\" srcset=\"\/wp-content\/uploads\/2022\/01\/chest_pain_type.png 983w, \/wp-content\/uploads\/2022\/01\/chest_pain_type-300x160.png 300w, \/wp-content\/uploads\/2022\/01\/chest_pain_type-768x410.png 768w, \/wp-content\/uploads\/2022\/01\/chest_pain_type-600x320.png 600w\" sizes=\"(max-width: 983px) 100vw, 983px\" \/><\/a><\/p>\n<p>\u53ef\u8996\u5316\u3067\u304d\u307e\u3057\u305f\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u306f\u3001\u30ab\u30c6\u30b4\u30ea\u5024\u3068\u6570\u5024\u304c\u6df7\u5728\u3057\u3066\u3044\u307e\u3059\u3002\u30ab\u30c6\u30b4\u30ea\u5909\u6570\u3092\u76f4\u63a5\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306b\u6e21\u3059\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30e2\u30c7\u30eb\u5b66\u7fd2\u306e\u524d\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u7d9a\u3044\u3066\u3001\u5c5e\u6027\u306e\u30c7\u30fc\u30bf\u578b\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">heart_dataset.dtypes<\/code><\/pre>\n<\/div>\n<pre><code>Age                 int64\nSex                object\nChestPainType      object\nRestingBP           int64\nCholesterol         int64\nFastingBS           int64\nRestingECG         object\nMaxHR               int64\nExerciseAngina     object\nOldpeak           float64\nST_Slope           object\nHeartDisease        int64\ndtype: object\n<\/code><\/pre>\n<p>\u5c5e\u6027\u306e\u3046\u30615\u3064\u306f\u30c7\u30fc\u30bf\u578b\u304c\u300cobject\u300d\u3067\u3042\u308a\u3001\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u3067\u3042\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002\u6b8b\u308a\u306e\u5c5e\u6027\u306ffloat\u307e\u305f\u306fint\u3067\u3001\u30e2\u30c7\u30eb\u306e\u5b66\u7fd2\u6642\u306b\u76f4\u63a5\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001NULL\u5024\u304c\u3042\u308b\u3068\u6570\u5b66\u6f14\u7b97\u306e\u969b\u306b\u30a8\u30e9\u30fc\u3068\u306a\u308b\u305f\u3081\u3001NULL\u5024\u306f\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">heart_dataset.isna().sum()<\/code><\/pre>\n<\/div>\n<pre><code>Age               0\nSex               0\nChestPainType     0\nRestingBP         0\nCholesterol       0\nFastingBS         0\nRestingECG        0\nMaxHR             0\nExerciseAngina    0\nOldpeak           0\nST_Slope          0\nHeartDisease      0\ndtype: int64\n<\/code><\/pre>\n<p>\u5e78\u3044\u306a\u3053\u3068\u306b\u3001NULL\u5024\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6a5f\u68b0\u5b66\u7fd2\u306e\u30d1\u30fc\u30c8\u306b\u79fb\u308b\u524d\u306b\u3001\u30ab\u30c6\u30b4\u30ea\u5909\u6570\u3092\u63a2\u7d22\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">categorical_cols= heart_dataset.select_dtypes(include=['object'])\ncategorical_cols.columns<\/code><\/pre>\n<\/div>\n<pre><code>Index(['Sex', 'ChestPainType', 'RestingECG', 'ExerciseAngina', 'ST_Slope'], dtype='object')\n<\/code><\/pre>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">for cols in categorical_cols.columns:\n    print(cols,'-', len(categorical_cols[cols].unique()),'Labels')<\/code><\/pre>\n<\/div>\n<pre><code>Sex - 2 Labels\nChestPainType - 4 Labels\nRestingECG - 3 Labels\nExerciseAngina - 2 Labels\nST_Slope - 3 Labels\n<\/code><\/pre>\n<p>1\u3064\u306eCSV\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092<code>train<\/code>\u3068<code>test<\/code>\u306b\u5206\u5272\u3057\u3066\u304a\u304f\u3068\u3001\u5f8c\u3005\u7cbe\u5ea6\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u306b\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u6b8b\u3057\u3066\u304a\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001<code>train<\/code>\u3068<code>test<\/code>\u306e\u6bd4\u7387\u309270-30%\u3068\u3057\u3066\u3044\u307e\u3059\u3002random_state` \u5909\u6570\u306f\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u30e9\u30f3\u30c0\u30e0\u306b\u9078\u3070\u308c\u3001\u504f\u308a\u3084\u6b6a\u307f\u3092\u6700\u5c0f\u5316\u3059\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">train, test = train_test_split(heart_dataset,test_size=0.3,random_state= 1234)<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">labels = [x for x in train.ChestPainType.value_counts().index]\nvalues = train.ChestPainType.value_counts()<\/code><\/pre>\n<\/div>\n<p>\u80f8\u75db\u306e\u7a2e\u985e\u5225\u306e\u30c7\u30fc\u30bf\u5206\u5e03&#8211;\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.3)])\n\nfig.update_layout(\n    title_text=\"Distribution of data by Chest Pain Type (in %)\")\nfig.update_traces()\nfig.show()<\/code><\/pre>\n<\/div>\n<p>\u3055\u3089\u306b\u5fc3\u81d3\u75c5\u306e\u6709\u7121\u306b\u5206\u3051\u305f\u6027\u5225\u3054\u3068\u306e\u30c7\u30fc\u30bf\u5206\u5e03-\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">fig=px.histogram(heart_dataset, \n                 x=\"HeartDisease\",\n                 color=\"Sex\",\n                 hover_data=heart_dataset.columns,\n                 title=\"Distribution of Heart Diseases by Gender\",\n                 barmode=\"group\")\nfig.show()<\/code><\/pre>\n<\/div>\n<div>\n<div id=\"de4c4df5-fe66-4498-81ac-e8364250c1fc\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\">\n  <\/div>\n<p>  <script type=\"text\/javascript\">                require([\"plotly\"], function(Plotly) {                    window.PLOTLYENV=window.PLOTLYENV || {};                                    if (document.getElementById(\"de4c4df5-fe66-4498-81ac-e8364250c1fc\")) {                    Plotly.newPlot(                        \"de4c4df5-fe66-4498-81ac-e8364250c1fc\",                        [{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"hovertemplate\":\"Sex=M<br \/>HeartDisease=%{x}<br \/>count=%{y}<extra><\/extra>\",\"legendgroup\":\"M\",\"marker\":{\"color\":\"#636efa\",\"pattern\":{\"shape\":\"\"}},\"name\":\"M\",\"offsetgroup\":\"M\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[0,0,0,0,0,1,1,0,1,1,1,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,0,1,0,1,1,1,1,0,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,1,1,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,0,1,1,0,1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1,1,1,0,0,1,1,1,0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,0,1,0,0,1,0,1,1,1,1,0,1,1,0,0,0,1,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,1,0,1,1,1,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,0,1,1,0,1,1,0,1,0,0,0,1,0,1,1,1,0,1,1,0,0,1,1,0,0,0,1,1,1,0,1,1,1,1,0],\"xaxis\":\"x\",\"yaxis\":\"y\",\"type\":\"histogram\"},{\"alignmentgroup\":\"True\",\"bingroup\":\"x\",\"hovertemplate\":\"Sex=F<br \/>HeartDisease=%{x}<br \/>count=%{y}<extra><\/extra>\",\"legendgroup\":\"F\",\"marker\":{\"color\":\"#EF553B\",\"pattern\":{\"shape\":\"\"}},\"name\":\"F\",\"offsetgroup\":\"F\",\"orientation\":\"v\",\"showlegend\":true,\"x\":[1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1],\"xaxis\":\"x\",\"yaxis\":\"y\",\"type\":\"histogram\"}],                        {\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"surface\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}]},\"layout\":{\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"autotypenumbers\":\"strict\",\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"mapbox\":{\"style\":\"light\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"bgcolor\":\"#E5ECF6\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"bgcolor\":\"#E5ECF6\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"title\":{\"x\":0.05},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"zerolinewidth\":2},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"zerolinewidth\":2}}},\"xaxis\":{\"anchor\":\"y\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"HeartDisease\"}},\"yaxis\":{\"anchor\":\"x\",\"domain\":[0.0,1.0],\"title\":{\"text\":\"count\"}},\"legend\":{\"title\":{\"text\":\"Sex\"},\"tracegroupgap\":0},\"title\":{\"text\":\"Distribution of Heart Diseases by Gender\"},\"barmode\":\"group\"},                        {\"responsive\": true}                    ).then(function(){<\/p>\n<p>var gd = document.getElementById('de4c4df5-fe66-4498-81ac-e8364250c1fc');\nvar x = new MutationObserver(function (mutations, observer) {{\n        var display = window.getComputedStyle(gd).display;\n        if (!display || display === 'none') {{\n            console.log([gd, 'removed!']);\n            Plotly.purge(gd);\n            observer.disconnect();\n        }}\n}});<\/p>\n<p>\/\/ Listen for the removal of the full notebook cells\nvar notebookContainer = gd.closest('#notebook-container');\nif (notebookContainer) {{\n    x.observe(notebookContainer, {childList: true});\n}}<\/p>\n<p>\/\/ Listen for the clearing of the current output cell\nvar outputEl = gd.closest('.output');\nif (outputEl) {{\n    x.observe(outputEl, {childList: true});\n}}<\/p>\n<p>                        })                };                });            <\/script>\n<\/div>\n<p><code>\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0<\/code>\u3084<code>\u30d1\u30a4<\/code>\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3001\u4ed6\u306e\u30ab\u30c6\u30b4\u30ea\u30fc\u5909\u6570\u3067\u5b9f\u9a13\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>6&#46; \u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5909\u6570\u306e\u53d6\u308a\u6271\u3044<\/h2>\n<p>5\u3064\u306e\u30ab\u30c6\u30b4\u30ea\u30ab\u30eb\u5c5e\u6027\u306e\u3046\u3061\u3001<code>Sex<\/code>\u3068<code>ExerciseAngina<\/code>\u306e2\u3064\u306e\u5c5e\u6027\u306f\u30d0\u30a4\u30ca\u30ea\u3001\u3064\u307e\u308a2\u3064\u306e\u5024\u3057\u304b\u53d6\u3089\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u3053\u308c\u3089\u3092 0 \u3068 1 \u3092\u4f7f\u3063\u3066\u624b\u52d5\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ed6\u306e\u5024\u306b\u3064\u3044\u3066\u306f\u3001\u30a8\u30f3\u30b3\u30fc\u30c9\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">train['Sex'] = np.where(train['Sex'] == \"M\", 0, 1)\ntrain['ExerciseAngina'] = np.where(train['ExerciseAngina'] == \"N\", 0, 1)\ntest['Sex'] = np.where(test['Sex'] == \"M\", 0, 1)\ntest['ExerciseAngina'] = np.where(test['ExerciseAngina'] == \"N\", 0, 1)<\/code><\/pre>\n<\/div>\n<pre><code>&lt;ipython-input-14-3d5da43d58db&gt;:1: SettingWithCopyWarning:\n\n\nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/indexing.html#returning-a-view-versus-a-copy\n\n&lt;ipython-input-14-3d5da43d58db&gt;:2: SettingWithCopyWarning:\n\n\nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/indexing.html#returning-a-view-versus-a-copy\n\n&lt;ipython-input-14-3d5da43d58db&gt;:3: SettingWithCopyWarning:\n\n\nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/indexing.html#returning-a-view-versus-a-copy\n\n&lt;ipython-input-14-3d5da43d58db&gt;:4: SettingWithCopyWarning:\n\n\nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/indexing.html#returning-a-view-versus-a-copy\n<\/code><\/pre>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">train.head()<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }<\/p>\n<p>    .dataframe tbody tr th {\n        vertical-align: top;\n    }<\/p>\n<p>    .dataframe thead th {\n        text-align: right;\n    }\n  <\/style>\n<table border=\"1\" class=\"dataframe\">\n<thead>\n<tr style=\"text-align: right;\">\n<th>\n        <\/th>\n<th>\n          Age\n        <\/th>\n<th>\n          Sex\n        <\/th>\n<th>\n          ChestPainType\n        <\/th>\n<th>\n          RestingBP\n        <\/th>\n<th>\n          Cholesterol\n        <\/th>\n<th>\n          FastingBS\n        <\/th>\n<th>\n          RestingECG\n        <\/th>\n<th>\n          MaxHR\n        <\/th>\n<th>\n          ExerciseAngina\n        <\/th>\n<th>\n          Oldpeak\n        <\/th>\n<th>\n          ST_Slope\n        <\/th>\n<th>\n          HeartDisease\n        <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>\n          578\n        <\/th>\n<td>\n          57\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          ASY\n        <\/td>\n<td>\n          156\n        <\/td>\n<td>\n          173\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          LVH\n        <\/td>\n<td>\n          119\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          3.0\n        <\/td>\n<td>\n          Down\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          480\n        <\/th>\n<td>\n          58\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          ATA\n        <\/td>\n<td>\n          126\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          110\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          2.0\n        <\/td>\n<td>\n          Flat\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          512\n        <\/th>\n<td>\n          35\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          NAP\n        <\/td>\n<td>\n          123\n        <\/td>\n<td>\n          161\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          ST\n        <\/td>\n<td>\n          153\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          -0.1\n        <\/td>\n<td>\n          Up\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          634\n        <\/th>\n<td>\n          40\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          TA\n        <\/td>\n<td>\n          140\n        <\/td>\n<td>\n          199\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          178\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1.4\n        <\/td>\n<td>\n          Up\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          412\n        <\/th>\n<td>\n          56\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          ASY\n        <\/td>\n<td>\n          125\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          Normal\n        <\/td>\n<td>\n          103\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1.0\n        <\/td>\n<td>\n          Flat\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>3\u3064\u4ee5\u4e0a\u306e\u5c5e\u6027\u306b\u3064\u3044\u3066\u306f\u3001pandas\u306e <code>get_dummies<\/code> \u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u30e9\u30d9\u30eb\u3054\u3068\u306b\u65b0\u3057\u3044\u5c5e\u6027\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<code>ChestPainType<\/code>\u306f4\u3064\u306e\u30e9\u30d9\u30eb\u3092\u6301\u3064\u306e\u3067\u30010\u304b1\u306e\u5024\u3092\u6301\u30644\u3064\u306e\u65b0\u3057\u3044\u5c5e\u6027\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">train=pd.get_dummies(train)\ntest=pd.get_dummies(test)<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">train.head()<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }<\/p>\n<p>    .dataframe tbody tr th {\n        vertical-align: top;\n    }<\/p>\n<p>    .dataframe thead th {\n        text-align: right;\n    }\n  <\/style>\n<table border=\"1\" class=\"dataframe\">\n<thead>\n<tr style=\"text-align: right;\">\n<th>\n        <\/th>\n<th>\n          Age\n        <\/th>\n<th>\n          Sex\n        <\/th>\n<th>\n          RestingBP\n        <\/th>\n<th>\n          Cholesterol\n        <\/th>\n<th>\n          FastingBS\n        <\/th>\n<th>\n          MaxHR\n        <\/th>\n<th>\n          ExerciseAngina\n        <\/th>\n<th>\n          Oldpeak\n        <\/th>\n<th>\n          HeartDisease\n        <\/th>\n<th>\n          ChestPainType_ASY\n        <\/th>\n<th>\n          ChestPainType_ATA\n        <\/th>\n<th>\n          ChestPainType_NAP\n        <\/th>\n<th>\n          ChestPainType_TA\n        <\/th>\n<th>\n          RestingECG_LVH\n        <\/th>\n<th>\n          RestingECG_Normal\n        <\/th>\n<th>\n          RestingECG_ST\n        <\/th>\n<th>\n          ST_Slope_Down\n        <\/th>\n<th>\n          ST_Slope_Flat\n        <\/th>\n<th>\n          ST_Slope_Up\n        <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>\n          578\n        <\/th>\n<td>\n          57\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          156\n        <\/td>\n<td>\n          173\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          119\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          3.0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          480\n        <\/th>\n<td>\n          58\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          126\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          110\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          2.0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          512\n        <\/th>\n<td>\n          35\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          123\n        <\/td>\n<td>\n          161\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          153\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          -0.1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          634\n        <\/th>\n<td>\n          40\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          140\n        <\/td>\n<td>\n          199\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          178\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1.4\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          412\n        <\/th>\n<td>\n          56\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          125\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          103\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1.0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">test.head()<\/code><\/pre>\n<\/div>\n<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }<\/p>\n<p>    .dataframe tbody tr th {\n        vertical-align: top;\n    }<\/p>\n<p>    .dataframe thead th {\n        text-align: right;\n    }\n  <\/style>\n<table border=\"1\" class=\"dataframe\">\n<thead>\n<tr style=\"text-align: right;\">\n<th>\n        <\/th>\n<th>\n          Age\n        <\/th>\n<th>\n          Sex\n        <\/th>\n<th>\n          RestingBP\n        <\/th>\n<th>\n          Cholesterol\n        <\/th>\n<th>\n          FastingBS\n        <\/th>\n<th>\n          MaxHR\n        <\/th>\n<th>\n          ExerciseAngina\n        <\/th>\n<th>\n          Oldpeak\n        <\/th>\n<th>\n          HeartDisease\n        <\/th>\n<th>\n          ChestPainType_ASY\n        <\/th>\n<th>\n          ChestPainType_ATA\n        <\/th>\n<th>\n          ChestPainType_NAP\n        <\/th>\n<th>\n          ChestPainType_TA\n        <\/th>\n<th>\n          RestingECG_LVH\n        <\/th>\n<th>\n          RestingECG_Normal\n        <\/th>\n<th>\n          RestingECG_ST\n        <\/th>\n<th>\n          ST_Slope_Down\n        <\/th>\n<th>\n          ST_Slope_Flat\n        <\/th>\n<th>\n          ST_Slope_Up\n        <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>\n          581\n        <\/th>\n<td>\n          48\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          140\n        <\/td>\n<td>\n          208\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          159\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1.5\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          623\n        <\/th>\n<td>\n          60\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          140\n        <\/td>\n<td>\n          293\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          170\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1.2\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          60\n        <\/th>\n<td>\n          49\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          100\n        <\/td>\n<td>\n          253\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          174\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0.0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          613\n        <\/th>\n<td>\n          58\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          140\n        <\/td>\n<td>\n          385\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          135\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0.3\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<tr>\n<th>\n          40\n        <\/th>\n<td>\n          54\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          150\n        <\/td>\n<td>\n          230\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          130\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0.0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          0\n        <\/td>\n<td>\n          1\n        <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">train.shape<\/code><\/pre>\n<\/div>\n<pre><code>(642, 19)\n<\/code><\/pre>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">test.shape<\/code><\/pre>\n<\/div>\n<pre><code>(276, 19)\n<\/code><\/pre>\n<p>\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u305f\u5206\u3001\u5c5e\u6027\u306e\u7dcf\u6570\u304c\u5897\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u518d\u3073\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30bb\u30c3\u30c8\u3068\u30c6\u30b9\u30c8\u30bb\u30c3\u30c8\u3092 <code>X<\/code> \u3068 <code>Y<\/code> \u306b\u5206\u3051\u308b\u3002X<code>\u306f\u5f93\u5c5e\u5909\u6570\u3067\u3042\u308b<\/code>Y<code>\u306e\u7d50\u679c\u3092\u6c7a\u5b9a\u3059\u308b\u72ec\u7acb\u5909\u6570\/\u5c5e\u6027\u306e\u96c6\u5408\u3092\u8868\u3057\u307e\u3059\u3002\u6211\u3005\u306e\u5834\u5408\u3001\u5f93\u5c5e\u5909\u6570\u307e\u305f\u306f\u8aac\u660e\u5909\u6570\u306f<\/code>HeartDisease` \u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">x_train=train.drop(['HeartDisease'],1)\nx_test=test.drop(['HeartDisease'],1)\n\ny_train=train['HeartDisease']\ny_test=test['HeartDisease']<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(x_train.shape)\nprint(x_test.shape)<\/code><\/pre>\n<\/div>\n<pre><code>(642, 18)\n(276, 18)\n<\/code><\/pre>\n<h2>7&#46; \u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb<\/h2>\n<p>\u305d\u308c\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ol>\n<li>max_iter=10000`. \u30bd\u30eb\u30d0\u30fc\u304c\u53ce\u675f\u3059\u308b\u307e\u3067\u306b\u304b\u304b\u308b\u6700\u5927\u53cd\u5fa9\u56de\u6570\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f100\u56de\u3067\u3059\u3002<\/li>\n<li>penalty=l2<code>. \u30da\u30ca\u30eb\u30c6\u30a3\u306b\u4f7f\u7528\u3059\u308b\u30ce\u30eb\u30e0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001<\/code>None, l1, l2, and, elasticnet`\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f l2 \u3067\u3059\u306e\u3067\u3001\u660e\u793a\u7684\u306b\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<\/ol>\n<p>\u3053\u306e\u95a2\u6570\u3067\u306f\uff0c <code>class_weight, random_state, etc<\/code> \u306a\u3069\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5229\u7528\u53ef\u80fd\u3067\u3059\uff0e\u4f7f\u3044\u65b9\u3084\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u542b\u3080\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f <a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LogisticRegression.html\">\u3053\u3061\u3089<\/a>\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">lr = LogisticRegression(max_iter=10000)\nmodel1=lr.fit(x_train, y_train)<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(\"Train accuracy:\",model1.score(x_train, y_train))<\/code><\/pre>\n<\/div>\n<pre><code>Train accuracy: 0.8566978193146417\n<\/code><\/pre>\n<p>\u5b66\u7fd2\u7cbe\u5ea6\u306f\u7d0485.6%\u3067\u3001\u307e\u305a\u307e\u305a\u306e\u30b9\u30bf\u30fc\u30c8\u3068\u8a00\u3048\u305d\u3046\u3067\u3059\u3002\u305d\u308c\u3067\u306f\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u4e88\u6e2c\u3092\u884c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>8&#46; \u30e2\u30c7\u30eb\u8a55\u4fa1<\/h2>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(\"Test accuracy:\",model1.score(x_test,y_test))<\/code><\/pre>\n<\/div>\n<pre><code>Test accuracy: 0.894927536231884\n<\/code><\/pre>\n<p>\u30c6\u30b9\u30c8\u7cbe\u5ea6\u306f89.5\uff05\u3068\u4e88\u60f3\u4ee5\u4e0a\u306b\u9ad8\u3044\u3067\u3059\u3002\u7d20\u6674\u3089\u3057\u3044\u3067\u3059\u306d\u3002\u3053\u308c\u3067\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b <code>predict<\/code> \u30e1\u30bd\u30c3\u30c9\u3092\u7528\u3044\u3066\u4e88\u6e2c\u5024\u3092\u683c\u7d0d\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">lrpred = lr.predict(x_test)<\/code><\/pre>\n<\/div>\n<h3>8&#46;1 \u5206\u985e\u30ec\u30dd\u30fc\u30c8<\/h3>\n<p><code>classification_report<\/code> \u306f\u30e2\u30c7\u30eb\u8a55\u4fa1\u306b\u4f7f\u7528\u3055\u308c\u308b <a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.classification_report.html\">scikit-learn<\/a> \u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6307\u6a19\u306e\u4e00\u3064\u3067\u3059\u3002\u3053\u306e\u95a2\u6570\u306f\u4ee5\u4e0b\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li><code>Precision:<\/code> True Positive\/(True Positive+False Positive) \u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<\/li>\n<li><code>Recall:<\/code> True Positive\/(True Positive+False Negative)\u3067\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<\/li>\n<li><code>F1 Score:<\/code> \u7cbe\u5ea6\u3068\u60f3\u8d77\u7387\u306e\u52a0\u91cd\u8abf\u548c\u5e73\u5747\u5024\u30021\u306f\u4e21\u8005\u306e\u52a0\u91cd\u304c\u7b49\u3057\u3044\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/li>\n<li><code>Support:<\/code> Ground Truth \u306b\u304a\u3051\u308b\u5404\u30af\u30e9\u30b9\u306e\u51fa\u73fe\u6570\u3002<\/li>\n<\/ol>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">print(classification_report(lrpred,y_test))<\/code><\/pre>\n<\/div>\n<pre><code>              precision    recall  f1-score   support\n\n           0       0.85      0.90      0.88       114\n           1       0.93      0.89      0.91       162\n\n    accuracy                           0.89       276\n   macro avg       0.89      0.90      0.89       276\nweighted avg       0.90      0.89      0.90       276\n<\/code><\/pre>\n<h3>8&#46;2 \u6df7\u540c\u884c\u5217<\/h3>\n<p>\u6df7\u540c\u884c\u5217\u3082\u307e\u305f\u3001\u5206\u985e\u5668\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306b\u7528\u3044\u3089\u308c\u308b\u6307\u6a19\u306e1\u3064\u3067\u3059\u3002\u5b9a\u7fa9\u306b\u3088\u308c\u3070\u3001\u6df7\u540c\u884c\u5217\u306e\u5404\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3 <code>(i,j)<\/code> \u306f\u3001\u5b9f\u969b\u306b\u306f\u30b0\u30eb\u30fc\u30d7 <code>i<\/code> \u306b\u542b\u307e\u308c\u308b\u304c\u3001\u30e2\u30c7\u30eb\u306b\u3088\u3063\u3066\u30b0\u30eb\u30fc\u30d7 <code>j<\/code> \u306b\u5206\u985e\u3055\u308c\u308b\u30aa\u30d6\u30b6\u30d9\u30fc\u30b7\u30e7\u30f3\u3092\u8868\u3057\u307e\u3059\u3002\u6df7\u540c\u884c\u5217\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u306f <a href=\"https:\/\/scikit-learn.org\/stable\/modules\/model_evaluation.html#confusion-matrix\">\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">displr = plot_confusion_matrix(lr, x_test, y_test,cmap=plt.cm.OrRd , values_format='d')<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/01\/confusion_matrix.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/01\/confusion_matrix.png\" alt=\"\" width=\"312\" height=\"262\" class=\"aligncenter size-full wp-image-28026\" srcset=\"\/wp-content\/uploads\/2022\/01\/confusion_matrix.png 312w, \/wp-content\/uploads\/2022\/01\/confusion_matrix-300x252.png 300w\" sizes=\"(max-width: 312px) 100vw, 312px\" \/><\/a><\/p>\n<h2>9&#46; \u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001GriDB \u3068 Python \u3092\u4f7f\u7528\u3057\u3066\u3001\u5fc3\u4e0d\u5168\u4e88\u6e2c\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u5206\u985e\u5668\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066\u3001GridDB\u3068Pandas\u306e2\u3064\u3092\u53d6\u308a\u4e0a\u3052\u307e\u3057\u305f\u3002GridDB\u306f\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u3067\u3042\u308b\u305f\u3081\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306b\u52b9\u7387\u7684\u306a\u65b9\u6cd5\u3067\u3059\u3002 \u305c\u3072<a href=\"https:\/\/griddb.net\/ja\/downloads\/\">GridDB\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\u3057\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<h2>10&#46; \u53c2\u8003\u6587\u732e<\/h2>\n<ol>\n<li>https:\/\/www.kaggle.com\/fedesoriano\/heart-failure-prediction<\/li>\n<li>https:\/\/www.kaggle.com\/sisharaneranjana\/machine-learning-to-the-fore-to-save-lives<\/li>\n<li>https:\/\/www.kaggle.com\/durgancegaur\/a-guide-to-any-classification-problem<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u3044\u304f\u3064\u304b\u306e\u63a2\u7d22\u7684\u30c7\u30fc\u30bf\u89e3\u6790\u3092\u884c\u3044\u307e\u3059 [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":49362,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50779","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>\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\" \/>\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\/ja\/\u672a\u5206\u985e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/heart-failure-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-01-27T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:55:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/01\/heart.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=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c\",\"datePublished\":\"2022-01-27T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:55:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/\"},\"wordCount\":272,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/01\/heart.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/\",\"url\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/\",\"name\":\"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\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:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/01\/heart.png\",\"datePublished\":\"2022-01-27T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:55:07+00:00\",\"description\":\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2022\/01\/heart.png\",\"contentUrl\":\"\/wp-content\/uploads\/2022\/01\/heart.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":"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b","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\/ja\/\u672a\u5206\u985e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/","og_locale":"ja_JP","og_type":"article","og_title":"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c | GridDB: Open Source Time Series Database for IoT","og_description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b","og_url":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/heart-failure-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-01-27T08:00:00+00:00","article_modified_time":"2025-11-14T15:55:07+00:00","og_image":[{"width":1160,"height":653,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2022\/01\/heart.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":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\u4e88\u6e2c","datePublished":"2022-01-27T08:00:00+00:00","dateModified":"2025-11-14T15:55:07+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/"},"wordCount":272,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/01\/heart.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/","url":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/","name":"\u6a5f\u68b0\u5b66\u7fd2\u3001Python\u3001GridDB\u3092\u7528\u3044\u305f\u5fc3\u4e0d\u5168\u306e\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:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/01\/heart.png","datePublished":"2022-01-27T08:00:00+00:00","dateModified":"2025-11-14T15:55:07+00:00","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Kaggle\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u300c\u5fc3\u4e0d\u5168\u4e88\u6e2c\u300d\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002GridDB\u3092\u4f7f\u7528\u3057\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/heart-failure-prediction-using-machine-learning-python-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2022\/01\/heart.png","contentUrl":"\/wp-content\/uploads\/2022\/01\/heart.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\/50779","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=50779"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50779\/revisions"}],"predecessor-version":[{"id":51613,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/posts\/50779\/revisions\/51613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media\/49362"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/media?parent=50779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/categories?post=50779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/ja\/wp-json\/wp\/v2\/tags?post=50779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}