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

The size of the outliers label is too large #74

Closed
choonghyunryu opened this issue Jul 11, 2018 · 9 comments
Closed

The size of the outliers label is too large #74

choonghyunryu opened this issue Jul 11, 2018 · 9 comments

Comments

@choonghyunryu
Copy link

choonghyunryu commented Jul 11, 2018

The size of the label for outliers in the fviz_cluster function is too large.
After performing DBSCAN clustering with the following code, the outliers label is rendered too large in the plot.

trans_usa <- scale(USArrests)

dc <- fpc::dbscan(trans_usa, eps = 1.24ss, MinPts = NCOL(trans_usa) + 1)
fviz_cluster(dc, data= trans_usa)

I can not see any arguments in the help page that change the size of the outliers label.
The version of the factoextra package is 1.0.5.
The operating system is CentOS 7, R 3.4.1 environment

@duttashi
Copy link

duttashi commented Jul 31, 2018

@choonghyunryu use labelsize to control the size of labels. By the way, the minimum reproducible example you posted is not entirely reproducible. The problem in your example is, eps1.24ss where ss in unrecognizable. Removing it, like dc <- fpc::dbscan(trans_usa, eps = 1.24, MinPts = NCOL(trans_usa) + 1) makes your example reproducible.

On R console, type `help("fviz_cluster") to see the usage.

Try the following,

trans_usa <- scale(USArrests)
dc <- fpc::dbscan(trans_usa, eps = 1.24, MinPts = NCOL(trans_usa) + 1)
fviz_cluster(dc, data= trans_usa, labelsize = 2)

@choonghyunryu
Copy link
Author

@duttashi Thank you for your kind answer.
I'am sorry. eps1.24ss was the wrong typing.

I used the labelsize argument.
However, if you use the labelsize argument to change the size of the label of the outliers (excluded from the cluster) to a smaller size, the labels of the other observations contained in the cluster do not seem very small.

Is there any way to a smaller size of the outlier label and make the labels of other observations visible?

@duttashi
Copy link

duttashi commented Aug 3, 2018

@choonghyunryu its very difficult for me to understand what you've written.
"However, if you use the labelsize argument to change the size of the label of the outliers (excluded from the cluster) to a smaller size, the labels of the other observations contained in the cluster do not seem very small. Is there any way to a smaller size of the outlier label and make the labels of other observations visible?"
Please provide a minimum reprex of what you are looking for.

@choonghyunryu
Copy link
Author

@duttashi Sorry. I am not fluent in English and communicate using a translate application.
In the visualization of the result below, the size of the label within the polygon is too small.
I hope that the values of the labelsize argument are common to labels outside of polygons and polygons.

trans_usa <- scale(USArrests)
dc <- fpc::dbscan(trans_usa, eps = 1.24, MinPts = NCOL(trans_usa) + 1)
fviz_cluster(dc, data= trans_usa, labelsize = 2)

@duttashi
Copy link

duttashi commented Aug 5, 2018

@choonghyunryu the size of the label within the polygon can be adjusted. Did you even try to see the signature for fviz_cluster() which specifies the labelsize argument? I think not.

So if you change the value in labelsize from 2 to say 8 or 10, the fontsize changes accordingly.

library(factoextra)
trans_usa <- scale(USArrests)
dc <- fpc::dbscan(trans_usa, eps = 1.24, MinPts = NCOL(trans_usa) + 1)
fviz_cluster(dc, data= trans_usa, labelsize = 8)

And why should the size of outlier label and the label for other objects within or outside the polygon should be the same? If the font size for the outlier label is the same as the font size for a non-outlier label than distinguishing outlier from non-outlier will be difficult. And this will obviate the entire purpose of visualizing outliers.

@choonghyunryu
Copy link
Author

@duttashi Thank you for your quick response.
I wanted to distinguish between outliers and cluster observations, but not too big an outlier label.
Thank you for your suggestion.

kassambara added a commit that referenced this issue Aug 5, 2018
@kassambara
Copy link
Owner

Thank you @duttashi for your input.

Fixed now, new arguments outlier.pointsize and outlier.labelsize added in fviz_cluster() to customize outliers detected with DBSCAN.

You need to install the latest developmental version of factoextra from Github

@duttashi
Copy link

duttashi commented Aug 5, 2018

@kassambara and @choonghyunryu 👍

@choonghyunryu
Copy link
Author

Thank you @kassambara and @duttashi

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