diff --git a/ensemble/multisvc_test.go b/ensemble/multisvc_test.go index e28f490..66f942e 100644 --- a/ensemble/multisvc_test.go +++ b/ensemble/multisvc_test.go @@ -19,6 +19,7 @@ func TestMultiSVMUnweighted(t *testing.T) { Convey("Predictions should work...", func() { predictions, err := m.Predict(Y) + So(err, ShouldEqual, nil) cf, err := evaluation.GetConfusionMatrix(Y, predictions) So(err, ShouldEqual, nil) So(evaluation.GetAccuracy(cf), ShouldBeGreaterThan, 0.70) @@ -66,6 +67,7 @@ func TestMultiSVMWeighted(t *testing.T) { Convey("Predictions should work...", func() { predictions, err := m.Predict(Y) + So(err, ShouldEqual, nil) cf, err := evaluation.GetConfusionMatrix(Y, predictions) So(err, ShouldEqual, nil) So(evaluation.GetAccuracy(cf), ShouldBeGreaterThan, 0.60) diff --git a/ensemble/randomforest_test.go b/ensemble/randomforest_test.go index 2915ca4..8d599e8 100644 --- a/ensemble/randomforest_test.go +++ b/ensemble/randomforest_test.go @@ -82,6 +82,7 @@ func TestRandomForestSerialization(t *testing.T) { Convey("Saving the model should work...", func() { f, err := ioutil.TempFile(os.TempDir(), "rf") + So(err, ShouldBeNil) err = rf.Save(f.Name()) defer func() { f.Close() diff --git a/linear_models/linearsvc.go b/linear_models/linearsvc.go index 5016218..6166198 100644 --- a/linear_models/linearsvc.go +++ b/linear_models/linearsvc.go @@ -261,6 +261,9 @@ func (lr *LinearSVC) SaveWithPrefix(writer *base.ClassifierSerializer, prefix st } f, err := ioutil.TempFile(os.TempDir(), "liblinear") + if err != nil { + return err + } defer func() { f.Close() }() diff --git a/linear_models/linearsvc_test.go b/linear_models/linearsvc_test.go index 6ccaf12..4f4d8a5 100644 --- a/linear_models/linearsvc_test.go +++ b/linear_models/linearsvc_test.go @@ -60,6 +60,7 @@ func TestLinearSVC(t *testing.T) { So(err, ShouldBeNil) inst, err := base.ParseCSVToInstances("../examples/datasets/iris_headers.csv", true) + So(err, ShouldBeNil) inst.RemoveClassAttribute(inst.AllAttributes()[4]) inst.AddClassAttribute(inst.AllAttributes()[1]) diff --git a/meta/bagging_test.go b/meta/bagging_test.go index 52dbdb1..dbd4001 100644 --- a/meta/bagging_test.go +++ b/meta/bagging_test.go @@ -135,6 +135,7 @@ func TestBaggedModelRandomForestSerialization(t *testing.T) { Convey("Saving the model should be fine...", func() { f, err := ioutil.TempFile(os.TempDir(), "rf") + So(err, ShouldBeNil) defer func() { f.Close() }() diff --git a/meta/one_v_all_test.go b/meta/one_v_all_test.go index 41af071..1b50732 100644 --- a/meta/one_v_all_test.go +++ b/meta/one_v_all_test.go @@ -52,6 +52,7 @@ func TestOneVsAllModel(t *testing.T) { predictions, err := m.Predict(Y) So(err, ShouldEqual, nil) f, err := ioutil.TempFile(os.TempDir(), "tmpCls") + So(err, ShouldBeNil) defer func() { f.Close() }() diff --git a/naive/bernoulli_nb_test.go b/naive/bernoulli_nb_test.go index 0795b8f..c27cf93 100644 --- a/naive/bernoulli_nb_test.go +++ b/naive/bernoulli_nb_test.go @@ -46,6 +46,7 @@ func TestSerialize(t *testing.T) { Convey("Saving the classifer should work...", func() { f, err := ioutil.TempFile(os.TempDir(), "nb") + So(err, ShouldBeNil) defer func() { f.Close() }()