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

Creation of an abstract class to regroup the distance related methods. #5

Open
BananaCancer opened this issue Jun 2, 2023 · 1 comment
Assignees

Comments

@BananaCancer
Copy link
Collaborator

BananaCancer commented Jun 2, 2023

As of now, the HclustParam class, has 2 slots (metric and dist.fun) that are distance related. These slots are used in

  • The show method.
  • The clusterRows method, where the slots are used to call dist.fun with the metric parameter.

The idea of this abstract class would be to have these two slots so that none of the classes that inherits from it would have to declare them. This class would also handle the show method so that the sub-classes don't have to. It could have a constructor that handles the slots (if a slot is NULL: call standard `dist``). Finally, this class could have a method that gives the distance matrix.

Here is a little diagram to illustrate the concept.
UML diagram

The drawback of this idea is that the inheriting classes need to use the distance matrices. And I haven't found another class in bluster that uses it. At start, I thought this could help improve the maintainability of the code, but if we can't find other clustering method that use this, it may be of no use.

So as a sum up this class would be useful to any class that uses a distance matrix. The idea would be that these classes would inherit from the abstract class but maybe there are other possibilities.

What do you think?

@TuomasBorman
Copy link

As you said, the idea is good if there is more than one method utilizing this general class. Otherwise, I think this just adds little bit more complexity. --> we can leave this issue open, and implement it when we find use-cases.

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

No branches or pull requests

3 participants