Advertisement
Guest User

Untitled

a guest
Jul 28th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --          Funcao de distancia                 dataset     epislon  minPts   ObjId, Grupo
  2. dbscan :: ([Double] -> [Double] -> Double) -> [[Double]] -> Double -> Int -> [(Int, Int)]
  3. dbscan dist [] eps minPts = []
  4. dbscan dist dataset eps minPts = zip notNoise minId
  5.     where
  6.         notNoise = [(round . head) k | k <- [ [ head y | x <- coreCords, dist (tail x) (tail y) <= eps ] | y <- dataset], not (null k)]
  7.         minId = [ round (minimum k) | k <- [ [ head x | x <- coreCords, dist (tail x) (tail y) <= eps ] | y <- dataset],  not (null k)]
  8.         coreCords = getCoreCords dist dataset eps minPts
  9.  
  10. expected: [(0,2),(1,2),(2,1),(3,3),(4,2),(7,1),(8,1),(9,3),(10,3),(11,3)]
  11. but got: [(0,4),(1,4),(2,2),(3,11),(4,4),(7,2),(8,2),(9,10),(10,10),(11,10)]
  12.  
  13. -- vou reduzir a dimensão do segundo elemento da tupla, mas pra isso o 3 devia pegar o 10 e n o 11 como menor id de core prox dele, alguem sabe pq ele ta pegando o 11 e n o 10?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement