You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
567 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "strconv"
  5. )
  6. func main() {
  7. dataset := readDataset("datasets/poker/poker-hand-training-true.data", "\n", ",")
  8. //fmt.Println(dataset)
  9. inputs := readInputs("datasets/prova.data", "\n", ",")
  10. //fmt.Println(inputs)
  11. var datasetDistances [][][]float64
  12. for k, input := range inputs {
  13. datasetDistances = euclideanDistance(dataset, input)
  14. r := getShortestDistance(datasetDistances)
  15. fmt.Println("iteration " + strconv.Itoa(k))
  16. fmt.Println(input)
  17. fmt.Println(r)
  18. fmt.Print("result: ")
  19. fmt.Println(r[1])
  20. fmt.Println("---")
  21. }
  22. }