-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Changes from 2 commits
4786b02
8862afd
9102f5a
647ad43
1727a1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include <shogun/labels/DenseLabels.h> | ||
#include <shogun/labels/RegressionLabels.h> | ||
#include <shogun/mathematics/linalg/LinalgNamespace.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary or was implicit include? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary |
||
|
||
using namespace shogun; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: fix indentation of this block to rest of the function? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do autoformat once this works, thx |
||
linalg::matrix_prod(feats_matrix, labels, y); | ||
auto labels = regression_labels(m_labels); | ||
linalg::matrix_prod(feats_matrix, labels->get_labels(), y); | ||
|
||
auto decomposition = linalg::cholesky_factor(kernel_matrix); | ||
y = linalg::cholesky_solver(decomposition, y); | ||
auto lab = regression_labels(m_labels)->get_labels(); | ||
auto intercept = linalg::mean(y) - linalg::dot(y, feats->mean<float64_t>()); | ||
set_bias(intercept); | ||
|
||
set_w(y); | ||
return true; | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y