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

Minor fix of knn's parameter naming for consistency. #4252

Merged
merged 1 commit into from
Apr 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/meta/src/base_api/put_get.sg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KNN knn()
knn.put("m_k", 2)
knn.put("k", 2)
Copy link
Member

Choose a reason for hiding this comment

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

this will break integration tests, so you will need to update the test data file.
See the developing.md readme for details

Copy link
Member

Choose a reason for hiding this comment

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

If it doesnt break the integration tests, then no change is needed ...

Copy link
Member

Choose a reason for hiding this comment

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

actually nevermind. as long as you change all the example code listings, this is not a problem


Kernel k = kernel("GaussianKernel")
k.put("log_width", 2.1)
Expand Down
10 changes: 5 additions & 5 deletions src/shogun/multiclass/KNN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ void CKNN::init()

/* use the method classify_multiply_k to experiment with different values
* of k */
SG_ADD(&m_k, "m_k", "Parameter k", MS_NOT_AVAILABLE);
SG_ADD(&m_q, "m_q", "Parameter q", MS_AVAILABLE);
SG_ADD(&m_num_classes, "m_num_classes", "Number of classes", MS_NOT_AVAILABLE);
SG_ADD(&m_leaf_size, "m_leaf_size", "Leaf size for KDTree", MS_NOT_AVAILABLE);
SG_ADD((machine_int_t*) &m_knn_solver, "m_knn_solver", "Algorithm to solve knn", MS_NOT_AVAILABLE);
SG_ADD(&m_k, "k", "Parameter k", MS_NOT_AVAILABLE);
SG_ADD(&m_q, "q", "Parameter q", MS_AVAILABLE);
SG_ADD(&m_num_classes, "num_classes", "Number of classes", MS_NOT_AVAILABLE);
SG_ADD(&m_leaf_size, "leaf_size", "Leaf size for KDTree", MS_NOT_AVAILABLE);
SG_ADD((machine_int_t*) &m_knn_solver, "knn_solver", "Algorithm to solve knn", MS_NOT_AVAILABLE);
}

CKNN::~CKNN()
Expand Down