{"id":5473,"date":"2022-04-04T12:15:31","date_gmt":"2022-04-04T03:15:31","guid":{"rendered":"https:\/\/gri.jp\/media\/?p=5473"},"modified":"2023-06-15T08:11:01","modified_gmt":"2023-06-14T23:11:01","slug":"matillion-for-bigquery%e3%81%a8forecastflow%e3%82%92%e9%80%a3%e6%90%ba%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95%e3%80%90%e8%a8%93%e7%b7%b4%e7%b7%a8%e3%80%91%ef%bc%882022%e5%b9%b42%e6%9c%88%e7%89%88","status":"publish","type":"post","link":"https:\/\/gri.jp\/media\/entry\/5473","title":{"rendered":"Matillion for BigQuery\u3068ForecastFlow\u3092\u9023\u643a\u3059\u308b\u65b9\u6cd5\u3010\u8a13\u7df4\u7de8\u3011\uff082022\u5e742\u6708\u7248\uff09"},"content":{"rendered":"<p>\u203b\u6642\u9593\u304c\u306d\u3048\u3001\u65b9\u6cd5\u3060\u3051\u6559\u3048\u3066\u304f\u308c\u3088\u3063\u3066\u65b9\u306f\u672c\u984c\u307e\u3067\u98db\u3093\u3067\u304f\u3060\u3055\u3044<\/p>\n<div id=\"rtoc-mokuji-wrapper\" class=\"rtoc-mokuji-content frame1 animation-fade rtoc_open noto-sans\" data-id=\"5473\">\n<div id=\"rtoc-mokuji-title\" class=\"rtoc_left\"><button class=\"rtoc_open_close rtoc_open\"><\/button><span>\u76ee\u6b21<\/span><\/div>\n<ul class=\"rtoc-mokuji mokuji_none level-1\">\n<li class=\"rtoc-item\"><a href=\"#rtoc-1\">\u80cc\u666f<\/a><\/li>\n<li class=\"rtoc-item\"><a href=\"#rtoc-2\">\u3053\u306e\u8a18\u4e8b\u306e\u4f4d\u7f6e\u4ed8\u3051<\/a><\/li>\n<li class=\"rtoc-item\"><a href=\"#rtoc-3\">\u8a13\u7df4\u7de8\u3068\u4e88\u6e2c\u7de8\u3092\u5206\u5272\u3059\u308b\u306e\u306f\u306a\u305c\u306a\u306e\u304b\uff1f<\/a><\/li>\n<li class=\"rtoc-item\"><a href=\"#rtoc-4\">\u672c\u984c\uff1aMatillion\u3068ForecastFlow\u3092\u9023\u643a\u3059\u308b\uff08\u8a13\u7df4\u7de8\uff09<\/a><\/li>\n<\/ul>\n<\/div>\n<h2 id=\"rtoc-1\" >\u80cc\u666f<\/h2>\n<p>\u7b2c27\u56de\u3059\u3044\u3059\u3044\u4f1a\uff082022\/2\/16\uff09\u3067\u304a\u8a71\u3057\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u305f\u5185\u5bb9\u306e\u88dc\u8db3\u3067\u3059\u3002<\/p>\n<p><iframe loading=\"lazy\" title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\u3000#\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3059\u3044\u3059\u3044\u4f1a\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>\u5f53\u65e5\u306f\u7b2c25\u56de\u3059\u3044\u3059\u3044\u4f1a\u3067\u7d39\u4ecb\u3057\u305f\u300c\u67b6\u7a7a\u306e\u901a\u8ca9\u4f1a\u793e\u306e\u4f11\u7720\u9867\u5ba2\u6398\u308a\u8d77\u3053\u3057\u300d\u3092\u30b1\u30fc\u30b9\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3001Matillion\u3067\u96c6\u7d04\u3057\u305f\u30c7\u30fc\u30bf\u3092\u3069\u3046\u306e\u3088\u3046\u306b\u81ea\u52d5\u6a5f\u68b0\u5b66\u7fd2\u30c4\u30fc\u30eb\uff08ForecastFlow\uff09\u3078\u3068\u9023\u643a\u3059\u308b\u306e\u304b\u3092\u30c7\u30e2\u3068\u3057\u3066\u304a\u898b\u305b\u3044\u305f\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u6642\u9593\u306e\u90fd\u5408\u4e0a\u3001\u500b\u3005\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u306e\u51e6\u7406\u8a73\u7d30\u306f\u3059\u3063\u98db\u3070\u3057\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u6539\u3081\u3066\u3053\u306e\u5834\u3067\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u7b2c25\u56de\u3059\u3044\u3059\u3044\u4f1a\u306e\u8cc7\u6599\u306f<a href=\"https:\/\/gri.jp\/news\/12924\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\uff08\u30b5\u30d6\u30b9\u30af\u578b\u30d3\u30b8\u30cd\u30b9\u306b\u304a\u3051\u308b\u4f11\u7720\u9867\u5ba2\u6398\u308a\u8d77\u3053\u3057\u306b\u5bfe\u3057\u3066\u3001\u306a\u305c\u6a5f\u68b0\u5b66\u7fd2\u304c\u6709\u7528\u306a\u306e\u304b\u304c\u5f0a\u793e\u306e\u7d4c\u9a13\u8ac7\u3092\u4ea4\u3048\u3066\u8a9e\u3089\u308c\u3066\u3044\u307e\u3059\uff09<\/p>\n<p><a href=\"https:\/\/gri.jp\/news\/12924\" target=\"_blank\" rel=\"noopener\">\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3059\u3044\u3059\u3044\u4f1a\u544a\u77e5\u30da\u30fc\u30b8<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"rtoc-2\" >\u3053\u306e\u8a18\u4e8b\u306e\u4f4d\u7f6e\u4ed8\u3051<\/h2>\n<p class=\"p-entry__title\">\u3055\u3066\u3001\u5b9f\u306fForecastFlow\u3068Matillion\uff08Python\uff09\u3092\u9023\u643a\u3055\u305b\u308b\u3084\u308a\u65b9\u306f\u3001\u5f0a\u793e\u5148\u4eba\u306b\u3088\u308b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7d20\u6674\u3089\u3057\u3044\u8a18\u4e8b\u306b\u3088\u3063\u3066\u904e\u53bb\u306b\u3082\u7d39\u4ecb\u3055\u308c\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"p-entry__title\"><a href=\"https:\/\/forecastflow.jp\/datascicene\/report3\/\" target=\"_blank\" rel=\"noopener\">ForecastFlow\u3092Matillion\u304b\u3089\u4f7f\u3046-\u4e88\u6e2c\u7de8<\/a><\/p>\n<p class=\"p-entry__title\"><a href=\"https:\/\/forecastflow.jp\/datascicene\/report4\/\" target=\"_blank\" rel=\"noopener\">Python\u304b\u3089ForecastFlow\u3067\u8a13\u7df4\u3068\u63a8\u8ad6\u3092\u884c\u3046\u65b9\u6cd5<\/a><\/p>\n<p>\u304c\u3001\u5982\u4f55\u305b\u3093\u65e5\u3005\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u7e70\u308a\u8fd4\u3057\u3066\u5f37\u304f\u306a\u3063\u3066\u3044\u308bForecastFlow\u3001\u57f7\u7b46\u5f53\u6642\u306e\u30b3\u30fc\u30c9\u3067\u306f\u52d5\u304b\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3001\u73fe\u6642\u70b9\u3067\u306e\u9023\u643a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u6539\u3081\u3066\u8a18\u8ff0\u3057\u3066\u304a\u3053\u3046\u3068\u601d\u3063\u305f\u6b21\u7b2c\u3067\u3059\u3002<\/p>\n<h2 id=\"rtoc-3\" >\u8a13\u7df4\u7de8\u3068\u4e88\u6e2c\u7de8\u3092\u5206\u5272\u3059\u308b\u306e\u306f\u306a\u305c\u306a\u306e\u304b\uff1f<\/h2>\n<p>\u4e88\u6e2c\u7de8\u3068\u3044\u3063\u3066\u308b\u306e\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u306e\u3053\u3068\u3067\u3059\u306d<\/p>\n<p>https:\/\/gri.jp\/media\/entry\/5495<\/p>\n<p>\u7b2c25\u56de\u30fb\u7b2c27\u56de\u306f\u3082\u3061\u308d\u3093\u3001\u904e\u53bb\u306e\u3059\u3044\u3059\u3044\u4f1a\u3067\u3082\u305f\u3073\u305f\u3073\u3054\u8aac\u660e\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u3066\u304a\u308a\u307e\u3059\u306e\u3067\u3001\u8a73\u7d30\u306f\u5272\u611b\u3055\u305b\u3066\u3044\u305f\u305f\u3060\u304d\u307e\u3059\u304c\u3001\u7406\u7531\u306f\u300c\u76ee\u7684\u304c\u5168\u304f\u9055\u3046\u30b1\u30fc\u30b9\u304c\u591a\u3044\u304b\u3089\u300d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3067\u3059\u3001\u5168\u7136\u9055\u3044\u307e\u3059\u3002\u7570\u4e16\u754c\u98df\u5802\u3068\u76f8\u5e2d\u98df\u5802\u304f\u3089\u3044\u9055\u3044\u307e\u3059\u3002<\/p>\n<p>\u5f93\u3063\u3066\u3001\u305d\u306e\u76ee\u7684\u306e\u9055\u3044\u3092\u30cf\u30c3\u30ad\u30ea\u8a8d\u8b58\u3057\u3064\u3064\u30b3\u30fc\u30c9\u3092\u8ffd\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u8aad\u8005\u306e\u65b9\u3005\u306e\u6df7\u4e71\u3092\u62db\u304b\u306a\u3044\u3088\u3046\u306b\u3001\u8a18\u4e8b\u3092\u5206\u3051\u307e\u3059<br \/>\n\u3061\u306a\u307f\u306b\u3001Python API\u3068\u3057\u3066\u306f\u305d\u3053\u307e\u3067\u5287\u7684\u306b\u5909\u308f\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u975e\u5e38\u306b\u6d17\u7df4\u3055\u308c\u305f\u62bd\u8c61\u5316\u304c\u306a\u3055\u308c\u3066\u3044\u308bForecastFlow API\u306e\u8cdc\u7269\u3067\u3059\u306d\uff08\u3044\u3051\u307e\u305b\u3093\u3001\u3064\u3044\u30b9\u30c6\u30de\u3092\u2026\u2026\u3082\u306f\u3084\u30b9\u30c6\u30eb\u30b9\u3057\u3066\u306a\u3044\u307e\u3067\u3042\u308b\uff09\u3002<\/p>\n<h2 id=\"rtoc-4\" >\u672c\u984c\uff1aMatillion\u3068ForecastFlow\u3092\u9023\u643a\u3059\u308b\uff08\u8a13\u7df4\u7de8\uff09<\/h2>\n<h3>\u5168\u4f53\u50cf<\/h3>\n<p>\u3053\u306e\u8fba\u308a\u306f\u3059\u3044\u3059\u3044\u4f1a\u3068\u305d\u306e\u8cc7\u6599\u3067\u3042\u308b\u7a0b\u5ea6\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3057\u305f\u304c\u3001\u5ff5\u306e\u70ba\u3002<br \/>\n\u5927\u524d\u63d0\u3068\u3057\u3066\u3001Matillion\u3067BigQuery\u306b\u30c7\u30fc\u30bf\u3092\u96c6\u7d04\u3057\u3001ID\u30fb\u30bf\u30fc\u30b2\u30c3\u30c8\u30fb\u7279\u5fb4\u91cf\u30b3\u30df\u30b3\u30df\u306e\u4e00\u679a\u8868\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u307e\u3067\u306f\u5b8c\u4e86\u3057\u3066\u3044\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u5168\u4f53\u50cf\u3068\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002\uff08\uff11\u3068\uff12\u304c\u4eca\u56de\u8aac\u660e\u3059\u308b\u3068\u3053\u308d\uff09<\/p>\n<p>\uff08\uff10\uff09\u30c7\u30fc\u30bf\u53ce\u96c6\u30fb\u4e00\u679a\u8868\u4f5c\u6210<br \/>\n\uff08\uff11\uff09BigQuery\u306e\u4e00\u679a\u8868\u30c6\u30fc\u30d6\u30eb\u3092Cloud Storage\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8<br \/>\n\uff08\uff12\uff09ForecastFlow API\u306b\u3088\u308b\u30e2\u30c7\u30eb\u4f5c\u6210<\/p>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5476 size-large\" src=\"https:\/\/gri.jp\/media\/wp\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-17-12.15.25-1024x264.png\" alt=\"\" width=\"1024\" height=\"264\" \/>\n<p>&nbsp;<\/p>\n<p>\u306a\u304a\u4ee5\u4e0b\u3067\u8aac\u660e\u3059\u308b\u30d5\u30ed\u30fc\u3067\u306fJob Variables\u306a\u3089\u3073\u306b\u3001Environment Variables\u3067\u4ee5\u4e0b\u306e\u5909\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002\u5b9f\u969b\u306b\u52d5\u304b\u3059\u969b\u306f\u3001\u3053\u3053\u3060\u3051\u3054\u81ea\u8eab\u306e\u3082\u306e\u306b\u66f8\u304d\u63db\u3048\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4e2d\u8eab\u81ea\u4f53\u306f\u30b3\u30d4\u30da\u3067\u884c\u3051\u307e\u3059\u3002<\/p>\n<table class=\"cps-table03\" style=\"height: 133px;width: 650px\">\n<tbody>\n<tr style=\"height: 19px\">\n<th style=\"height: 19px;width: 189px;text-align: left\"><span style=\"font-size: 16px\"><strong>\u5909\u6570\u540d<\/strong><\/span><\/th>\n<td class=\"rankinginfo\" style=\"height: 19px;width: 461px;text-align: left\"><span style=\"font-size: 16px\"><strong>\u8aac\u660e<\/strong><\/span><\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"height: 19px;width: 189px;text-align: left\">GCP_PROJECT<\/th>\n<td class=\"rankinginfo\" style=\"height: 19px;width: 461px\">GCP\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d<\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"height: 19px;width: 189px;text-align: left\">BQ_DATASET_ID<\/th>\n<td class=\"rankinginfo\" style=\"height: 19px;width: 461px\">\uff08BigQuery\uff09\u8a13\u7df4\u7528\u30c6\u30fc\u30d6\u30eb\u3092\u683c\u7d0d\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u540d<\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"height: 19px;width: 189px;text-align: left\">BQ_TRAIN_TABLE_NAME<\/th>\n<td class=\"rankinginfo\" style=\"height: 19px;width: 461px\">\uff08BigQuery\uff09\u8a13\u7df4\u7528\u30c6\u30fc\u30d6\u30eb\u540d<\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"width: 189px;text-align: left;height: 19px\">BQ_LOCATION<\/th>\n<td style=\"width: 461px;height: 19px\">\uff08BigQuery\uff09\u8a13\u7df4\u7528\u30c6\u30fc\u30d6\u30eb\u306e\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3<\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"height: 19px;width: 189px;text-align: left\">GCS_BUCKET_NAME<\/th>\n<td class=\"rankinginfo\" style=\"height: 19px;width: 461px\">\uff08Cloud Storage\uff09\u79fb\u884c\u5148\u306e\u30d0\u30b1\u30c3\u30c8\u540d<\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"width: 189px;text-align: left;height: 19px\">GCS_PREFIX<\/th>\n<td style=\"width: 461px;height: 19px\">\uff08Cloud Storage\uff09\u79fb\u884c\u5148\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u968e\u5c64<\/td>\n<\/tr>\n<tr style=\"height: 19px\">\n<th style=\"width: 189px;text-align: left;height: 19px\">FF_EMAIL<\/th>\n<td style=\"width: 461px;height: 19px\">\uff08ForecastFlow\uff09\u30a2\u30ab\u30a6\u30f3\u30c8\u60c5\u5831\uff1a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/td>\n<\/tr>\n<tr>\n<th style=\"width: 189px;text-align: left\">FF_PASSWORD<\/th>\n<td style=\"width: 461px\">\uff08ForecastFlow\uff09\u30a2\u30ab\u30a6\u30f3\u30c8\u60c5\u5831\uff1a\u30d1\u30b9\u30ef\u30fc\u30c9<\/td>\n<\/tr>\n<tr>\n<th style=\"width: 189px;text-align: left\">FF_PROJECT_ID<\/th>\n<td style=\"width: 461px\">\uff08ForecastFlow\uff09\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID<\/td>\n<\/tr>\n<tr>\n<th style=\"width: 189px;text-align: left\">FF_TEAM_ID<\/th>\n<td style=\"width: 461px\">\uff08ForecastFlow\uff09\u30c1\u30fc\u30e0ID<\/td>\n<\/tr>\n<tr>\n<th style=\"width: 189px;text-align: left\">FF_TRAIN_PRIMARY_ID<\/th>\n<td style=\"width: 461px\">\uff08ForecastFlow\uff09\u8a13\u7df4\u7528\u30c6\u30fc\u30d6\u30eb\u306e\u30d7\u30e9\u30a4\u30de\u30ea\u30ad\u30fc\u5217\u540d<\/td>\n<\/tr>\n<tr>\n<th style=\"width: 189px;text-align: left\">FF_TRAIN_TARGET<\/th>\n<td style=\"width: 461px\">\uff08ForecastFlow\uff09\u30e2\u30c7\u30eb\u8a13\u7df4\u6642\u306e\u4e88\u6e2c\u30bf\u30fc\u30b2\u30c3\u30c8\u5217\u540d<\/td>\n<\/tr>\n<tr>\n<th style=\"width: 189px;text-align: left\">FF_TRAIN_TEST_FRAC<\/th>\n<td style=\"width: 461px\">\uff08ForecastFlow\uff09\u30e2\u30c7\u30eb\u8a13\u7df4\u6642\u306b\u691c\u8a3c\u7528\u3078\u3068\u56de\u3059\u884c\u6570\u306e\u5272\u5408<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001ForecastFlow\u306e\u30c1\u30fc\u30e0ID\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID\u306fWeb\u4e0a\u306eURL\u3092\u898b\u308c\u3070\u3059\u3050\u306b\u308f\u304b\u308a\u307e\u3059\u3002xxx\u304c\u30c1\u30fc\u30e0ID\u3001yyy\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID\u3067\u3059<\/p>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5493\" src=\"https:\/\/gri.jp\/media\/wp\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-17-17.22.08.png\" alt=\"\" width=\"768\" height=\"72\" \/>\n<p>&nbsp;<\/p>\n<h3>\uff08\uff11\uff09BigQuery\u306e\u4e00\u679a\u8868\u30c6\u30fc\u30d6\u30eb\u3092Cloud Storage\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8<\/h3>\n<p>\u65e9\u901f\u3067\u3059\u304c\u3001\u30b3\u30fc\u30c9\u306f\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<br \/>\n\u57fa\u672c\u306f<\/p>\n<ul>\n<li>\u79fb\u884c\u5143BQ\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u6307\u5b9a<\/li>\n<li>\u2192\u79fb\u884c\u5148GCS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u6307\u5b9a<\/li>\n<\/ul>\n<p>\u305d\u308c\u3060\u3051\u3067\u3059\u3002\u7c21\u5358\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"language-python\"><code>from google.cloud import bigquery\r\nbq_client = bigquery.Client()\r\n\r\n# BigQuery\u306e\u30c6\u30fc\u30d6\u30eb\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\r\nclass BqTable:\r\n  \r\n  def __init__(self, project, dataset, table_name):\r\n    self.project = project\r\n    self.dataset = dataset\r\n    self.table_name = table_name\r\n    \r\n  def table_ref(self):\r\n    dataset_ref = bigquery.DatasetReference(self.project, self.dataset)\r\n    table_ref = dataset_ref.table(self.table_name)\r\n    return table_ref\r\n  \r\n\r\n# GCS\u306b\u30d5\u30a1\u30a4\u30eb\u51fa\u529b\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\r\nclass GCS:\r\n  \r\n  def __init__(self, bq_client, bucket_name, prefix):\r\n    self.bq_client = bq_client\r\n    self.bucket_name = bucket_name\r\n    self.prefix = prefix\r\n   \r\n  def export_table(self, bq_table, file_name, bq_location):\r\n    destination_uri = f'gs:\/\/{self.bucket_name}\/{self.prefix}\/{file_name}'\r\n    extract_job = self.bq_client.extract_table(bq_table.table_ref(), destination_uri, location=bq_location)\r\n    extract_job.result()\r\n    \r\n    \r\n# \u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092csv\u3067GCS\u306b\u51fa\u529b\r\ntable_to_export = BqTable(GCP_PROJECT, BQ_DATASET_ID, BQ_TRAIN_TABLE_NAME)\r\nGCS(bq_client, GCS_BUCKET_NAME, GCS_PREFIX).export_table(\r\n  table_to_export, BQ_TRAIN_TABLE_NAME + '.csv', BQ_LOCATION\r\n)\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3>\uff08\uff12\uff09ForecastFlow API\u306b\u3088\u308b\u30e2\u30c7\u30eb\u4f5c\u6210<\/h3>\n<p>\u3053\u3061\u3089\u3082\u3061\u3083\u3061\u3083\u3063\u3068\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<br \/>\n\u6d41\u308c\u3060\u3051\u7c21\u5358\u306b\u3055\u3089\u3063\u3066\u304a\u304f\u3068<\/p>\n<ul>\n<li>ForecastFlow\u306e\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u8a8d\u8a3c<\/li>\n<li>\u2192GCS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u3092ForecastFlow\u306b\u9023\u643a<\/li>\n<li>\u2192\u30e2\u30c7\u30eb\u8a13\u7df4\u306e\u8a2d\u5b9a<\/li>\n<li>\u2192\u8a13\u7df4\u5b9f\u884c<\/li>\n<\/ul>\n<p>\u3054\u3061\u3083\u3054\u3061\u3083\u66f8\u3044\u3068\u308a\u307e\u3059\u304c\u3001\u4e2d\u8eab\u3092\u89e3\u304d\u660e\u304b\u3055\u306a\u3044\u3068\u6c17\u304c\u6e08\u307e\u306a\u3044\u305c\u3001\u3063\u3066\u65b9\u4ee5\u5916\u306f\u30b3\u30d4\u30da\u3057\u3066\u3054\u81ea\u8eab\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u60c5\u5831\u3092Job Variables\u306b\u8a2d\u5b9a\u3059\u308c\u3070\u52d5\u304d\u307e\u3059\u3002\u3054\u5b89\u5fc3\u3092\u3002<\/p>\n<pre class=\"language-python\"><code>from google.cloud import storage\r\nfrom forecastflow import User, Project, DataSourceLabel, FileType, ClassifierTrainingSettings\r\nfrom forecastflow.satellite.google.cloud import storage as ff_storage\r\nfrom forecastflow.enums import ClassificationMetrics\r\n\r\n\r\n# ForecastFlow\u306e\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\r\nff_user = User(FF_EMAIL, FF_PASSWORD)\r\nff_project = Project(ff_user, FF_PROJECT_ID, FF_TEAM_ID)\r\n\r\n# \u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092ForecastFlow\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\r\ngcs_client = storage.Client()\r\nuri_import = f'gs:\/\/{GCS_BUCKET_NAME}\/{GCS_PREFIX}\/{BQ_TRAIN_TABLE_NAME+\".csv\"}'\r\ndata_source = ff_storage.import_data_source(\r\n    uri=uri_import,\r\n    project=ff_project,\r\n    name=BQ_TRAIN_TABLE_NAME,\r\n    label=DataSourceLabel.TRAIN,  # \u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306e\u30e9\u30d9\u30eb\r\n    filetype=FileType.CSV, # \u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f [CSV, TSV, PARQUET]\r\n    description=None, # \u8aac\u660e\u6587\uff08\u7701\u7565\u53ef\u80fd\uff09\r\n    skip_profile=False, #\u30c7\u30fc\u30bf\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u304b\u3069\u3046\u304b\r\n    client=gcs_client # GCS\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\r\n)\r\ndata_source.wait_until_done()\r\n\r\n# \u30e2\u30c7\u30eb\u8a13\u7df4\u306e\u8a2d\u5b9a\r\ntraining_settings = ClassifierTrainingSettings(\r\n  FF_TRAIN_TARGET, \r\n  ClassificationMetrics.F1, \r\n  primary_id=FF_TRAIN_PRIMARY_ID\r\n)\r\n\r\n# \u30e2\u30c7\u30eb\u8a13\u7df4\u5b9f\u884c\r\ndata_source.create_model(\r\n  training_settings, \r\n  name=FF_MODEL_NAME, \r\n  test_frac=float(FF_TRAIN_TEST_FRAC)\r\n)\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u3067\u3059\u3001\u3054\u8208\u5473\u304c\u3042\u308b\u65b9\u306f<a href=\"https:\/\/gri.jp\/media\/entry\/5495\/\">\u4e88\u6e2c\u7de8<\/a>\u306b\u304a\u9032\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>https:\/\/gri.jp\/media\/entry\/5495\/<\/p>\n<p>\u672c\u8a18\u4e8b\u306f\u5206\u985e\u554f\u984c\u306e\u6271\u3044\u306b\u95a2\u3057\u3066\u306a\u306e\u3067\u3001\u56de\u5e30\u554f\u984c\u3092\u6271\u3044\u65b9\u306f\u3053\u3061\u3089\u3092\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>https:\/\/gri.jp\/media\/entry\/6121<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u203b\u6642\u9593\u304c\u306d\u3048\u3001\u65b9\u6cd5\u3060\u3051\u6559\u3048\u3066\u304f\u308c\u3088\u3063\u3066\u65b9\u306f\u672c\u984c\u307e\u3067\u98db\u3093\u3067\u304f\u3060\u3055\u3044 \u80cc\u666f \u7b2c27\u56de\u3059\u3044\u3059\u3044\u4f1a\uff082022\/2\/16\uff09\u3067\u304a\u8a71\u3057\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u305f\u5185\u5bb9\u306e\u88dc\u8db3\u3067\u3059\u3002 \u5f53\u65e5\u306f\u7b2c25\u56de\u3059\u3044\u3059\u3044\u4f1a\u3067\u7d39\u4ecb\u3057\u305f\u300c\u67b6\u7a7a\u306e\u901a\u8ca9\u4f1a\u793e\u306e\u4f11\u7720\u9867\u5ba2\u6398\u308a\u8d77<\/p>\n","protected":false},"author":20,"featured_media":1202,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144,83,4,131,121,145],"tags":[],"class_list":["post-5473","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-ai","category-datascience","category-matillion","category-forecastflow","category-suisuikai"],"acf":[],"meta_field":{"_edit_lock":["1686784129:20"],"_edit_last":["20"],"_oembed_b18c4fcc3cf74c25bda663fd4addc406":["{{unknown}}"],"_oembed_1c486477224cd9996febc0c38ee3a0e4":["{{unknown}}"],"hidden_toppage":["0"],"_hidden_toppage":["field_61933136630d2"],"note_url":[""],"_note_url":["field_61243c8278b90"],"_oembed_b7e37abe4319d55106a6b6de0b8c88b9":["{{unknown}}"],"_thumbnail_id":["1202"],"_oembed_171302627ce9cbd4cd224981c66bb528":["{{unknown}}"],"_oembed_32ff9fd3af0a232e6435944f953bb487":["{{unknown}}"],"_oembed_f7f0494c0ab31a6cade7dc58c7204c0a":["{{unknown}}"],"_oembed_d0c84284a4c3e9cc183f3783451c59db":["{{unknown}}"],"_oembed_c637498db37522bb6a45c7ca20996cf2":["{{unknown}}"],"_oembed_477567e8199086f0a0e3995cd137af50":["{{unknown}}"],"_oembed_5beb10ee3884f29a80d100f13d13de29":["{{unknown}}"],"_oembed_bcf03131b10759b39f55a68fe8ecdeec":["{{unknown}}"],"_oembed_2dd7c888d4798308cf6dd7c607396aa6":["{{unknown}}"],"_oembed_915298e6454af08c216b76607ff2a3b8":["{{unknown}}"],"_oembed_03c0d584c6d584e75564872013ea8c03":["{{unknown}}"],"_oembed_1fd7a585730001df6ed34d3caef76399":["{{unknown}}"],"_oembed_1381de13b173393c8de77a1d4eb3b81a":["{{unknown}}"],"_oembed_a02bf79081e9e42d3f79e23e81b9d7da":["{{unknown}}"],"_oembed_d28e12f0352027339dd2a8829414a23d":["{{unknown}}"],"_oembed_0770f88534cd2d9e85fc32280b2b3b82":["{{unknown}}"],"_oembed_10583119fb213f01dcac460f4ab83273":["{{unknown}}"],"_oembed_6a20e2b63744eea2b38d3d4fb70d7024":["<iframe title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\" width=\"690\" height=\"388\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_6a20e2b63744eea2b38d3d4fb70d7024":["1649042006"],"_oembed_c1c3f17ef475dfd1b265426f8b78324c":["<iframe title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\u3000#\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3059\u3044\u3059\u3044\u4f1a\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_c1c3f17ef475dfd1b265426f8b78324c":["1686784264"],"_oembed_15c026dcbeade6c74b3b01064b3bb41e":["{{unknown}}"],"_oembed_284080587a32ecbb1c6cbba5fd7ece13":["{{unknown}}"],"_oembed_ea51b868f322dc80eee275dc8231b639":["<iframe title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\" width=\"715\" height=\"402\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_ea51b868f322dc80eee275dc8231b639":["1649042077"],"_pv_count":["a:24:{i:12;i:49;i:14;i:58;i:15;i:52;i:21;i:38;i:11;i:56;i:16;i:42;i:18;i:57;i:19;i:44;i:10;i:50;i:1;i:65;i:22;i:22;i:2;i:232;i:0;i:39;i:3;i:82;i:9;i:37;i:20;i:35;i:5;i:36;i:7;i:29;i:13;i:45;i:6;i:35;i:23;i:28;i:4;i:44;i:17;i:49;i:8;i:32;}"],"pv_count":["1256"],"_oembed_4f2c7d5c585ad939a6292b260c908ac1":["{{unknown}}"],"_oembed_5eeca9900f0e8ee1a75ac7f2b5230b32":["<iframe title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\" width=\"1385\" height=\"779\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_5eeca9900f0e8ee1a75ac7f2b5230b32":["1649042541"],"_oembed_cd997ea40e4ea7dcf6c355eddd2eef0d":["{{unknown}}"],"_oembed_2d5a7a787144085a21f0a14667840aa7":["{{unknown}}"],"_oembed_b9f862109f4e66047b413060f862ff8a":["{{unknown}}"],"_oembed_82aaf34799fabc5af6424456adfb79f1":["{{unknown}}"],"_oembed_66d5606622e310acc8cbcd01e191d2be":["{{unknown}}"],"_oembed_c2b165930055367da2c3dec12affa245":["{{unknown}}"],"_oembed_3db50c45af5f27d999bd9645b99fba1d":["<iframe title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\u3000#\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3059\u3044\u3059\u3044\u4f1a\" width=\"905\" height=\"509\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_3db50c45af5f27d999bd9645b99fba1d":["1686784212"],"_oembed_532eb90602cebb5777e06cb06265fce5":["{{unknown}}"],"_oembed_a7b24f7e141343889d7eeed51a447563":["{{unknown}}"],"_oembed_72f15b7402232ffd39c6e14468982544":["{{unknown}}"],"_oembed_1bce4d1eb68823572e863a9a45b6a9f5":["<iframe title=\"DX\u3092\u9ad8\u901f\u63a8\u9032\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30a6\u30c9\u30fb\u30c7\u30fc\u30bf\u7d71\u5408\u30c4\u30fc\u30ebMatillion\u306e\u7d39\u4ecb\u3000#\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3059\u3044\u3059\u3044\u4f1a\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/-Mq9f4As6xw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>"],"_oembed_time_1bce4d1eb68823572e863a9a45b6a9f5":["1712155666"],"_oembed_98aa949e3f842e9152d1db6fba0f51d4":["{{unknown}}"],"_oembed_13e3bb8c9fb81dc2e4e76a6e632263d1":["{{unknown}}"],"_oembed_793d3ba1074c2e0491fe81f41eb3c37d":["{{unknown}}"]},"_links":{"self":[{"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/posts\/5473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/comments?post=5473"}],"version-history":[{"count":23,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/posts\/5473\/revisions"}],"predecessor-version":[{"id":29416,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/posts\/5473\/revisions\/29416"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/media\/1202"}],"wp:attachment":[{"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/media?parent=5473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/categories?post=5473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gri.jp\/media\/wp-json\/wp\/v2\/tags?post=5473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}