{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaML/LossFunctions.jl/issues/56","repository_url":"https://api.github.com/repos/JuliaML/LossFunctions.jl","labels_url":"https://api.github.com/repos/JuliaML/LossFunctions.jl/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/JuliaML/LossFunctions.jl/issues/56/comments","events_url":"https://api.github.com/repos/JuliaML/LossFunctions.jl/issues/56/events","html_url":"https://github.com/JuliaML/LossFunctions.jl/issues/56","id":183810388,"number":56,"title":"Handling binary sparse vectors and arrays","user":{"login":"ahwillia","id":636625,"avatar_url":"https://avatars.githubusercontent.com/u/636625?v=3","gravatar_id":"","url":"https://api.github.com/users/ahwillia","html_url":"https://github.com/ahwillia","followers_url":"https://api.github.com/users/ahwillia/followers","following_url":"https://api.github.com/users/ahwillia/following{/other_user}","gists_url":"https://api.github.com/users/ahwillia/gists{/gist_id}","starred_url":"https://api.github.com/users/ahwillia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahwillia/subscriptions","organizations_url":"https://api.github.com/users/ahwillia/orgs","repos_url":"https://api.github.com/users/ahwillia/repos","events_url":"https://api.github.com/users/ahwillia/events{/privacy}","received_events_url":"https://api.github.com/users/ahwillia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-18T21:39:54Z","updated_at":"2016-10-18T22:03:20Z","closed_at":null,"body":"I think there are a lot of issues for handling sparse data. The main one I want to highlight is for sparse binary data we may want to rethink the {+1,-1} encoding convention. Consider applications where you are trying to detect sparse, binary events. Then I think it makes sense for the target to be a sparse vector and for us to interpret the zeros as `-1`s.\r\n\r\n```julia\r\njulia> t = [-1,1.]\r\njulia> t_sparse = sparse([0,1.])\r\njulia> x = randn(2);\r\njulia> value(LogitDistLoss(),t,x)\r\n2-element Array{Float64,1}:\r\n 0.0806863\r\n 0.0330961\r\n\r\njulia> value(LogitDistLoss(),t_sparse,x)\r\n2-element Array{Float64,1}:\r\n 0.0454645\r\n 0.0330961\r\n```\r\n\r\nThere are a variety of efficiencies we could implement in this case as well.\r\n"},"comment":{"url":"https://api.github.com/repos/JuliaML/LossFunctions.jl/issues/comments/254652829","html_url":"https://github.com/JuliaML/LossFunctions.jl/issues/56#issuecomment-254652829","issue_url":"https://api.github.com/repos/JuliaML/LossFunctions.jl/issues/56","id":254652829,"user":{"login":"Evizero","id":10854026,"avatar_url":"https://avatars.githubusercontent.com/u/10854026?v=3","gravatar_id":"","url":"https://api.github.com/users/Evizero","html_url":"https://github.com/Evizero","followers_url":"https://api.github.com/users/Evizero/followers","following_url":"https://api.github.com/users/Evizero/following{/other_user}","gists_url":"https://api.github.com/users/Evizero/gists{/gist_id}","starred_url":"https://api.github.com/users/Evizero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Evizero/subscriptions","organizations_url":"https://api.github.com/users/Evizero/orgs","repos_url":"https://api.github.com/users/Evizero/repos","events_url":"https://api.github.com/users/Evizero/events{/privacy}","received_events_url":"https://api.github.com/users/Evizero/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T22:03:20Z","updated_at":"2016-10-18T22:03:20Z","body":"Well, or.. In MLMetrics I solve this with a optional type parameter. I can say `false_discovery_rate([true,false,true], [1,0,1], CompareMode.FuzzyBinary())` and it tries to infer what is positive or negative on the values themselves (on their own). This should work for us as well without a real performance overhead I think.\r\n\r\nlike `value(LogitMarginLoss(), [1, 0, 1], yhat, CompareMode.FuzzyBinary())`"}}
{"actor":{"display_login":"Evizero"}}