{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.crosshyou.info%2Fentry%2F2021%2F03%2F28%2F181423\" title=\"SPDR S&amp;P 500 ETF\u306e\u30ea\u30bf\u30fc\u30f3\u3092\u30bb\u30af\u30bf\u30fcSPDR ETF\u306e\u30ea\u30bf\u30fc\u30f3\u3067\u5206\u6790\u3059\u308b\uff16 - R\u8a00\u8a9e\u306eknn3\u95a2\u6570\u3067k-nearest neighbor\u6cd5\u3067\u30ea\u30bf\u30fc\u30f3\u3092\u4e88\u6e2c\u3059\u308b\u3002 - R\u3067\u4f55\u304b\u3092\u3057\u305f\u308a\u3001\u8aad\u66f8\u3092\u3059\u308b\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/cross_hyou/","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/c/cross_hyou/20210328/20210328180243.png","type":"rich","url":"https://www.crosshyou.info/entry/2021/03/28/181423","published":"2021-03-28 18:14:23","author_name":"cross_hyou","blog_url":"https://www.crosshyou.info/","provider_url":"https://hatena.blog","blog_title":"R\u3067\u4f55\u304b\u3092\u3057\u305f\u308a\u3001\u8aad\u66f8\u3092\u3059\u308b\u30d6\u30ed\u30b0","provider_name":"Hatena Blog","title":"SPDR S&P 500 ETF\u306e\u30ea\u30bf\u30fc\u30f3\u3092\u30bb\u30af\u30bf\u30fcSPDR ETF\u306e\u30ea\u30bf\u30fc\u30f3\u3067\u5206\u6790\u3059\u308b\uff16 - R\u8a00\u8a9e\u306eknn3\u95a2\u6570\u3067k-nearest neighbor\u6cd5\u3067\u30ea\u30bf\u30fc\u30f3\u3092\u4e88\u6e2c\u3059\u308b\u3002","categories":["\u30c7\u30fc\u30bf\u5206\u6790"],"width":"100%","version":"1.0","description":"www.crosshyou.info \u4eca\u56de\u306f\u3001R\u8a00\u8a9e\u306eknn3\u95a2\u6570\u3067k-nearest neighbor\u6cd5\u3067SPY\u306e\u30ea\u30bf\u30fc\u30f3\u3092\u4e88\u6e2c\u3057\u3066\u307f\u307e\u3059\u3002 \u3053\u306e\u3088\u3046\u306b\u3001k\u306e\u5024\u30925\u304b\u3089255\u307e\u30675\u305a\u3064\u5897\u3084\u3057\u305f\u6570\u5217\u3068\u3057\u3066\u7528\u610f\u3057\u307e\u3057\u305f\u3002 \u3053\u306e\u3088\u3046\u306bsapply\u95a2\u6570\u306e\u4e2d\u3067\u3001knn3\u95a2\u6570\u3001predict\u95a2\u6570\u3001confusionMatrix\u95a2\u6570\u3092\u3064\u304b\u3063\u3066\u6b63\u89e3\u7387\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002 X\u8ef8\u306b\u3001k, Y\u8ef8\u306b\u6b63\u89e3\u7387\u3092\u3068\u3063\u3066\u30b0\u30e9\u30d5\u3092\u63cf\u3044\u3066\u307f\u307e\u3059\u3002 \u3069\u306ek\u306e\u3068\u304d\u306b\u6b63\u89e3\u7387\u304c\u6700\u9ad8\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u304b\uff1f k = 30 \u306e\u3068\u304d\u306b\u6b63\u89e3\u7387\u304c\u6700\u5927\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u6b63\u89e3\u7387\u306e\u5024\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 0.5789474\u3067\u3059\u3002 \u4eca\u56de\u306f\u4ee5\u4e0a\u3067\u3059\u3002 \u306f\u3058\u3081\u304b\u3089\u8aad\u3080\u306b\u306f\u3001 \u2026","height":"190"}