Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Data Analytics Library
- linear regression- intercept coefficient

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Farzaneh_T_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-03-2017
11:57 AM

621 Views

linear regression- intercept coefficient

Hi there,

I am trying to use Intel DAAL C++ for linear regression. It always return the regression coefficient including the intercept coefficient. I have tried to set the algorithm parameter interceptFlag=false, but it didn't work at all. I have even set the default parameter in the linear_regression_model.h to be false, but still I get the intercept coefficient in the coefficients list.

How can I exclude intercept coefficient?

Many thanks in advance.

Farzaneh

Link Copied

7 Replies

VictoriyaS_F_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-06-2017
02:57 AM

621 Views

Hello Farzaneh,

linear_regression::Model::getBeta() method returns the numeric table of regression coefficients in the following format:

*β _{00}, β_{01}, ..., β_{0p},*

*...*

*β _{k0}, β_{k1}, ..., β_{kp}.*

Where p is the number of features in the data set; k is the number of responses (usually k = 1).

If the algorithm parameter interceptFlag = false is provided, the returned intercept coefficients_{ }*β _{00,... , }β_{k0 }*are equal to zero. But the size of the table of coefficients stays the same.

Could you please check the values of beta coefficients with interceptFlag = false and interceptFlag = true? Normally you should get two different sets of the coefficients.

Best regards,

Victoriya

Farzaneh_T_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-06-2017
08:49 AM

621 Views

Thanks Victoriya! Actually my problem is when I set interceptFlag=False, I get the same results as interceptFlag=True. I have set the flag to be false in the header file, but it didn't help. None of the intercept coefficients are zero. I have compared the result with another regression algorithm. The predictions are the same, but none of the coefficients are matching.

Best,

Farzaneh

VictoriyaS_F_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-07-2017
05:49 AM

621 Views

To reproduce this behavior on our side, could you please provide the additional details:

- What data set do you use? Can you share it or just provide the data sizes?
- What Intel DAAL version do you link with?
- What method of the linear regression algorithm do you use: QR or normal equations?

It would be also great if you share the code that reproduces this behavior.

Thank you,

Victoriya

Farzaneh_T_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-08-2017
08:51 AM

621 Views

Hi Victoriya,

Unfortunately I cannot share my data. It is rather small data set, with 54 examples and 15 features in training set and 16 examples in test set. I use the 2017 version for intel 64 architecture. I used linear regression model with normal equation. I've slightly modified the linear regression header file to set intercept flag false by default.

Thanks,

Farzaneh

VictoriyaS_F_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-14-2017
04:03 AM

621 Views

Hello Farzaneh,

To reproduce the issue on our side I created and ran the test case using the artificial dataset. Both are attached. The test case trains the linear regression model by means of Normal Equations method.

Using this test case I was not able to reproduce the behavior you have described with Intel DAAL 2017 Update 2 on Intel(R) Xeon(R) CPU E5-2680 running Linux* OS (I built the test using dynamic parallel 64 bit version of the library).

Can you please build the example in the same way, run it, and let us know about results you get on your side? Additional information about CPU you use would be helpful.

Meanwhile, on my side I detected another erroneous behavior of the example: the library throws an exception “Failed to solve the system of normal equations” when interceptFlag is set to false.

We will analyze and fix it in one of the next releases of the library.

At the same time, QR method for training of linear regression model runs fine including the case when interceptFlag = false. This method can be used as a workaround on your side.

Best regards,

Victoriya

Farzaneh_T_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-14-2017
10:35 AM

621 Views

Hi Victoriya,

Here's the details of my CPU architecture: Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz.

I have tested again by adding interceptFlag=False, again. As you also mentioned, it doesn't work for the linear regression with normal equation. That's why I tried to fix it in the header file by setting to be false by default.

Thanks,

Farzaneh

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-12-2017
08:45 PM

621 Views

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.