September 2017
Beginner to intermediate
304 pages
7h 2m
English
Circling back to our loan dataset for a final time, we are going to use github.com/sjwhitworth/golearn to solve the same loan acceptance problem with Naive bayes. We will utilize the same training and test sets that we used in the logistic regression example. However, we need to convert the labels in the datasets to a binary classifier format used in github.com/sjwhitworth/golearn. We can write a simple function to perform this conversion:
// convertToBinary utilizes built in golearn functionality to // convert our labels to a binary label format. func convertToBinary(src base.FixedDataGrid) base.FixedDataGrid { b := filters.NewBinaryConvertFilter() attrs := base.NonClassAttributes(src) for _, a := range attrs { b.AddAttribute(a) ...Read now
Unlock full access