{"id":50733,"date":"2021-03-03T00:00:00","date_gmt":"2021-03-03T08:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/"},"modified":"2025-11-14T07:54:28","modified_gmt":"2025-11-14T15:54:28","slug":"detecting-anomalies-from-data-in-griddb-with-python-sklearn","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/","title":{"rendered":"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u7570\u5e38\u691c\u77e5\u306f\u3001\u73fe\u4ee3\u306e\u30b7\u30b9\u30c6\u30e0\u304c\u5186\u6ed1\u304b\u3064\u5b89\u5168\u306b\u7a3c\u50cd\u3059\u308b\u305f\u3081\u306b\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u304a\u308a\u3001\u4e0d\u6b63\u691c\u77e5\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u5065\u5168\u6027\u76e3\u8996\u3001\u4fb5\u5165\u691c\u77e5\u3001\u969c\u5bb3\u691c\u77e5\u3001\u54c1\u8cea\u4fdd\u8a3c\u3001\u30c7\u30fc\u30bf\u30de\u30a4\u30cb\u30f3\u30b0\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u5206\u91ce\u3084\u4f7f\u7528\u4f8b\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"#source-code\"> \u672c\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u3066\u3044\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u304b\u3089\u53d6\u5f97\u3067\u304d\u307e\u3059 <\/a><\/p>\n<p>\u4e00\u8a00\u3067\u8a00\u3048\u3070\u3001\u7570\u5e38\u691c\u77e5\u3068\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e2d\u306b\u3042\u308b\u901a\u5e38\u3068\u306f\u7570\u306a\u308b\u30d1\u30bf\u30fc\u30f3\u3084\u4e88\u60f3\u5916\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u7279\u5b9a\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u78ba\u7387\u306e\u4f4e\u3044\u30a2\u30a4\u30c6\u30e0\u3084\u30a4\u30d9\u30f3\u30c8\u306f\u3001\u4e00\u822c\u7684\u306b\u5916\u308c\u5024\u3068\u547c\u3070\u308c\u307e\u3059\uff08\u6587\u8108\u306b\u3088\u3063\u3066\u306f\u30ce\u30d9\u30eb\u30c6\u30a3\u3068\u3082\u547c\u3070\u308c\u307e\u3059\uff09\u3002<\/p>\n<p>\u6a5f\u68b0\u5b66\u7fd2\u306e\u6280\u8853\u306f\u3001\u5916\u308c\u5024\u306e\u767a\u898b\u3068\u51e6\u7406\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u81ea\u52d5\u5316\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7570\u5e38\u691c\u77e5\u3092\u5927\u898f\u6a21\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001IoT\u3084\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u96c6\u7d04\u578b\u306e\u5206\u6563\u30b7\u30b9\u30c6\u30e0\u306e\u8981\u6c42\u306b\u5fdc\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u306f\u3001\u4eba\u6c17\u306e\u9ad8\u3044Python\u30e9\u30a4\u30d6\u30e9\u30eascikit-learn (sklearn)\u3068\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306eIoT\u306b\u6700\u9069\u5316\u3055\u308c\u305f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308bGridDB\u3092\u4f75\u7528\u3057\u3066\u3001\u7570\u5e38\u691c\u77e5\u6280\u8853\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3092\u63a2\u308a\u307e\u3059\u3002<\/p>\n<h2>\u3044\u304f\u3064\u304b\u306e\u524d\u7f6e\u304d\u306b\u3064\u3044\u3066<\/h2>\n<p>scikit-learn\u3067\u306e\u7570\u5e38\u691c\u77e5\u3092\u59cb\u3081\u308b\u524d\u306b\u3001\u307e\u305a\u6700\u521d\u306b\u8a2d\u5b9a\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u524d\u63d0\u6761\u4ef6\u3068\u3001\u8b70\u8ad6\u3092\u9032\u3081\u308b\u4e0a\u3067\u306e\u7559\u610f\u70b9\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h3>\u76ee\u6a19\u3068\u7bc4\u56f2<\/h3>\n<p>\u524d\u8ff0\u3057\u305f\u3088\u3046\u306b\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306fsklearn\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u63d0\u4f9b\u3059\u308b\u69d8\u3005\u306a\u7570\u5e38\u691c\u77e5\u30c4\u30fc\u30eb\u3068\u6a5f\u80fd\u3001\u7279\u306bGridDB\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\u6a5f\u80fd\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3067\u304d\u308b\u3060\u3051\u6982\u8981\u3068\u80cc\u666f\u3092\u7406\u89e3\u3057\u3066\u3082\u3089\u3046\u305f\u3081\u306b\u3001\u6559\u5e2b\u3042\u308a\u3001\u6559\u5e2b\u306a\u3057\u306e\u4e21\u65b9\u306e\u7570\u5e38\u691c\u77e5\u306b\u3064\u3044\u3066\u3001sklearn\u3068GridDB\u306e\u4e21\u65b9\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\u7406\u60f3\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u3053\u306e\u76ee\u7684\u306b\u6cbf\u3063\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u3001\u30b3\u30fc\u30c9\u4f8b\u3067\u306fGridDB\u3068\u306e\u9023\u643a\u3001\u57fa\u672c\u7684\u306a\u63a2\u7d22\u7684\u30c7\u30fc\u30bf\u5206\u6790\u3001\u30e2\u30c7\u30eb\u306e\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u306b\u7126\u70b9\u3092\u5f53\u3066\u307e\u3059\u3002\u7279\u5fb4\u9078\u629e\u3001\u30cf\u30a4\u30d1\u30fc\u30d1\u30e9\u30e1\u30fc\u30bf\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3001\u30e2\u30c7\u30eb\u9078\u629e\u306a\u3069\u3001\u6a5f\u68b0\u5b66\u7fd2\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u4ed6\u306e\u30b9\u30c6\u30c3\u30d7\u306b\u3064\u3044\u3066\u306f\u7701\u7565\u3057\u307e\u3059\uff08\u305f\u3060\u3057\u3001\u3053\u308c\u3089\u306e\u30c8\u30d4\u30c3\u30af\u306b\u3064\u3044\u3066\u3082\u91cd\u8981\u306a\u30a2\u30a4\u30c7\u30a2\u3084\u30b3\u30f3\u30bb\u30d7\u30c8\u3092\u76db\u308a\u8fbc\u307f\u307e\u3059\uff09\u3002<\/p>\n<h3>GridDB\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u63a5\u7d9a<\/h3>\n<p>\u3053\u3053\u3067\u306f\u3001GridDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u305b\u3093\u3002\u3082\u3057GridDB\u306e\u8a2d\u5b9a\u65b9\u6cd5\u3084Python\u3067\u306e\u63a5\u7d9a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001\u4fbf\u5229\u306a\u30ac\u30a4\u30c9\u304c<a href=\"https:\/\/griddb.net\/ja\/blog\/using-python-to-interface-with-griddb-via-jdbc-with-jaydebeapi\/\">\u5225\u306e\u30d6\u30ed\u30b0<\/a>\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u305c\u3072\u3054\u89a7\u306b\u306a\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001GridDB\u3068Jupyter\u3092\u7d20\u65e9\u304f\u7acb\u3061\u4e0a\u3052\u308b\u305f\u3081\u306b\u3001\u3053\u306e<a href=\"https:\/\/github.com\/roenschg\/griddb-jupyter-quikstart\">docker-compose<\/a>\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001GridDB\u306e\u63a5\u7d9a\u3092\u4f5c\u6210\u3059\u308b\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u3082\u66f8\u304d\u307e\u3057\u305f\u3002\u3053\u306e\u30b3\u30fc\u30c9\u306f\u524d\u8ff0\u306e\u30ac\u30a4\u30c9\u306b\u57fa\u3065\u3044\u3066\u304a\u308a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306eutils\/helpers\/db.py\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">$ sudo yum -y install griddb_nosql griddb-c-client<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nimport jaydebeapi\n\ndef get_connection() -> jaydebeapi.Connection:\n    conn = jaydebeapi.connect(\n        \"com.toshiba.mwcloud.gs.sql.Driver\",\n        \"jdbc:gs:\/\/griddb:20001\/defaultCluster\/public?notificationMember:127.0.0.1:20001\",\n        [\"admin\", \"admin\"],\n        \"\/usr\/share\/java\/gridstore-jdbc-4.5.0.jar\",\n    )\n    return conn\n  <\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u6a5f\u80fd\u306b\u3088\u308a\u3001Jupyter Notebook\u3084\u672c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308b\u4ed6\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u53c2\u7167\uff09\u3067GridDB\u63a5\u7d9a\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf\u306b\u3064\u3044\u3066<\/h3>\n<p>scikit-learn\u306e\u7570\u5e38\u691c\u77e5\u306e\u6982\u8981\u3092\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u30012\u3064\u306e\u7570\u306a\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u30021\u3064\u306f\u6559\u5e2b\u306a\u3057\u7570\u5e38\u691c\u77e5\u306e\u8b70\u8ad6\u306b\u4f7f\u7528\u3059\u308b\u4eba\u5de5\u7684\u306b\u751f\u6210\u3055\u308c\u305f\u6642\u7cfb\u5217\u3067\u3001\u3082\u30461\u3064\u306f\u6559\u5e2b\u3042\u308a\u7570\u5e38\u691c\u77e5\u30e2\u30c7\u30eb\u306e\u5b66\u7fd2\u306b\u4f7f\u7528\u3059\u308b\u30e9\u30d9\u30eb\u4ed8\u304d\u30c7\u30fc\u30bf\u3067\u3059\u3002<\/p>\n<h3>\u4eba\u5de5\u7684\u306a\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u306e\u751f\u6210\u3068\u4fdd\u5b58<\/h3>\n<p>\u6559\u5e2b\u306a\u3057\u3067\u7570\u5e38\u3092\u691c\u51fa\u3059\u308b\u305f\u3081\u306b\u3001\u96fb\u6c17\u4f7f\u7528\u91cf\u30bb\u30f3\u30b5\u30fc\u306e\u51fa\u529b\u3092\u30b7\u30df\u30e5\u30ec\u30fc\u30c8\u3057\u305f\u4eba\u5de5\u7684\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u4e00\u5b9a\u306e\u6642\u9593\u9593\u9694\u3067\u53d6\u5f97\u3055\u308c\u305f\u30bb\u30f3\u30b5\u30fc\u306e\u6e2c\u5b9a\u5024\uff08\u5358\u4f4d\uff1a\u30ad\u30ed\u30ef\u30c3\u30c8\u6642\uff09\u3067\u3059\u3002\u3053\u308c\u3092\u884c\u3046\u95a2\u6570\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nimport numpy as np\nimport pandas as pd\n\nrng = np.random.RandomState(42)\n\n\ndef create_sensor_data(\n    size: int,\n    freq: str,\n    outlier_fraction: float\n) -> pd.DataFrame:\n    \"\"\"Generates toy time-series dataset.\"\"\"\n    # Generate normally-distributed values\n    ts_index = pd.date_range(\"2020-01-15\", periods=size, freq=freq)\n    sensor_readings = rng.normal(loc=4, scale=0.6, size=size)\n    df = pd.DataFrame(sensor_readings, index=ts_index, columns=[\"kwh\"])\n\n    # Replace some values with outliers at random timestamps\n    num_outliers = int(outlier_fraction * size)\n    outlier_ts = np.random.choice(df.index, size=num_outliers, replace=False)\n    df.loc[outlier_ts, \"kwh\"] = rng.normal(\n        loc=9,\n        scale=0.01,\n        size=num_outliers\n    )\n\n    # Add integer timestamp column\n    df['ts'] = df.apply(lambda row: int(row.name.timestamp()), axis=1)\n\n    return df\n  <\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u95a2\u6570\u306f\u3001\u5916\u308c\u5024\u3092\u542b\u3080\u6b63\u898f\u5206\u5e03\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6301\u3064pandas\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u964d\u306e\u8aac\u660e\u306e\u305f\u3081\u306b\u300115\u5206\u3054\u3068\u306b500\u500b\u306e\u89b3\u6e2c\u5024\uff08\u305d\u306e\u3046\u3061\u306e2\uff05\u304c\u5916\u308c\u5024\uff09\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nsensor_data = create_sensor_data(\n    size=500,\n    freq='15T',\n    outlier_fraction='0.02'\n)\n  <\/code><\/pre>\n<\/div>\n<p>\u305d\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u95a2\u6570\u3092\u7528\u3044\u3066\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092GridDB\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nfrom jaydebeapi import Connection\n\n\ndef load_into_sensor_table(conn: Connection, data: pd.DataFrame) -> int:\n    \"\"\"Inserts data into sensor table.\"\"\"\n    cursor = conn.cursor()\n    row_count = 0\n\n    try:\n        # Create table\n        cursor.execute(\n            \"\"\"\n            CREATE TABLE IF NOT EXISTS power_sensor(\n                ts INTEGER PRIMARY KEY,\n                kwh FLOAT\n            )\n            \"\"\"\n        )\n\n        # Insert all rows\n        for row in data.itertuples():\n            cursor.execute(\n                \"\"\"\n                INSERT INTO power_sensor(ts, kwh)\n                VALUES (?, ?)\n                \"\"\",\n                (row.ts, row.kwh)\n            )\n        conn.commit()\n        \n        # Check if successfully inserted\n        cursor.execute(\"SELECT * FROM power_sensor\")\n        result = cursor.fetchall()\n        if len(result) == 0:\n            raise ValueError('No rows inserted')\n\n        row_count = len(result)\n    except Exception as e:\n        conn.rollback()\n        print(f'Error loading data into db: {e}')\n    finally:\n        cursor.close()\n\n    return row_count\n  <\/code><\/pre>\n<\/div>\n<p>\u3053\u3053\u3067\u306f\u3001power_sensor\u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3001\u5024\u3092\u884c\u3068\u3057\u3066\u633f\u5165\u3057\u307e\u3059\u3002conn\u5909\u6570\u306e\u5024\u306f\u3001\u5148\u307b\u3069\u5b9a\u7fa9\u3057\u305fget_connection()\u95a2\u6570\u3092\u4f7f\u3063\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nfrom utils.helpers.db import get_connection\n\nconn = get_connection()\nnrows = load_into_sensor_table(conn, sensor_data)\nnrows               # Should be 500 if everything is ok\n  <\/code><\/pre>\n<\/div>\n<h3>HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\u3068\u4fdd\u5b58<\/h3>\n<p>\u6559\u5e2b\u3042\u308a\u306e\u7570\u5e38\u691c\u77e5\u306b\u306f\u3001ODDS\uff08Outlier Detection Datasets\uff09\u30b5\u30a4\u30c8\u304b\u3089\u5165\u624b\u53ef\u80fd\u306ahttp\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\uff08KDDCUP99\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u8a73\u7d30\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>567,498\u500b\u306e\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3092\u542b\u307f\u3001\u305d\u308c\u305e\u308c\u304cHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u8868\u3057\u307e\u3059\u3002<\/li>\n<li>3\u3064\u306e\u5c5e\u6027\uff08duration, src_bytes, and dst_bytes\uff09\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002<\/li>\n<li>\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u653b\u6483\uff081\uff09\u3067\u3042\u308b\u304b\u901a\u5e38\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\uff080\uff09\u3067\u3042\u308b\u304b\u3092\u793a\u3059\u30e9\u30d9\u30eb\u5217\u3092\u6301\u3061\u307e\u3059\u3002<\/li>\n<li>\u5143\u306e\u5024\u3092\u30bc\u30ed\u304b\u3089\u9060\u3056\u3051\u308b\u305f\u3081\u306b\u3001\u5c5e\u6027\u3092\u5bfe\u6570\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>2,211\uff080.4\uff05\uff09\u306e\u653b\u6483\uff08\u5916\u308c\u5024\uff09\u3092\u542b\u307f\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3053\u308c\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\u80fd\u306a.mat\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001scipy.io.loadmat\u3067\u306f\u7c21\u5358\u306b\u8aad\u3081\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u3001mat7.3\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092\u6709\u52b9\u306aPython\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u9069\u5207\u306b\u8aad\u307f\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>pandas\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u5909\u63db\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u4f7f\u7528\u3057\u305f\u306e\u3068\u540c\u69d8\u306e\u95a2\u6570\u3092\u4f7f\u3063\u3066GridDB\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u305d\u306e\u30b3\u30fc\u30c9\u306e\u4e00\u4f8b\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\n# ...\n\ntry:\n    # Create table\n    cursor.execute(\n        \"\"\"\n        CREATE TABLE IF NOT EXISTS http_traffic(\n            duration FLOAT,\n            src_bytes FLOAT,\n            dst_bytes FLOAT,\n            is_attack INTEGER\n        )\n        \"\"\"\n    )\n\n    # Insert all rows\n    for row in data.itertuples():\n        cursor.execute(\n            \"\"\"\n            INSERT INTO http_traffic (duration, src_bytes, dst_bytes, is_attack)\n            VALUES (?, ?, ?, ?)\n            \"\"\",\n            (\n                row.duration,\n                row.src_bytes,\n                row.dst_bytes,\n                row.is_attack,\n            )\n        )\n    conn.commit()\n\n# ...\n  <\/code><\/pre>\n<\/div>\n<h2>Sklearn\u306b\u3088\u308b\u7570\u5e38\u691c\u77e5<\/h2>\n<p>Sklearn\u306b\u306f\u3001\u6559\u5e2b\u3042\u308a\u3001\u6559\u5e2b\u306a\u3057\u306e\u4e21\u65b9\u306e\u7570\u5e38\u691c\u77e5\u3092\u884c\u3046\u305f\u3081\u306e\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u8c4a\u5bcc\u306a\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u304c\u642d\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001GridDB\u306e\u30c7\u30fc\u30bf\u306b\u9069\u7528\u3067\u304d\u308b\u30c4\u30fc\u30eb\u3068\u3001\u305d\u306e\u9069\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h3>\u6559\u5e2b\u306a\u3057\u306e\u7570\u5e38\u691c\u77e5<\/h3>\n<p>\u30c7\u30fc\u30bf\u306e\u7570\u5e38\u306a\u30d1\u30bf\u30fc\u30f3\u304c\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308b\u304b\u306b\u3064\u3044\u3066\u306e\u4e8b\u524d\u306e\u77e5\u8b58\u304c\u306a\u3044\u9650\u308a\u3001\u5916\u308c\u5024\u3068\u6b63\u5e38\u306a\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3068\u3092\u898b\u5206\u3051\u308b\u306b\u306f\u3001\u6559\u5e2b\u306a\u3057\u7570\u5e38\u691c\u77e5\u6280\u8853\u306b\u983c\u3089\u3056\u308b\u3092\u5f97\u307e\u305b\u3093\u3002<\/p>\n<p>\u6559\u5e2b\u306a\u3057\u7570\u5e38\u691c\u77e5\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u6b63\u5e38\u306a\u52d5\u4f5c\u3092\u6700\u3082\u3088\u304f\u8868\u3059\u78ba\u7387\u5206\u5e03\u3092\u8fd1\u4f3c\u3059\u308b\u3053\u3068\u3067\u6a5f\u80fd\u3057\u307e\u3059\u3002\u3053\u306e\u5206\u5e03\u304b\u3089\u5341\u5206\u306b\u96e2\u308c\u305f\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u6f5c\u5728\u7684\u306a\u7570\u5e38\u5024\u307e\u305f\u306f\u5916\u308c\u5024\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7570\u5e38\u691c\u77e5\u30e2\u30c7\u30eb\u306b\u3088\u3063\u3066\u3001\u4e0a\u8a18\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u65b9\u6cd5\u306f\u7570\u306a\u308a\u307e\u3059\u3002scikit-learn\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u3001\u5bc6\u5ea6\u30d9\u30fc\u30b9\u306e\u7570\u5e38\u691c\u77e5\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3001\u30af\u30e9\u30b9\u30bf\u30d9\u30fc\u30b9\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3001\u30b5\u30dd\u30fc\u30c8\u30d9\u30af\u30bf\u30fc\u30de\u30b7\u30f3\u30e2\u30c7\u30eb\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u6559\u5e2b\u306a\u3057\u306e\u7570\u5e38\u691c\u77e5\u306e\u305f\u3081\u306eSklearn\u30e2\u30c7\u30eb<\/h3>\n<p>\u4e00\u822c\u7684\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u6559\u5e2b\u306a\u3057\u306e<a href=\"https:\/\/scikit-learn.org\/stable\/auto_examples\/miscellaneous\/plot_anomaly_comparison.html#sphx-glr-auto-examples-miscellaneous-plot-anomaly-comparison-py\">scikit-learn\u306b\u304a\u3051\u308b\u7570\u5e38\u691c\u77e5\u30e2\u30c7\u30eb<\/a>\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>NearestNeighbors<\/li>\n<li>LocalOutlierFactor<\/li>\n<li>IsolationForest<\/li>\n<li>EllipticEnvelope<\/li>\n<li>KMeans<\/li>\n<li>DBSCAN<\/li>\n<li>TSNE<\/li>\n<li>OneClassSVM<\/li>\n<\/ul>\n<h3>IsolationForest\u306e\u4f7f\u7528\u4f8b<\/h3>\n<p>\u305d\u308c\u3067\u306f\u3001sklearn\u306eIsolationForest\u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u305f\u3001\u6559\u5e2b\u306a\u3057\u306e\u7570\u5e38\u691c\u77e5\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Isolation Forest\u306f\u3001\u6b63\u5e38\u306a\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u304c\u3069\u306e\u3088\u3046\u306b\u632f\u308b\u821e\u3046\u304b\u3092\u8fd1\u4f3c\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e\u7279\u5b9a\u306e\u5916\u308c\u5024\u3092\u76f4\u63a5\u7279\u5b9a\u3059\u308b\u3053\u3068\u3067\u6a5f\u80fd\u3057\u307e\u3059\u3002\u5916\u308c\u5024\u306f\u7a00\u3067\u3042\u308b\u305f\u3081\u3001\u901a\u5e38\u306e\u30c7\u30fc\u30bf\u306b\u6bd4\u3079\u3066\u5206\u96e2\u306b\u8981\u3059\u308b\u5206\u5272\u6570\u304c\u5c11\u306a\u3044\u306f\u305a\u3060\u3068\u3044\u3046\u8003\u3048\u306b\u57fa\u3065\u304d\u3001\u30a2\u30f3\u30b5\u30f3\u30d6\u30eb\u6cd5\u3092\u7528\u3044\u3066\u89b3\u6e2c\u5024\u3092\u5206\u96e2\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5916\u308c\u5024\u306f\u6728\u306e\u6839\u306b\u8fd1\u3044\u3068\u3053\u308d\u306b\u914d\u7f6e\u3055\u308c\u3001\u305d\u306e\u7d50\u679c\u3001\u6a2a\u65ad\u3059\u308b\u305f\u3081\u306e\u5e73\u5747\u7d4c\u8def\u9577\u304c\u77ed\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Isolation Forest\u30e2\u30c7\u30eb\u304c\u3069\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u4eba\u5de5\u7684\u306b\u4f5c\u6210\u3055\u308c\u305f\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u306b\u542b\u307e\u308c\u308b\u7570\u5e38\u5024\u3092\u7279\u5b9a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nimport math\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.ensemble import IsolationForest\nfrom utils.helpers.db import get_connection\n  <\/code><\/pre>\n<\/div>\n<p>get_connection()\u95a2\u6570\u306f\u3001.\/utils\/helpers\/db.py\uff08.\/\u306f\u3053\u306eJupyter Notebook\u304c\u3042\u308b\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09\u306b\u4fdd\u5b58\u3057\u305f\u3053\u3068\u3092\u601d\u3044\u51fa\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001GridDB\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u3001power_sensor\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080SQL\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nconn = get_connection()\nsql_stmt = 'SELECT * FROM power_sensor'\nsensor_data = pd.read_sql(sql_stmt, conn)\n  <\/code><\/pre>\n<\/div>\n<p>\u8aad\u307f\u8fbc\u3093\u3060\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nsensor_data.info()\n&lt;class 'pandas.core.frame.DataFrame'>\nRangeIndex: 500 entries, 0 to 499\nData columns (total 2 columns):\n #   Column  Non-Null Count  Dtype  \n---  ------  --------------  -----  \n 0   ts      500 non-null    int64  \n 1   kwh     500 non-null    float64\ndtypes: float64(1), int64(1)\nmemory usage: 7.9 KB\n  <\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306e\u7d50\u679c\u3088\u308a\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3068\u96fb\u529b\u4f7f\u7528\u91cf\u306e\u30c7\u30fc\u30bf\u304c\u3001GridDB \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u6b63\u3057\u3044\u30ab\u30e9\u30e0\u540d\u3068\u30c7\u30fc\u30bf\u30bf\u30a4\u30d7\u3067 DataFrame \u306b\u6b63\u3057\u304f\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u5f8c\u306e\u5206\u6790\u3084\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316\u3092\u5bb9\u6613\u306b\u3059\u308b\u305f\u3081\u306b\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092sensor_data\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">sensor_data.index = pd.to_datetime(sensor_data['ts'], unit='s')<\/code><\/pre>\n<\/div>\n<p>\u3053\u3053\u3067\u306f\u3001kwh\uff08\u96fb\u529b\u4f7f\u7528\u91cf\uff09\u306e\u30c7\u30fc\u30bf\u3092\u3001\u3044\u304f\u3064\u304b\u306e\u8981\u7d04\u7d71\u8a08\u3092\u4f7f\u3063\u3066\u8abf\u3079\u3001\u30e9\u30f3\u30c1\u30e3\u30fc\u30c8\u3068\u30dc\u30c3\u30af\u30b9\u30d7\u30ed\u30c3\u30c8\u3092\u4f7f\u3063\u3066\u3001\u3069\u306e\u3088\u3046\u306b\u5206\u5e03\u3057\u3066\u3044\u308b\u304b\u3092\u628a\u63e1\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nsensor_data.kwh.describe()\n        count    500.000000\n        mean       4.098142\n        std        0.908688\n        min        2.055240\n        25%        3.590052\n        50%        4.024251\n        75%        4.398410\n        max        9.019094\n        Name: kwh, dtype: float64\n  <\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\n# Plot electricity usage\nsensor_data.kwh.plot(\n    figsize=(15, 9),\n    ylim=(0, math.ceil(sensor_data.kwh.max())),\n    xlabel='Time',\n    ylabel='Electricity Usage (kwh)',\n)\n  <\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/output_7_1.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/output_7_1.png\" alt=\"\" width=\"885\" height=\"561\" class=\"aligncenter size-full wp-image-27300\" srcset=\"\/wp-content\/uploads\/2021\/02\/output_7_1.png 885w, \/wp-content\/uploads\/2021\/02\/output_7_1-300x190.png 300w, \/wp-content\/uploads\/2021\/02\/output_7_1-768x487.png 768w, \/wp-content\/uploads\/2021\/02\/output_7_1-600x380.png 600w\" sizes=\"(max-width: 885px) 100vw, 885px\" \/><\/a><\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\n# Generate a box plot\nsensor_data.kwh.plot.box()\n  <\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/output_8_1.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/output_8_1.png\" alt=\"\" width=\"362\" height=\"248\" class=\"aligncenter size-full wp-image-27301\" srcset=\"\/wp-content\/uploads\/2021\/02\/output_8_1.png 362w, \/wp-content\/uploads\/2021\/02\/output_8_1-300x206.png 300w\" sizes=\"(max-width: 362px) 100vw, 362px\" \/><\/a><\/p>\n<p>\u6642\u7cfb\u5217\u30d7\u30ed\u30c3\u30c8\u3067\u306f\u3001\u30b0\u30e9\u30d5\u4e0a\u306e\u3044\u304f\u3064\u304b\u306e\u30e9\u30f3\u30c0\u30e0\u306a\u30dd\u30a4\u30f3\u30c8\u3067\u96fb\u529b\u4f7f\u7528\u91cf\u306e\u6025\u6fc0\u306a\u5897\u52a0\u304c\u898b\u3089\u308c\u3001\u7570\u5e38\u5024\u306e\u53ef\u80fd\u6027\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u7bb1\u3072\u3052\u56f3\u3067\u3082\u3046\u5c11\u3057\u8a73\u3057\u304f\u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u3072\u3052\u306e\u5916\u5074\u306b\u4f4d\u7f6e\u3059\u308b\u30dd\u30a4\u30f3\u30c8\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u3001\u3053\u308c\u3082\u7570\u5e38\u5024\u306e\u53ef\u80fd\u6027\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001Isolation Forest\u30e2\u30c7\u30eb\u3092\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3057\u3066\u3001\u5916\u308c\u5024\u3092\u8b58\u5225\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\n# Reshape the kwh time series into a 500 by 1 array\nkwh = sensor_data.kwh.values.reshape(-1, 1)\n\n# Fit the isolation forest model\nrng = np.random.RandomState(42)\nisolation_forest_clf = IsolationForest(\n    contamination=0.02,\n    max_samples=100,\n    random_state=rng\n)\nisolation_forest_clf.fit(kwh)\noutlier_pred = isolation_forest_clf.predict(kwh)\n  <\/code><\/pre>\n<\/div>\n<p>\u524d\u8ff0\u306e\u30b3\u30fc\u30c9\u30b9\u30cb\u30da\u30c3\u30c8\u3067\u306f\u3001\u5f8c\u3067\u30e2\u30c7\u30eb\u3092\u30d5\u30a3\u30c3\u30c8\u3055\u305b\u308b\u969b\u306b\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u307e\u305akwh\u30b7\u30ea\u30fc\u30ba\u306e\u5217\u3092(500, 1)\u5f62\u72b6\u306enumpy\u914d\u5217\u306b\u5909\u63db\u3057\u307e\u3059\u3002\u6b21\u306b\u3001kwh\u306e\u5024\u306e2%\u304c\u5916\u308c\u5024\u3067\u3042\u308b\u3068\u3044\u3046\u4eee\u5b9a\u306e\u3082\u3068\u3001IsolationForest\u30e2\u30c7\u30eb\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u6b21\u306b\u3001kwh\u914d\u5217\u306e\u5024\u3092\u4f7f\u3063\u3066\u30e2\u30c7\u30eb\u3092\u30d5\u30a3\u30c3\u30c6\u30a3\u30f3\u30b0\u3057\u3001\u6700\u5f8c\u306b\u5b66\u7fd2\u3057\u305f\u30e2\u30c7\u30eb\u3092\u9069\u7528\u3057\u3066\u3001\u3069\u306ekwh\u5024\u304c\u5916\u308c\u5024\u3067\u3001\u3069\u306e\u5024\u304c\u5916\u308c\u5024\u3067\u306a\u3044\u304b\u3092\u4e88\u6e2c\u3057\u307e\u3059\u3002<\/p>\n<p>IsolationForest\u30e2\u30c7\u30eb\u306epredict()\u30e1\u30bd\u30c3\u30c9\u306f\u3001-1\u307e\u305f\u306f1\u306e\u3044\u305a\u308c\u304b\u306e\u4e88\u6e2c\u5024\u306e\u914d\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002\u5024\u304c-1\u306e\u5834\u5408\u306f\u89b3\u6e2c\u5024\u304c\u7570\u5e38\u5024\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u30011\u306e\u5834\u5408\u306f\u6b63\u5e38\u306a\u89b3\u6e2c\u5024\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002predict()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u5404\u89b3\u6e2c\u5024\u306e\u7570\u5e38\u5024\u30b9\u30b3\u30a2\u3092\u8a08\u7b97\u3057\u3001\u305d\u306e\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u304c\u7570\u5e38\u5024\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3057\u307e\u3059\u3002<\/p>\n<p>outlier_pred \u914d\u5217\u3092 sensor_data \u306e\u65b0\u3057\u3044\u30ab\u30e9\u30e0\u306b\u683c\u7d0d\u3057\u3001\u3069\u308c\u3060\u3051\u306e\u89b3\u6e2c\u5024\u304c\u7570\u5e38\u5024\u3068\u5224\u5b9a\u3055\u308c\u3001\u3069\u308c\u3060\u3051\u306e\u89b3\u6e2c\u5024\u304c\u6b63\u5e38\u5024\u3068\u5224\u5b9a\u3055\u308c\u305f\u304b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nsensor_data['predicted_outlier'] = outlier_pred\nsensor_data.predicted_outlier.value_counts()\n     1    490\n    -1     10\n    Name: predicted_outlier, dtype: int64\n  <\/code><\/pre>\n<\/div>\n<p>\u4e0a\u306e\u7d50\u679c\u304b\u3089\u3001\u30e2\u30c7\u30eb\u304c10\u500b\u306e\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3092\u5916\u308c\u5024\u3068\u3057\u3066\u5206\u985e\u3057\u3001490\u500b\u306e\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3092\u901a\u5e38\u306e\u89b3\u6e2c\u5024\u3068\u3057\u3066\u5206\u985e\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3069\u306e\u30c7\u30fc\u30bf\u304c\u5916\u308c\u5024\u306a\u306e\u304b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">sensor_data.loc[sensor_data.predicted_outlier == -1, ['kwh', 'predicted_outlier']]<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/Screenshot_3.png\"><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/Screenshot_3.png\" alt=\"\" width=\"465\" height=\"474\" class=\"aligncenter size-full wp-image-27305\" srcset=\"\/wp-content\/uploads\/2021\/02\/Screenshot_3.png 465w, \/wp-content\/uploads\/2021\/02\/Screenshot_3-294x300.png 294w\" sizes=\"(max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<p>\u5b66\u7fd2\u3057\u305f\u30e2\u30c7\u30eb\u306b\u3088\u3063\u3066\u8a08\u7b97\u3055\u308c\u305f\u7570\u5e38\u30b9\u30b3\u30a2\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306b\u3001<a href=\"https:\/\/scikit-learn.org\/stable\/auto_examples\/ensemble\/plot_isolation_forest.html\">scikit-learn\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u3042\u308bIsolationForest\u306e\u4f7f\u7528\u4f8b<\/a>\u3067\u7528\u3044\u3089\u308c\u3066\u3044\u308b\u306e\u3068\u540c\u69d8\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u3068\u308a\u307e\u3059\u3002<a href=\"https:\/\/dzone.com\/articles\/spotting-outliers-with-isolation-forest-using-skle\">Isolation Forest\u306b\u95a2\u3059\u308b\u3053\u3061\u3089\u306e\u8a18\u4e8b<\/a>\u304b\u3089\u30b3\u30fc\u30c9\u3092\u501f\u7528\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u3067\u3001\u7570\u5e38\u30b9\u30b3\u30a2\u306e\u95be\u5024\u3068\u5916\u308c\u5024\u306e\u9818\u57df\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u53ef\u8996\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nplt.plot(xx, anomaly_score, label='Anomaly Score')\nplt.fill_between(\n    xx.T[0],\n    np.min(anomaly_score),\n    np.max(anomaly_score),\n    where=outlier==-1,\n    color='r', \n    alpha=.4,\n    label='outlier region'\n)\nplt.legend()\nplt.ylabel('Anomaly Score')\nplt.xlabel('Electricity Usage (kwh)')\nplt.show();\n  <\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/output_13_0.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/02\/output_13_0.png\" alt=\"\" width=\"400\" height=\"262\" class=\"aligncenter size-full wp-image-27302\" srcset=\"\/wp-content\/uploads\/2021\/02\/output_13_0.png 400w, \/wp-content\/uploads\/2021\/02\/output_13_0-300x197.png 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>\u898b\u3066\u306e\u901a\u308a\u3001\u8a13\u7df4\u3055\u308c\u305fIsolation Forest\u30e2\u30c7\u30eb\u306f\u3001\u4eba\u5de5\u7684\u306a\u30c7\u30fc\u30bf\u751f\u6210\u624b\u9806\u3067\u4f5c\u6210\u3057\u305f\u5916\u308c\u5024\u306e\u3059\u3079\u3066\u3092\u6b63\u3057\u304f\u8b58\u5225\u3057\u307e\u3059\u3002\u3057\u304b\u3057\u3053\u308c\u306b\u306f\u91cd\u8981\u306a\u6ce8\u610f\u70b9\u304c\u3042\u308a\u3001\u89b3\u6e2c\u3057\u305f\u30c7\u30fc\u30bf\u306e\u4f55\u30d1\u30fc\u30bb\u30f3\u30c8\u304c\u5b9f\u969b\u306b\u5916\u308c\u5024\u3067\u3042\u308b\u304b\u3092\u4e8b\u524d\u306b\u77e5\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>\u6559\u5e2b\u3042\u308a\u306e\u7570\u5e38\u691c\u77e5<\/h3>\n<p>\u89e3\u6790\u5bfe\u8c61\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u3001\u3069\u306e\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u304c\u7570\u5e38\u5024\u3067\u3001\u3069\u306e\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u304c\u6b63\u5e38\u5024\u3067\u3042\u308b\u304b\u3092\u793a\u3059\u30e9\u30d9\u30eb\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u7570\u5e38\u5024\u691c\u51fa\u30d7\u30ed\u30bb\u30b9\u306f\u5206\u985e\u6280\u8853\u306b\u4f9d\u5b58\u3059\u308b\u3002\u6559\u5e2b\u3042\u308a\u5206\u985e\u30e2\u30c7\u30eb\u306f\u3001\u7279\u5fb4\u3068\u30e9\u30d9\u30eb\u306e\u9593\u306e\u95a2\u4fc2\u3092\u8b58\u5225\u3059\u308b\u3053\u3068\u3067\u3001\u7570\u5e38\u5024\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30e2\u30c7\u30eb\u304c\u3053\u308c\u3089\u306e\u95a2\u4fc2\u3092\u6b63\u3057\u304f\u5b66\u7fd2\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5916\u308c\u5024\u306e\u5341\u5206\u306a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u542b\u3080\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u5b66\u7fd2\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u3082\u3068\u3082\u3068\u5916\u308c\u5024\u306f\u5c11\u306a\u3044\u50be\u5411\u306b\u3042\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u30d0\u30e9\u30f3\u30b9\u304c\u60aa\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u30a2\u30f3\u30d0\u30e9\u30f3\u30b9\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306f\u5b66\u7fd2\u6642\u306b\u5916\u308c\u5024\u304c\u904e\u5c0f\u8a55\u4fa1\u3055\u308c\u3001\u305d\u306e\u7d50\u679c\u3068\u3057\u3066\u30e2\u30c7\u30eb\u306e\u7570\u5e38\u5024\u691c\u51fa\u306e\u7cbe\u5ea6\u304c\u4f4e\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<h3>\u6559\u5e2b\u3042\u308a\u7570\u5e38\u691c\u77e5\u306e\u305f\u3081\u306eSklearn\u30e2\u30c7\u30eb<\/h3>\n<p>\u6559\u5e2b\u3042\u308a\u7570\u5e38\u691c\u77e5\u306e\u305f\u3081\u306b\u3088\u304f\u77e5\u3089\u308c\u305fscikit-learn\u30e2\u30c7\u30eb\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>KNeighborsClassifier<\/li>\n<li>SVC (SVM classifier)<\/li>\n<li>DecisionTreeClassifier<\/li>\n<li>RandomForestClassifier<\/li>\n<\/ul>\n<h3>RandomForestClassifier\u306e\u4f7f\u7528\u4f8b<\/h3>\n<p>scikit-learn\u306eRandomForestClassifier\u3092\u4f7f\u3063\u3066HTTP\u653b\u6483\u3092\u8b58\u5225\u3059\u308b\u7570\u5e38\u691c\u77e5\u30e2\u30c7\u30eb\u3092\u5b66\u7fd2\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u306f\u3001\u4e0a\u8a18\u3067\u7d39\u4ecb\u3057\u305f http (KDDCUP99) \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u6559\u5e2b\u3042\u308a\u5206\u985e\u30bf\u30b9\u30af\u306e\u305f\u3081\u306b\u3001scikit-learn\u30e9\u30a4\u30d6\u30e9\u30ea\u304b\u3089\u8ffd\u52a0\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u95a2\u6570\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import classification_report, confusion_matrix\nfrom sklearn.model_selection import train_test_split\n  <\/code><\/pre>\n<\/div>\n<p>\u6559\u5e2b\u306a\u3057\u306e\u7570\u5e38\u691c\u77e5\u306e\u4f8b\u3068\u540c\u69d8\u306b\u3001GridDB \u63a5\u7d9a\u3092\u4f7f\u7528\u3057\u3066 http_traffic \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nsql_stmt = 'SELECT * FROM http_traffic'\nhttp_request_data = pd.read_sql(sql_stmt, conn)\n  <\/code><\/pre>\n<\/div>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u5168\u4f53\u50cf\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\n&lt;class 'pandas.core.frame.DataFrame'>\nRangeIndex: 567498 entries, 0 to 567497\nData columns (total 4 columns):\n#   Column     Non-Null Count   Dtype  \n---  ------     --------------   -----  \n 0   duration   567498 non-null  float64\n 1   src_bytes  567498 non-null  float64\n 2   dst_bytes  567498 non-null  float64\n 3   is_attack  567498 non-null  int64  \ndtypes: float64(3), int64(1)\nmemory usage: 17.3 MB\n  <\/code><\/pre>\n<\/div>\n<p>duration, src_bytes, dst_bytes\u3092\u7279\u5fb4\u91cf\u3068\u3057\u3001is_attack\u306b\u306f\u30e9\u30d9\u30eb\uff08\u901a\u5e38\u306eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u306f0\uff0cHTTP\u653b\u6483\u306b\u306f1\uff09\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u542b\u307e\u308c\u308bHTTP\u653b\u6483\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u6570\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nhttp_request_data.is_attack.value_counts()\n    0    565287\n    1      2211\n    Name: is_attack, dtype: int64\n  <\/code><\/pre>\n<\/div>\n<p>\u3053\u3053\u3067\u30e9\u30d9\u30eb\u4ed8\u3051\u3055\u308c\u305f\u5916\u308c\u5024\u306f\u5408\u8a082,211\u500b\u3067\u3001\u5168\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u306e\u7d040.4%\u306b\u3042\u305f\u308a\u307e\u3059\u3002<\/p>\n<p>\u5404\u5c5e\u6027\u306e\u5024\u3092\u30e9\u30d9\u30eb\u306b\u5fdc\u3058\u3066\u5206\u985e\u3057\u305f\u7bb1\u3072\u3052\u56f3\u3067\u53ef\u8996\u5316\u3059\u308b\u3068\u3001\u8208\u5473\u6df1\u3044\u30d1\u30bf\u30fc\u30f3\u304c\u898b\u3048\u3066\u304d\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nhttp_request_data.boxplot(\n    column=['duration', 'src_bytes', 'dst_bytes'],\n    by='is_attack',\n    figsize=(12, 8),\n    layout=(3, 1)\n)\n  <\/code><\/pre>\n<\/div>\n<p><!--IMG Here--><\/p>\n<p>\u5916\u308c\u5024\u3068\u975e\u5916\u308c\u5024\u3092\u6bd4\u8f03\u3059\u308b\u3068\u30013\u3064\u306e\u7279\u5fb4\u305d\u308c\u305e\u308c\u306e\u5024\u306e\u5e83\u304c\u308a\u65b9\u306b\u660e\u78ba\u306a\u9055\u3044\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001\u30e2\u30c7\u30eb\u30d5\u30a3\u30c3\u30c6\u30a3\u30f3\u30b0\u306e\u305f\u3081\u306b\u30c7\u30fc\u30bf\u3092\u6e96\u5099\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30bb\u30c3\u30c8\u3068\u30c6\u30b9\u30c8\u30bb\u30c3\u30c8\u306b\u5206\u3051\u307e\u3059\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nrng = np.random.RandomState(42)\n\nfeature_cols = ['duration', 'src_bytes', 'dst_bytes']\nfeatures = http_request_data[feature_cols]\nlabels = http_request_data['is_attack']\n\nfeatures_train, features_test, labels_train, labels_test = train_test_split(\n    features,\n    labels,\n    stratify=labels,\n    test_size=0.05,\n    random_state=rng\n)\n  <\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u3067\u306f\u3001stratify\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u30e9\u30d9\u30eb\u306e\u5024\u3092\u6e21\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5916\u308c\u5024\u30af\u30e9\u30b9\u3068\u975e\u5916\u308c\u5024\u30af\u30e9\u30b9\u306e\u5272\u5408\u304c\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3068\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u4e21\u65b9\u3067\u540c\u3058\u306b\u306a\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001\u30e2\u30c7\u30eb\u3092\u30d5\u30a3\u30c3\u30c8\u3055\u305b\u3066\u4e88\u6e2c\u5024\u3092\u51fa\u3059\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nrandom_forest_clf = RandomForestClassifier(n_jobs=4, random_state=rng)\nrandom_forest_clf.fit(features_train, labels_train)\nlabels_pred = random_forest_clf.predict(features_test)\n  <\/code><\/pre>\n<\/div>\n<p>\u8a13\u7df4\u3055\u308c\u305f\u30e2\u30c7\u30eb\u306e\u6027\u80fd\u3092\u3001\u6df7\u540c\u884c\u5217\u3068\u5206\u985e\u30ec\u30dd\u30fc\u30c8\u3092\u898b\u3066\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-python\">\nprint(confusion_matrix(labels_test, labels_pred))\n[[28264     0]\n [    0   111]]\nprint(classification_report(labels_test, labels_pred))\n              precision    recall  f1-score   support\n\n           0       1.00      1.00      1.00     28264\n           1       1.00      1.00      1.00       111\n\n    accuracy                           1.00     28375\n   macro avg       1.00      1.00      1.00     28375\nweighted avg       1.00      1.00      1.00     28375\n  <\/code><\/pre>\n<\/div>\n<p>\u7d50\u679c\u306f\u3001\u5b66\u7fd2\u3057\u305f\u30e2\u30c7\u30eb\u304c\u5916\u308c\u5024\u3068\u975e\u5916\u308c\u5024\u3092\u8b58\u5225\u3059\u308b\u306e\u306b\u975e\u5e38\u306b\u826f\u3044\u4ed5\u4e8b\u3092\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u307e\u305f\u3001\u7cbe\u5ea6\u3001\u518d\u73fe\u7387\u3001f1\u30b9\u30b3\u30a2\u3082\u975e\u5e38\u306b\u9ad8\u3044\u5024\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u6559\u5e2b\u306a\u3057\u306e\u7570\u5e38\u691c\u77e5\u306e\u4f8b\u3068\u540c\u69d8\u306b\u3001\u3053\u306e\u6570\u5024\u3092\u3059\u3050\u306b\u53d7\u3051\u5165\u308c\u308b\u3053\u3068\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u306f\u3001\u30aa\u30fc\u30d0\u30fc\u30d5\u30a3\u30c3\u30c6\u30a3\u30f3\u30b0\u306e\u53ef\u80fd\u6027\u3084\u5225\u306e\u554f\u984c\u3092\u793a\u3057\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u73fe\u5b9f\u7684\u306a\u72b6\u6cc1\u3067\u306f\u3001\u3053\u308c\u306f\u3088\u308a\u6df1\u3044\u5206\u6790\u306e\u4e00\u90e8\u306b\u904e\u304e\u307e\u305b\u3093\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u306f\u3001\u7570\u5e38\u691c\u77e5\u3092\u884c\u3046\u305f\u3081\u306bscikit-learn\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30c4\u30fc\u30eb\u306e\u6982\u8981\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u307e\u305f\u3001\u6559\u5e2b\u3042\u308a\u3001\u6559\u5e2b\u306a\u3057\u306e\u7570\u5e38\u691c\u77e5\u306e\u4f7f\u7528\u4f8b\u3092\u7528\u3044\u3066\u3001sklearn\u30d9\u30fc\u30b9\u306e\u6a5f\u68b0\u5b66\u7fd2\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066GridDB\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3067\u3001sklearn\u306e\u7570\u5e38\u691c\u77e5\u6a5f\u80fd\u3092\u3055\u3089\u306b\u63a2\u6c42\u3059\u308b\u305f\u3081\u306e\u6e96\u5099\u304c\u6574\u3063\u305f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"source-code\">\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h3>\n<p>\u672c\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f<a href=\"https:\/\/github.com\/griddbnet\/Blogs\/tree\/main\/Detecting%20Anomalies%20from%20Data%20in%20GridDB%20with%20Python%20Sklearn\"> GitHub <\/a>\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u7570\u5e38\u691c\u77e5\u306f\u3001\u73fe\u4ee3\u306e\u30b7\u30b9\u30c6\u30e0\u304c\u5186\u6ed1\u304b\u3064\u5b89\u5168\u306b\u7a3c\u50cd\u3059\u308b\u305f\u3081\u306b\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u304a\u308a\u3001\u4e0d\u6b63\u691c [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":49206,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1005],"tags":[],"class_list":["post-50733","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1005"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\" \/>\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\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-03T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-14T15:54:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2021\/02\/output_7_1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"885\" \/>\n\t<meta property=\"og:image:height\" content=\"561\" \/>\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\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b\",\"datePublished\":\"2021-03-03T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\"},\"wordCount\":156,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/02\/output_7_1.png\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\",\"url\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\",\"name\":\"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2021\/02\/output_7_1.png\",\"datePublished\":\"2021-03-03T08:00:00+00:00\",\"dateModified\":\"2025-11-14T15:54:28+00:00\",\"description\":\"\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2021\/02\/output_7_1.png\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/02\/output_7_1.png\",\"width\":885,\"height\":561},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b | GridDB: Open Source Time Series Database for IoT","description":"\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002","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\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/","og_locale":"ja_JP","og_type":"article","og_title":"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b | GridDB: Open Source Time Series Database for IoT","og_description":"\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002","og_url":"https:\/\/griddb.net\/ja\/\u672a\u5206\u985e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-03-03T08:00:00+00:00","article_modified_time":"2025-11-14T15:54:28+00:00","og_image":[{"width":885,"height":561,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2021\/02\/output_7_1.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\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b","datePublished":"2021-03-03T08:00:00+00:00","dateModified":"2025-11-14T15:54:28+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/"},"wordCount":156,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/02\/output_7_1.png","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/","url":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/","name":"Python Sklearn\u3092\u4f7f\u3063\u3066GridDB\u306e\u30c7\u30fc\u30bf\u304b\u3089\u7570\u5e38\u5024\u3092\u691c\u51fa\u3059\u308b | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2021\/02\/output_7_1.png","datePublished":"2021-03-03T08:00:00+00:00","dateModified":"2025-11-14T15:54:28+00:00","description":"\u306f\u3058\u3081\u306b \u30aa\u30f3\u30e9\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u7570\u5e38\u306a\u30ed\u30b0\u30a4\u30f3\u3092\u77e5\u3089\u305b\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u305f\u3073\u306b\u3001\u7570\u5e38\u691c\u77e5\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002","inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/ja\/%e6%9c%aa%e5%88%86%e9%a1%9e\/detecting-anomalies-from-data-in-griddb-with-python-sklearn\/#primaryimage","url":"\/wp-content\/uploads\/2021\/02\/output_7_1.png","contentUrl":"\/wp-content\/uploads\/2021\/02\/output_7_1.png","width":885,"height":561},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts\/50733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/comments?post=50733"}],"version-history":[{"count":1,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts\/50733\/revisions"}],"predecessor-version":[{"id":51570,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/posts\/50733\/revisions\/51570"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/media\/49206"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/media?parent=50733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/categories?post=50733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/ja\/wp-json\/wp\/v2\/tags?post=50733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}