<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kj-ki</author_name>
  <author_url>https://blog.hatena.ne.jp/kj-ki/</author_url>
  <blog_title>kj-ki’s blog</blog_title>
  <blog_url>https://kj-ki.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>前回のユークリッド距離に続いて「ピアソン相関によるスコア」です． ピアソン相関の計算 正しくは，ピアソンの積率相関係数というらしいです． 巻末のp.342にある定義をそのまま実装しました． sum_xy(x*yの部分和)を求めるのに，zipで書いてあるところがちょっと分かりにくいかもしれません． なお，sqrtを使うにはMathモジュールが必要です． お忘れなく． require 'mathn' include Math module My class Recommender # # 任意の2人のピアソン相関を算出する # def get_pearson_correlation(critics…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkj-ki.hatenablog.com%2Fentry%2F20080820%2Fp1&quot; title=&quot;Rubyで書くピアソン相関 - kj-ki’s blog&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-08-20 00:00:00</published>
  <title>Rubyで書くピアソン相関</title>
  <type>rich</type>
  <url>https://kj-ki.hatenablog.com/entry/20080820/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
