"Gamma Linear Regression - Do RapidMiner support this function?"

archique
New Altair Community Member
Hi All,
I want to perform cross validation of linear regression, but in my case, my data do not support linear regression. I need to use Gamma Log Linear Regression. Could you please suggest which modelling function should I use? I have tried Linear Regression but when I compare the results using SPSS, it shows a big different.
Thanks,
Shahida
I want to perform cross validation of linear regression, but in my case, my data do not support linear regression. I need to use Gamma Log Linear Regression. Could you please suggest which modelling function should I use? I have tried Linear Regression but when I compare the results using SPSS, it shows a big different.
Thanks,
Shahida
Tagged:
0
Answers
-
That I know there is no such operator in Rapidminer.
What would I do? I would do it in R. I'm thinking of
glm(count ~ x1+x2+x3, data=mydata, family=poisson())
If you still want to do a lot of computations in RapidMiner I would use "Execute R Script".
Here's a process (the dataset warpbreaks comes with R)<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.5.002">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.5.002" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" breakpoints="after" class="retrieve" compatibility="6.5.002" expanded="true" height="60" name="Read Warpbreaks" width="90" x="45" y="30">
<parameter key="repository_entry" value="//Clases/data/warpbreaks"/>
<description align="center" color="blue" colored="true" width="126">Read Warpbreaks Dataset</description>
</operator>
<operator activated="true" class="split_data" compatibility="6.5.002" expanded="true" height="94" name="Split Data" width="90" x="246" y="30">
<enumeration key="partitions">
<parameter key="ratio" value="0.75"/>
<parameter key="ratio" value="0.25"/>
</enumeration>
<description align="center" color="purple" colored="true" width="126">Split the data in a training and a test set</description>
</operator>
<operator activated="true" class="r_scripting:execute_r" compatibility="6.5.000" expanded="true" height="76" name="Learn Model" width="90" x="514" y="30">
<parameter key="script" value="# train a Poisson model on the training data and return the learned model rm_main = function(data) { 	PoissonModel <- lm(formula =breaks ~ . , data =data,family=poisson()) 	return(PoissonModel) } "/>
<description align="center" color="red" colored="true" width="126">Train a Poisson model in R and return it as an R object</description>
</operator>
<operator activated="true" class="r_scripting:execute_r" compatibility="6.5.000" expanded="true" height="94" name="Apply R Model" width="90" x="648" y="210">
<parameter key="script" value="## load the trained model and apply it on the test data rm_main = function(model, data) { # apply the model and build a prediction result <-predict(model, data) # add the prediction to the example set data$prediction <- result # update the meta data metaData$data$prediction <<- list(type="real", role="prediction") return(data) } "/>
<description align="center" color="red" colored="true" width="126">Apply the trained model on the test data</description>
</operator>
<connect from_op="Read Warpbreaks" from_port="output" to_op="Split Data" to_port="example set"/>
<connect from_op="Split Data" from_port="partition 1" to_op="Learn Model" to_port="input 1"/>
<connect from_op="Split Data" from_port="partition 2" to_op="Apply R Model" to_port="input 2"/>
<connect from_op="Learn Model" from_port="output 1" to_op="Apply R Model" to_port="input 1"/>
<connect from_op="Apply R Model" from_port="output 1" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>0