Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nonsensical CLinearMachine::compute_bias #4381

Merged
merged 5 commits into from Jul 23, 2018

Conversation

karlnapf
Copy link
Member

  • add bias coputation to CLinearRidgeRegression
  • activate bias in LibLinear and LibLinearRegression by default
  • cleanups

* add bias coputation to CLinearRidgeRegression
* activate bias in LibLinear and LibLinearRegression by default
* cleanups
@karlnapf karlnapf force-pushed the feature/no_compute_bias branch 24 times, most recently from 49a111b to ab88ee7 Compare July 21, 2018 18:38
@@ -88,6 +88,10 @@ template<class ST> CFeatures* CDenseFeatures<ST>::duplicate() const
return new CDenseFeatures<ST>(*this);
}

{
return result;
}
Copy link
Collaborator

@iglesias iglesias Jul 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must have slipped through.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y

@@ -1,5 +1,6 @@
#include <shogun/labels/DenseLabels.h>
#include <shogun/labels/RegressionLabels.h>
#include <shogun/mathematics/linalg/LinalgNamespace.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary or was implicit include?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary

@@ -71,11 +71,14 @@ bool CLinearRidgeRegression::train_machine(CFeatures* data)
linalg::matrix_prod(feats_matrix, feats_matrix, kernel_matrix, false, true);
linalg::add_diag(kernel_matrix, tau_vector);

auto labels = ((CRegressionLabels*)m_labels)->get_labels();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: fix indentation of this block to rest of the function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do autoformat once this works, thx

@karlnapf
Copy link
Member Author

@iglesias actually the bias in the previous version was still wrong, I double checked things. Now it should work.
I will also add a way to compute this for D>N for which the current method will fail (covariance matrix doesnt have full rank anymore)

@karlnapf
Copy link
Member Author

Travis times out, but all tests pass locally, merging

@karlnapf karlnapf merged commit 1be1dbb into shogun-toolbox:develop Jul 23, 2018
@karlnapf karlnapf deleted the feature/no_compute_bias branch July 23, 2018 11:07
@iglesias
Copy link
Collaborator

@karlnapf all right. I did not check the implementation of the equations 8-D

ktiefe pushed a commit to ktiefe/shogun that referenced this pull request Jul 30, 2019
* add/correct bias computation to CLinearRidgeRegression
* cleanups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants