{"action":"created","issue":{"url":"https://api.github.com/repos/accord-net/framework/issues/64","labels_url":"https://api.github.com/repos/accord-net/framework/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/accord-net/framework/issues/64/comments","events_url":"https://api.github.com/repos/accord-net/framework/issues/64/events","html_url":"https://github.com/accord-net/framework/issues/64","id":63827321,"number":64,"title":"Exception in KPCA","user":{"login":"mhusinsky","id":3253299,"avatar_url":"https://avatars.githubusercontent.com/u/3253299?v=3","gravatar_id":"","url":"https://api.github.com/users/mhusinsky","html_url":"https://github.com/mhusinsky","followers_url":"https://api.github.com/users/mhusinsky/followers","following_url":"https://api.github.com/users/mhusinsky/following{/other_user}","gists_url":"https://api.github.com/users/mhusinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/mhusinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhusinsky/subscriptions","organizations_url":"https://api.github.com/users/mhusinsky/orgs","repos_url":"https://api.github.com/users/mhusinsky/repos","events_url":"https://api.github.com/users/mhusinsky/events{/privacy}","received_events_url":"https://api.github.com/users/mhusinsky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-23T20:42:00Z","updated_at":"2015-04-11T09:58:31Z","closed_at":"2015-04-11T09:58:31Z","body":"hello cesar,\r\n\r\nwhen applying a transform to a double[] the Transform function throws an exception. try this adapted code from the documentation using jagged arrays:\r\n\r\n    double[][] sourceMatrix = new double[][]\r\n            {\r\n                new double[] { 2.5,  2.4 },\r\n                new double[] { 0.5,  0.7 },\r\n                new double[] { 2.2,  2.9 },\r\n                new double[] { 1.9,  2.2 },\r\n                new double[] { 3.1,  3.0 },\r\n                new double[] { 2.3,  2.7 },\r\n                new double[] { 2.0,  1.6 },\r\n                new double[] { 1.0,  1.1 },\r\n                new double[] { 1.5,  1.6 },\r\n                new double[] { 1.1,  0.9 }\r\n            };\r\n\r\n            // Create a new linear kernel\r\n            IKernel kernel = new Linear();\r\n\r\n            // Creates the Kernel Principal Component Analysis of the given data\r\n            var kpca = new KernelPrincipalComponentAnalysis(sourceMatrix, kernel);\r\n\r\n            // Compute the Kernel Principal Component Analysis\r\n            kpca.Compute();\r\n\r\n            // The following statement throws an exception:\r\n            // An unhandled exception of type 'System.IndexOutOfRangeException' occurred in Accord.Math.dll\r\n            double[] transformed = kpca.Transform(sourceMatrix[0]);\r\n            \r\nwhen using a plain PrincipalComponentAnalysis everything runs fine as expected. \r\nis this a bug?\r\n\r\nthank you,\r\nmatthias"},"comment":{"url":"https://api.github.com/repos/accord-net/framework/issues/comments/91813558","html_url":"https://github.com/accord-net/framework/issues/64#issuecomment-91813558","issue_url":"https://api.github.com/repos/accord-net/framework/issues/64","id":91813558,"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-04-11T09:58:31Z","updated_at":"2015-04-11T09:58:31Z","body":"Yes, this is the expected behavior. Again, the kpca.Threshold property can be used to cut some of the eigenvectors that don't contribute much to the variance."}}