Skip to content

Instantly share code, notes, and snippets.

@ergo70
Created January 28, 2016 07:03
Show Gist options
  • Save ergo70/c5b439eaeb58f7f93d68 to your computer and use it in GitHub Desktop.
Save ergo70/c5b439eaeb58f7f93d68 to your computer and use it in GitHub Desktop.
predict3
CREATE OR REPLACE FUNCTION r_predict3(inp integer)
RETURNS text AS
$BODY$
if (pg.state.firstpass)
{
library(e1071)
mysvm <- readRDS("mysvm.rds")
assign("pg.state.firstpass", FALSE, env=.GlobalEnv)
}
result <- predict(mysvm, inp)
return(as.character(result[1:1]))
$BODY$
LANGUAGE plr IMMUTABLE STRICT
COST 100;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment