Skip to content

Instantly share code, notes, and snippets.

@ergo70
Last active January 28, 2016 19:28
Show Gist options
  • Save ergo70/eda3453a19b0c1d86683 to your computer and use it in GitHub Desktop.
Save ergo70/eda3453a19b0c1d86683 to your computer and use it in GitHub Desktop.
predict5
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