<?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のエンジンでsaralyを推測しました。結果はlmエンジンでの推測よりも少し悪い結果でした。線形モデルでの予測は難しそうなので、別のモデルでやってみようと思います。 k-NN法を使ってみます。 まず、kknnパッケージを読み込みます。 モデルを定義します。 レシピを定義します。 ワークフローを作成します。 クロスバリデーションの設定をします。 ハイパーパラメータのグリッドを作成します。 チューニングを実行します。 最適パラメータの選択 最終モデルを生成します。 predict()関数で、df_testのデータを使っ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.crosshyou.info%2Fentry%2F2025%2F07%2F06%2F101211&quot; title=&quot;賃金構造基本調査のデータ分析 8 - tidymodelsのkknnエンジンでk-NN法による回帰分析。線形モデルよりも良い結果に。 - 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/20250706/20250706093056.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-07-06 10:12:11</published>
  <title>賃金構造基本調査のデータ分析 8 - tidymodelsのkknnエンジンでk-NN法による回帰分析。線形モデルよりも良い結果に。</title>
  <type>rich</type>
  <url>https://www.crosshyou.info/entry/2025/07/06/101211</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
