예제 #1
0
func q7() {
	bav := biasAndVariance.NewBiasAndVariance()
	bav.LearnConstant()
	fmt.Printf("h(x) = b\n")
	bav.Print()

	bav1 := biasAndVariance.NewBiasAndVariance()
	bav1.ThroughOrigin = false
	bav1.LearnLine()
	fmt.Printf("h(x) = ax + b\n")
	bav1.Print()

	bav2 := biasAndVariance.NewBiasAndVariance()
	bav2.LearnQuadratic()
	fmt.Printf("h(x) = ax^2\n")
	bav2.Print()

	bav3 := biasAndVariance.NewBiasAndVariance()
	bav3.ThroughOrigin = false
	bav3.LearnQuadratic()
	fmt.Printf("h(x) = ax^2\n")
	bav2.Print()
}
예제 #2
0
func q4() {
	bav := biasAndVariance.NewBiasAndVariance()
	bav.LearnLine()
	fmt.Printf("h(x) = ax\n")
	bav.Print()
}