Last active
January 28, 2016 19:28
-
-
Save ergo70/eda3453a19b0c1d86683 to your computer and use it in GitHub Desktop.
predict5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION r_predict5(inp integer[]) | |
RETURNS SETOF text AS | |
$BODY$ | |
if (pg.state.firstpass) | |
{ | |
library(e1071) | |
mysvm <- readRDS("mysvm.rds") | |
assign("pg.state.firstpass", FALSE, env=.GlobalEnv) | |
} | |
pred <- predict(mysvm, inp) | |
return (levels(pred)[pred]) | |
$BODY$ | |
LANGUAGE plr IMMUTABLE STRICT | |
COST 100 | |
ROWS 1000; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment