"Regarding Linear Regression"
maria_godric
New Altair Community Member
Hi,
I have one dependent variable and three independent variables.While fitting a Linear Regression ,it is considering the first independent variable only.Which operator can I use to get a linear regression like Y= a + b1X1 + b2X2 + b3X3.where Y is the dependent and X1,X2,X3 are independent variables.
Thanks
Maria
I have one dependent variable and three independent variables.While fitting a Linear Regression ,it is considering the first independent variable only.Which operator can I use to get a linear regression like Y= a + b1X1 + b2X2 + b3X3.where Y is the dependent and X1,X2,X3 are independent variables.
Thanks
Maria
Tagged:
0
Answers
-
Hi,
you have to define your Y variable as label if not already the case. Therefor you might use the ChangeAttributeRole operator and then apply a linear regression operator. This will give your desired result.
Greetings,
Sebastian0 -
Thanks Sebastain..
I tried it using ChangeAtributeRole but then also it considering 2 independent variables ,But I have 4 independent variables.Here I am attaching the code
<operator name="Root" class="Process" expanded="yes">
<operator name="ExcelExampleSource" class="ExcelExampleSource">
<parameter key="excel_file" value="C:\Documents and Settings\ADMIN\Desktop\data.xls"/>
<parameter key="first_row_as_names" value="true"/>
<parameter key="create_label" value="true"/>
</operator>
<operator name="ChangeAttributeRole" class="ChangeAttributeRole">
<parameter key="name" value="p3price"/>
<parameter key="target_role" value="label"/>
</operator>
<operator name="LinearRegression" class="LinearRegression">
<parameter key="keep_example_set" value="true"/>
</operator>
</operator>
Thanks
Maria0 -
Hi,
if you have already defined the label during loading the data using the ExcelExampleSource (see parameter "label"), you don't need to define it again.
It might be that two of your attributes aren't used for the linear regression, because they don't give any informations about the problem. You might disable the internal feature selection of the linear regression to test if that's the case.
Greetings,
Sebastian0 -
Hi,
In the name parameter tab of ChangeAttributeRole operator, which attribute should be mentioned. I mean label attribute or other attribute.
Thanks,
Maria0 -
Hi Maria,
the ChangeAttributeRole operator works on one single attribute and changes it's role. Since multiple attribute with the same role aren't allowed this is the only sensible thing to do.
So if you want to convert one single attribute to a label, you have to specify the name of this attribute and entering the target role "label".
Greetings,
Sebastian0