LoginSignup
0
0

More than 1 year has passed since last update.

【Golang】相関係数の算出

Posted at

概要

Goで相関係数を求める

数理パッケージ

gonumはちょっと用途に合わなかったので、montanaflynn/statsのCorrelation関数を使う

使い方

package main

import "github.com/montanaflynn/stats"

func main() {
    cor, _ := stats.Correlation([]float64{1, 2, 3, 4, 5}, []float64{1, 2, 3, 5, 6})
    fmt.Println(cor)
    // Output: 0.9912407071619302
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0