The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Regarding Linear Regression"
maria_godric
Member Posts: 20 Maven
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
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,
Sebastian
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
Maria
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,
Sebastian
In the name parameter tab of ChangeAttributeRole operator, which attribute should be mentioned. I mean label attribute or other attribute.
Thanks,
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,
Sebastian