{"action":"created","issue":{"url":"https://api.github.com/repos/accord-net/framework/issues/57","labels_url":"https://api.github.com/repos/accord-net/framework/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/accord-net/framework/issues/57/comments","events_url":"https://api.github.com/repos/accord-net/framework/issues/57/events","html_url":"https://github.com/accord-net/framework/issues/57","id":55060101,"number":57,"title":"C4.5Learning: tree depends on the sorting order when the desicion variable is continuous","user":{"login":"SivanK","id":7071473,"avatar_url":"https://avatars.githubusercontent.com/u/7071473?v=3","gravatar_id":"","url":"https://api.github.com/users/SivanK","html_url":"https://github.com/SivanK","followers_url":"https://api.github.com/users/SivanK/followers","following_url":"https://api.github.com/users/SivanK/following{/other_user}","gists_url":"https://api.github.com/users/SivanK/gists{/gist_id}","starred_url":"https://api.github.com/users/SivanK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SivanK/subscriptions","organizations_url":"https://api.github.com/users/SivanK/orgs","repos_url":"https://api.github.com/users/SivanK/repos","events_url":"https://api.github.com/users/SivanK/events{/privacy}","received_events_url":"https://api.github.com/users/SivanK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-21T18:48:30Z","updated_at":"2015-02-07T13:46:53Z","closed_at":null,"body":"For DecisionVariableKind=Continuous, candidates for cut values are determined by this code:\r\nif (o[j] != o[j + 1])\r\n     candidates.Add((v[j] + v[j + 1]) / 2.0);\r\n\r\nThe order of the output values are determined by the sorting order of the actual values thus can change for several equal values.\r\nFor example, after sorting:\r\nValues are: 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 24, 24, 26, 26, 28, 29, 30, 30\r\nLabels are: 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1\r\n\r\nCandidates for split in this case are: 2, 2, 2, 3, 3, 3\r\n\r\nAnother option for sorting would be:\r\nValues are: 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 24, 24, 26, 26, 28, 29, 30, 30\r\nLabels are: 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1\r\n(I've just switched the order of two equal values)\r\n\r\nIn that case, although the values are exactly the same, the candidates for split would be: 2, 2, 2, 3, 3, 3, 3, 13.5.\r\n\r\nThis behavior may results in the same decision tree no matter if the values are:\r\n2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 24, 24, 26, 26, 28, 29, 30, 30  OR\r\n2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 240, 240, 260, 260, 280, 290, 300, 300  OR\r\n2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2400, 2400, 2600, 2600, 2800, 2900, 3000, 3000 OR..\r\nSince both the last 3 and the 24 are labeled as 1 (other 3's are labeled as 0)\r\n\r\nAny suggestions on what can be done?\r\n\r\nThanks a lot,\r\nSivan.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/accord-net/framework/issues/comments/73364864","html_url":"https://github.com/accord-net/framework/issues/57#issuecomment-73364864","issue_url":"https://api.github.com/repos/accord-net/framework/issues/57","id":73364864,"user":{"login":"cesarsouza","id":528455,"avatar_url":"https://avatars.githubusercontent.com/u/528455?v=3","gravatar_id":"","url":"https://api.github.com/users/cesarsouza","html_url":"https://github.com/cesarsouza","followers_url":"https://api.github.com/users/cesarsouza/followers","following_url":"https://api.github.com/users/cesarsouza/following{/other_user}","gists_url":"https://api.github.com/users/cesarsouza/gists{/gist_id}","starred_url":"https://api.github.com/users/cesarsouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesarsouza/subscriptions","organizations_url":"https://api.github.com/users/cesarsouza/orgs","repos_url":"https://api.github.com/users/cesarsouza/repos","events_url":"https://api.github.com/users/cesarsouza/events{/privacy}","received_events_url":"https://api.github.com/users/cesarsouza/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T13:46:53Z","updated_at":"2015-02-07T13:46:53Z","body":"Thanks! I have commited the fix and generate a new pre-release NuGet package. It is already available in the NuGet gallery (once you enable the \"Include Prerelease\" in the NuGet dialog).\r\n\r\nHope it helps! If you find any other issues please let me know.\r\n\r\nBest regards,\r\nCesar"}}