Exemple #1
0
func q1() {
	// generalization error:
	var genErr generalizationError.GeneralizationError
	genErr.Dvc = 10
	genErr.SetConfidence(0.95)
	genErr.Epsilon = 0.05

	fmt.Printf("The lower bound for a H with dvc = 10, confidence of 95 percent and epsilon of 0.05 is N = %v\n", genErr.LowerBound())
}
Exemple #2
0
func q3() {
	// generalization error:
	var genErr generalizationError.GeneralizationError
	genErr.Dvc = 50
	genErr.SetDelta(0.05)
	genErr.Epsilon = 0.05
	fmt.Println("For dvc = 50, delta = 0.05, N = 5")
	fmt.Printf("Original VC bound: \t\t\t%7.5f\n", genErr.VCBound(5))
	fmt.Printf("Rademacher Penalty Bound: \t\t%7.5f\n", genErr.RademacherPenaltyBound(5))
	fmt.Printf("Parrondo And Van Den Broek: \t\t%7.5f\n", genErr.ParrondoAndVanDenBroek(5))
	fmt.Printf("Devroye: \t\t\t\t%7.5f\n", genErr.Devroye(5))
}