<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>cross_hyou</author_name>
  <author_url>https://blog.hatena.ne.jp/cross_hyou/</author_url>
  <blog_title>Rで何かをしたり、読書をするブログ</blog_title>
  <blog_url>https://www.crosshyou.info/</blog_url>
  <categories>
    <anon>データ分析</anon>
  </categories>
  <description>www.crosshyou.info の続きです。前回は glmnet で elastic-lasso でtypeを分類してみました。今回は kknn でk-NN で分類してみます。今回も tidymodels パッケージのワークフローで分類しますので、おおまかな流れは同じです。 まず、レシピ を作成します。 前処理は glmnet のときと同じです。step_zv()だけ追加しました。ゼロ・バリアンスの変数を削除するものですが、実際はゼロ・バリアンスの変数は無いのであってもなくてもおんなじです。 次はモデルを作ります。 nearest_neighbor()関数で、エンジンは kknn です。…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.crosshyou.info%2Fentry%2F2026%2F03%2F20%2F083740&quot; title=&quot;日銀が保有する国債残高のデータの分析5 - Rで機械学習 - tidymodelsでkknnエンジンで分類 - 正解率は92% - Rで何かをしたり、読書をするブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/c/cross_hyou/20260320/20260320075639.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-03-20 08:37:40</published>
  <title>日銀が保有する国債残高のデータの分析5 - Rで機械学習 - tidymodelsでkknnエンジンで分類 - 正解率は92%</title>
  <type>rich</type>
  <url>https://www.crosshyou.info/entry/2026/03/20/083740</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
