{"id":442,"date":"2025-01-15T02:33:38","date_gmt":"2025-01-14T17:33:38","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/01\/ai%e3%83%91%e3%83%af%e3%83%bc%e3%83%89%ef%bc%81excel%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e9%9d%a9%e6%96%b0%e7%9a%84%e3%83%9e%e3%82%af%e3%83%ad%e3%83%86%e3%82%af%e3%83%8b\/"},"modified":"2025-01-15T02:33:38","modified_gmt":"2025-01-14T17:33:38","slug":"ai%e3%83%91%e3%83%af%e3%83%bc%e3%83%89%ef%bc%81excel%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e9%9d%a9%e6%96%b0%e7%9a%84%e3%83%9e%e3%82%af%e3%83%ad%e3%83%86%e3%82%af%e3%83%8b","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/01\/ai%e3%83%91%e3%83%af%e3%83%bc%e3%83%89%ef%bc%81excel%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e9%9d%a9%e6%96%b0%e7%9a%84%e3%83%9e%e3%82%af%e3%83%ad%e3%83%86%e3%82%af%e3%83%8b\/","title":{"rendered":"AI\u30d1\u30ef\u30fc\u30c9\uff01Excel\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306e\u9769\u65b0\u7684\u30de\u30af\u30ed\u30c6\u30af\u30cb\u30c3\u30af\uff1a\u696d\u52d9\u52b9\u7387\u5316\u3068\u610f\u601d\u6c7a\u5b9a\u652f\u63f4\u3092\u5287\u7684\u306b\u5411\u4e0a"},"content":{"rendered":"<h2>\u696d\u52d9\u9769\u65b0\uff01\u4e0a\u7d1a\u8005\u5411\u3051AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u9023\u643a\u30de\u30af\u30ed\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n<p>\u4ee5\u4e0b\u306f\u3001Excel\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u3082\u3063\u3068\u697d\u3092\u3057\u305f\u3044\u3001\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u4eba\u304c\u3059\u3050\u306b\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u3067\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nSub AI_DataAnalysis()<br \/>\n    &#8216; AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u3092\u6d3b\u7528\u3057\u305f\u30c7\u30fc\u30bf\u5206\u6790\u30de\u30af\u30ed<br \/>\n    Dim ws As Worksheet<br \/>\n    Set ws = ActiveSheet<\/p>\n<p>    &#8216; \u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406<br \/>\n    Call PreprocessData(ws)<\/p>\n<p>    &#8216; \u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u9069\u7528<br \/>\n    Call ApplyMLModel(ws)<\/p>\n<p>    &#8216; \u7d50\u679c\u306e\u53ef\u8996\u5316<br \/>\n    Call VisualizeResults(ws)<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<h3>1. AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u3068\u306e\u9023\u643a\u306b\u3088\u308b\u30c7\u30fc\u30bf\u5206\u6790\u306e\u81ea\u52d5\u5316<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u3066AI\u3084\u6a5f\u68b0\u5b66\u7fd2\u3068\u9023\u643a\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u5206\u6790\u30d7\u30ed\u30bb\u30b9\u3092\u5927\u5e45\u306b\u81ea\u52d5\u5316\u3067\u304d\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u306f\u3001\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3001\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u9069\u7528\u3001\u7d50\u679c\u306e\u53ef\u8996\u5316\u3068\u3044\u3046\u4e00\u9023\u306e\u6d41\u308c\u3092\u81ea\u52d5\u5316\u3059\u308b\u57fa\u672c\u7684\u306a\u69cb\u9020\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30de\u30af\u30ed\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u696d\u52d9\u3084\u8907\u96d1\u306a\u5206\u6790\u304c\u5fc5\u8981\u306a\u5834\u5408\u3067\u3082\u3001\u30dc\u30bf\u30f31\u3064\u3067\u9ad8\u5ea6\u306a\u5206\u6790\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u9867\u5ba2\u30c7\u30fc\u30bf\u306e\u5206\u985e\u3084\u58f2\u4e0a\u4e88\u6e2c\u306a\u3069\u3001\u3053\u308c\u307e\u3067\u624b\u4f5c\u696d\u3067\u884c\u3063\u3066\u3044\u305f\u5206\u6790\u30bf\u30b9\u30af\u3092\u81ea\u52d5\u5316\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>2. API\u3092\u6d3b\u7528\u3057\u305f\u5916\u90e8\u30b5\u30fc\u30d3\u30b9\u3068\u306e\u9023\u643a<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u4f7f\u3063\u3066\u5916\u90e8\u306eAI\u30b5\u30fc\u30d3\u30b9\u3068\u9023\u643a\u3059\u308b\u3053\u3068\u3067\u3001\u3055\u3089\u306b\u9ad8\u5ea6\u306a\u5206\u6790\u3084\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Microsoft Azure \u3084 Google Cloud Platform \u306a\u3069\u304c\u63d0\u4f9b\u3059\u308b\u6a5f\u68b0\u5b66\u7fd2API\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u753b\u50cf\u8a8d\u8b58\u3084\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u306a\u3069\u306e\u8907\u96d1\u306a\u30bf\u30b9\u30af\u3082Excel\u4e0a\u3067\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001API\u3092\u4f7f\u3063\u3066\u753b\u50cf\u5206\u6790\u3092\u884c\u3046\u30de\u30af\u30ed\u306e\u4e00\u4f8b\u3067\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nSub AnalyzeImage()<br \/>\n    Dim httpRequest As Object<br \/>\n    Set httpRequest = CreateObject(&#8220;MSXML2.ServerXMLHTTP&#8221;)<\/p>\n<p>    &#8216; API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3068\u30ad\u30fc\u3092\u8a2d\u5b9a<br \/>\n    Dim apiUrl As String<br \/>\n    apiUrl = &#8220;https:\/\/api.example.com\/analyze&#8221;<br \/>\n    Dim apiKey As String<br \/>\n    apiKey = &#8220;YOUR_API_KEY&#8221;<\/p>\n<p>    &#8216; \u753b\u50cfURL\u3092\u6307\u5b9a<br \/>\n    Dim imageUrl As String<br \/>\n    imageUrl = ActiveCell.Value<\/p>\n<p>    &#8216; API\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1<br \/>\n    With httpRequest<br \/>\n        .Open &#8220;POST&#8221;, apiUrl, False<br \/>\n        .setRequestHeader &#8220;Content-Type&#8221;, &#8220;application\/json&#8221;<br \/>\n        .setRequestHeader &#8220;Ocp-Apim-Subscription-Key&#8221;, apiKey<br \/>\n        .send &#8220;{&#8220;&#8221;url&#8221;&#8221;:&#8221;&#8221;&#8221; &#038; imageUrl &#038; &#8220;&#8221;&#8221;}&#8221;<br \/>\n    End With<\/p>\n<p>    &#8216; \u7d50\u679c\u3092\u8868\u793a<br \/>\n    MsgBox httpRequest.responseText<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30de\u30af\u30ed\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001Excel\u30b7\u30fc\u30c8\u4e0a\u306e\u753b\u50cfURL\u3092\u5206\u6790\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u5373\u5ea7\u306b\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5546\u54c1\u753b\u50cf\u306e\u81ea\u52d5\u5206\u985e\u3084\u3001\u6587\u66f8\u753b\u50cf\u304b\u3089\u306e\u30c6\u30ad\u30b9\u30c8\u62bd\u51fa\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u696d\u52d9\u52b9\u7387\u5316\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>3. \u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u7d44\u307f\u8fbc\u307f\u3068\u7d99\u7d9a\u7684\u306a\u5b66\u7fd2<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u4f7f\u3063\u3066\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u3092\u76f4\u63a5\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001Python \u306e\u6a5f\u68b0\u5b66\u7fd2\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u547c\u3073\u51fa\u3059\u30de\u30af\u30ed\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3001Excel\u30b7\u30fc\u30c8\u4e0a\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u4e88\u6e2c\u3084\u5206\u985e\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001Python\u306e\u6a5f\u68b0\u5b66\u7fd2\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u547c\u3073\u51fa\u3059\u30de\u30af\u30ed\u306e\u6982\u5ff5\u7684\u306a\u4f8b\u3067\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nSub RunPythonML()<br \/>\n    Dim pyScript As String<br \/>\n    pyScript = &#8220;import pandas as pd&#8221; &#038; vbNewLine &#038; _<br \/>\n               &#8220;from sklearn.model_selection import train_test_split&#8221; &#038; vbNewLine &#038; _<br \/>\n               &#8220;from sklearn.ensemble import RandomForestClassifier&#8221; &#038; vbNewLine &#038; _<br \/>\n               &#8220;# \u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\u3068\u524d\u51e6\u7406&#8221; &#038; vbNewLine &#038; _<br \/>\n               &#8220;# \u30e2\u30c7\u30eb\u306e\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3068\u4e88\u6e2c&#8221; &#038; vbNewLine &#038; _<br \/>\n               &#8220;# \u7d50\u679c\u3092Excel\u306b\u66f8\u304d\u623b\u3059&#8221;<\/p>\n<p>    &#8216; Python\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\uff08\u5b9f\u969b\u306e\u5b9f\u88c5\u306f\u30b7\u30b9\u30c6\u30e0\u74b0\u5883\u306b\u4f9d\u5b58\uff09<br \/>\n    &#8216; RunPythonScript(pyScript)<\/p>\n<p>    MsgBox &#8220;\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u5b9f\u884c\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002&#8221;<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u63a1\u7528\u3059\u308b\u3053\u3068\u3067\u3001Excel\u3092\u5358\u306a\u308b\u30c7\u30fc\u30bf\u5165\u529b\u30c4\u30fc\u30eb\u3067\u306f\u306a\u304f\u3001\u9ad8\u5ea6\u306a\u5206\u6790\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3068\u3057\u3066\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u3055\u3089\u306b\u3001\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u308b\u305f\u3073\u306b\u30e2\u30c7\u30eb\u3092\u518d\u5b66\u7fd2\u3055\u305b\u308b\u3053\u3068\u3067\u3001\u5e38\u306b\u6700\u65b0\u306e\u72b6\u6cc1\u306b\u9069\u5fdc\u3057\u305f\u4e88\u6e2c\u3084\u5206\u6790\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u306e\u3088\u3046\u306b\u3001AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u3068\u9023\u643a\u3057\u305fExcel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u696d\u52d9\u30d7\u30ed\u30bb\u30b9\u3092\u5927\u5e45\u306b\u52b9\u7387\u5316\u3057\u3001\u30c7\u30fc\u30bf\u99c6\u52d5\u578b\u306e\u610f\u601d\u6c7a\u5b9a\u3092\u652f\u63f4\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u9069\u5207\u306b\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001Excel\u3092\u3088\u308a\u5f37\u529b\u306a\u30d3\u30b8\u30cd\u30b9\u30c4\u30fc\u30eb\u3068\u3057\u3066\u6d3b\u7528\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u696d\u52d9\u9769\u65b0\uff01\u4e0a\u7d1a\u8005\u5411\u3051AI\u30fb\u6a5f\u68b0\u5b66\u7fd2\u9023\u643a\u30de\u30af\u30ed\u30c6\u30af\u30cb\u30c3\u30af \u4ee5\u4e0b\u306f\u3001Excel\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u3082\u3063\u3068\u697d\u3092\u3057\u305f\u3044\u3001\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u4eba\u304c\u3059\u3050\u306b\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u3067\u3059\uff1a #8220;`vba Sub AI_DataAn<\/p>\n","protected":false},"author":2,"featured_media":441,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced"],"_links":{"self":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/441"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}