Skip to content

Commit

Permalink
show an additional graph
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk-asert committed Jul 1, 2024
1 parent c3b02b2 commit fd7ab8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion subprojects/Iris/src/main/groovy/KNN_TablesawSmile.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ table = table.addColumns(StringColumn.create('Result', predictions.indexed().col
actual == predicted ? predicted : "$predicted/$actual".toString() }))

def title = 'Petal width vs length with predicted[/actual] class'
helper.show(ScatterPlot.create(title, table, 'Petal width', 'Petal length', 'Result'), 'KNNClassification')
helper.show(ScatterPlot.create(title, table, 'Petal width', 'Petal length', 'Result'), 'KNNClassification_petal')
title = 'Sepal width vs length with predicted[/actual] class'
helper.show(ScatterPlot.create(title, table, 'Sepal width', 'Sepal length', 'Result'), 'KNNClassification_sepal')

// use cross validation to get accuracy
CrossValidation.classification(10, featureCols, classes, (x, y) -> KNN.fit(x, y, 3)).with {
Expand Down

0 comments on commit fd7ab8c

Please sign in to comment.