# RapidMiner

## linear regression optimization

SOLVED
Regular Contributor

# linear regression optimization

[ Edited ]

Greeting,

I need to predict thermal expand range from tempreture, and I get a test dataset, so I try the linear regression but the result is not good, my setting and data is like below, can you help me to improve the prediction ? thanks.

#### Attachments

1 ACCEPTED SOLUTION

Accepted Solutions
Elite II
Solution
Accepted by topic author dkpengqiuyang
‎06-06-2017 01:50 AM

## Re: linear regression optimization

[ Edited ]

From looking at the scatter plot of the two variables you get a sense that there are other important predictors missing from this equation. There is non-linearity so you could use other methods instead of plain vanilla linear regression.

Investigate further the physics of the process. I know absolutely nothing and Wikipidea tells me pressure is another important variable.

6 REPLIES
Super Contributor

## Re: linear regression optimization

you can use optimization parameter (grid)operator to get the best parameter for your dataset

Elite II
Solution
Accepted by topic author dkpengqiuyang
‎06-06-2017 01:50 AM

## Re: linear regression optimization

[ Edited ]

From looking at the scatter plot of the two variables you get a sense that there are other important predictors missing from this equation. There is non-linearity so you could use other methods instead of plain vanilla linear regression.

Investigate further the physics of the process. I know absolutely nothing and Wikipidea tells me pressure is another important variable.

Regular Contributor

## Re: linear regression optimization

my friend do the same job with matlab and the result is well fit the test data , but I can not take the same score with rapidminer. I am still confused about this ...

Moderator

## Re: linear regression optimization

Can you post your RapidMiner process? Maybe we can help troubleshoot.

Regular Contributor

## Re: linear regression optimization

hi,

you can see the rm process and operator setting in the attachment above, and the origin data is also there.

I can get a simular output like matlab, when I change the input attribute from "tempreture" to "tempreture change", which means y=kx+b do not work but y=k(x-x1)+b works well in rm, while y=kx+b works well in matlab.

Highlighted
RMStaff

## Re: linear regression optimization

@dkpengqiuyang did you try to delete collinear feature?

Process is attached here.

```<?xml version="1.0" encoding="UTF-8"?><process version="7.6.000">
<operator activated="true" class="retrieve" compatibility="7.6.000" expanded="true" height="68" name="Retrieve regression" width="90" x="45" y="34">
<parameter key="repository_entry" value="//RM YY Local Repository/AAA-PROSPECT/data/regression"/>
</operator>
</process>
<?xml version="1.0" encoding="UTF-8"?><process version="7.6.000">
<operator activated="true" class="set_role" compatibility="7.6.000" expanded="true" height="82" name="Set Role" width="90" x="179" y="34">
<parameter key="attribute_name" value="thermal expand"/>
<parameter key="target_role" value="label"/>
</operator>
</process>
<?xml version="1.0" encoding="UTF-8"?><process version="7.6.000">
<operator activated="true" class="linear_regression" compatibility="7.6.000" expanded="true" height="103" name="Linear Regression" width="90" x="380" y="34">
<parameter key="feature_selection" value="M5 prime"/>
<parameter key="alpha" value="0.05"/>
<parameter key="max_iterations" value="10"/>
<parameter key="forward_alpha" value="0.05"/>
<parameter key="backward_alpha" value="0.05"/>
<parameter key="eliminate_colinear_features" value="false"/>
<parameter key="min_tolerance" value="0.05"/>
<parameter key="use_bias" value="true"/>
<parameter key="ridge" value="1.0E-8"/>
</operator>
</process>
<?xml version="1.0" encoding="UTF-8"?><process version="7.6.000">
<operator activated="true" class="apply_model" compatibility="7.6.000" expanded="true" height="82" name="Apply Model" width="90" x="514" y="34">
<list key="application_parameters"/>
<parameter key="create_view" value="false"/>
</operator>
</process>
```