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

kde added #2383

Merged
merged 2 commits into from
Jul 16, 2014
Merged

kde added #2383

merged 2 commits into from
Jul 16, 2014

Conversation

mazumdarparijat
Copy link
Contributor

  • kde using single tree added

@mazumdarparijat
Copy link
Contributor Author

@iglesias Work for you when you are back! haha..

On a serious note now, please have a look at the PR. I have addressed your comments from the previous PR as well. Let me know if I have missed something.

EM_BALLTREE_SINGLE
};

/** @brief This class implements kernel density estimation technique. Kernel density estimation is a non-parametric
Copy link
Collaborator

Choose a reason for hiding this comment

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

"the kernel density estimation technique", or just "implements kernel density estimation".

@iglesias
Copy link
Collaborator

Will continue looking tomorrow from kd-tree and below in the "files changed" tab. Now...ZzzZzz

float64_t min_distsq(bnode_t* node,float64_t* feat, int32_t dim);
float64_t min_dist(bnode_t* node,float64_t* feat, int32_t dim);

/** get min as well max distance of a node from a point
Copy link
Collaborator

Choose a reason for hiding this comment

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

as well as

@mazumdarparijat
Copy link
Contributor Author

@iglesias about inline functions, putting these in implementation files gives me undefined reference error. So, I put these in .h file. Let me try again.

* faster than ball trees at lower dimensions. In case of high dimensional data, ball tree tends to out-perform KD-tree.
* By default, the class used Ball tree.
*/
class CKernelDensity : public CMachine
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, this is a somewhat more important comment as it concerns the design of this class. Did you check whether it makes sense to make KDE a subclass of CDistribution and put it under the distribution directory instead of machine? IIRC, this was the idea I had in mind when we wrote the GSoC project idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iglesias I can move this to CDistribution. In fact, this is a distribution indeed that we are trying to estimate. But, like here, there also I will be using just the train method from the interface. Others I will have to put as SG_NOTIMPLEMENTED?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it make sense for the other [pure] virtuals to be implemented in the KDE class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think not!

@mazumdarparijat
Copy link
Contributor Author

@iglesias updated!

@mazumdarparijat
Copy link
Contributor Author

@iglesias I updated the remaining comments. I also added dual distances which I was working on. Just 2 small methods are added. If you find it difficult to review with this PR, let me know. I can to remove them and then send the update.

@iglesias
Copy link
Collaborator

No problem about the dual distances, as you mentioned, they are simple enough.

Coming back to the inline-ness, I think it is explained here pretty well: http://www.parashift.com/c++-faq/where-to-put-inline-keyword.html. I found really fun to read the NOTE at the bottom :-D

@mazumdarparijat
Copy link
Contributor Author

I could get gigged for my definition-declaration terminology! Eye opener really! ;-)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 4c0b20f on mazumdarparijat:kdensity into a4f8788 on shogun-toolbox:develop.

@mazumdarparijat
Copy link
Contributor Author

@iglesias have a look at the travis make error. I was talking about this error only. For some reason, locally this no longer happens.

@mazumdarparijat
Copy link
Contributor Author

To speed things up a bit, I'm going back to putting the inline code in the header file.
For future reference, the travis error :
../../../src/shogun/libshogun.so.16.1: undefined reference to `shogun::CNbodyTree::add_dim_dist(double)'

../../../src/shogun/libshogun.so.16.1: undefined reference to `shogun::CNbodyTree::actual_dists(double)'

@iglesias
Copy link
Collaborator

Just restarted the build Parijat. Let me know if it works well this time
and I will merge it.

On 16 July 2014 08:37, Parijat Mazumdar notifications@github.com wrote:

To speed things up a bit, I'm going back to putting the inline code in the
header file.
For future reference, the travis error :
../../../src/shogun/libshogun.so.16.1: undefined reference to
`shogun::CNbodyTree::add_dim_dist(double)'

../../../src/shogun/libshogun.so.16.1: undefined reference to
`shogun::CNbodyTree::actual_dists(double)'


Reply to this email directly or view it on GitHub
#2383 (comment)
.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 26f492d on mazumdarparijat:kdensity into a4f8788 on shogun-toolbox:develop.

@mazumdarparijat
Copy link
Contributor Author

@iglesias For some reason travis build is not working on the last commit. It might be waiting in a queue though.

@mazumdarparijat
Copy link
Contributor Author

@iglesias I think this can be merged now. The travis error is unrelated (and appears in all other PRs as well. Something wrong got merged maybe!)

@iglesias
Copy link
Collaborator

Your are right. It seems unrelated to this PR definitely. Merging this one then. Nice one, @mazumdarparijat! Looking forward to seeing the notebook showcasing KDE :-)

iglesias added a commit that referenced this pull request Jul 16, 2014
@iglesias iglesias merged commit 7f90517 into shogun-toolbox:develop Jul 16, 2014
@mazumdarparijat
Copy link
Contributor Author

@iglesias Before the notebook, I have to complete the dual tree algorithm for KDE.

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

3 participants