Cluster analysis in R | Finding out Intra and Inter cluster distances and optimum number of clusters

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 111

  • @Guruprasad_A
    @Guruprasad_A  3 роки тому +1

    Check the script in the video description............

  • @hailezibelo7321
    @hailezibelo7321 Місяць тому +1

    Thank you so much for your clear & detailed presentation.
    I really appreciate you!

  • @Guruprasad_A
    @Guruprasad_A  3 роки тому +1

    Hi there, don't hesitate to ask your doubts here....... Feel free to ask me.

  • @PlantBreeding_is_my_passion
    @PlantBreeding_is_my_passion 7 місяців тому

    Excellent information, thanks for explaining every step very clearly

  • @s.praveenmscvegetablescien1632

    very useful lecture sir, thanks

  • @aberaseboka2456
    @aberaseboka2456 3 роки тому +2

    It is more informative Sir thank you more!.

  • @priyankaparihar2217
    @priyankaparihar2217 11 місяців тому +1

    Thank you. this is very helpful

  • @babitabhatt6469
    @babitabhatt6469 6 місяців тому

    hello sir, my design was Augmented 2 with 7 blocks ..210 RILs of sorghum , with 6 checks replicated in each block . In case of this should igo for hierarchical clustering analysis using k means and include adjusted mean of 210 lines for analysis. . am I right s?
    I have to do interpretation on the bases of fodder yield. ..so is their any specification for doing trait wise clustering..
    I have taken quantative traits along with shoot fly associated dead heart percent etc traits ..
    as my RILs are the population of shoot fly susceptible x resistance cross ....
    so how should I proceed for the analysis on diversity for forage sorghum based on my characters ...total 18 characters were taken..... Should I limit my traits according to my objective of interpretation ..or should I subject all the traits ....
    .is for non replicated data non hierarchical clustering Is different from hierarchical ?

    • @Guruprasad_A
      @Guruprasad_A  5 місяців тому

      Send your doubts to my email present in channel about section.

  • @AmitRana-c1y
    @AmitRana-c1y Рік тому

    Which method will be suitable for cluster analysis for 300 treatments/genotypes and how can i represent it using dendrogram or any clustering technique for data visualization.

  • @vikramana7796
    @vikramana7796 9 місяців тому

    Sir i have doubt, how to write multivariate D2 analysis and ward D2 method hierarchical clustering in thesis, they differing in cluster partition.

    • @Guruprasad_A
      @Guruprasad_A  9 місяців тому

      You go with one which suits you. Mostly for diversity studies D2 test is better.

  • @gizawwegayehu6103
    @gizawwegayehu6103 2 місяці тому

    help full video thank you!

  • @bhuvaneshwaris8146
    @bhuvaneshwaris8146 9 місяців тому

    I have loaded corrected means from augmented RCBD.. But one numerical trait is taken as character.. after changing to numeric it is showing values as 'NA' for all genotypes... This unable to proceed with k means .. it is showing error... How to go about..? Kindly help..

    • @Guruprasad_A
      @Guruprasad_A  9 місяців тому

      Check there might be problem in the data what you have entered. There might be double pulstop or a alphabet like o instead of zero.

  • @linuxvegalinuxvega1918
    @linuxvegalinuxvega1918 7 місяців тому

    Very good explanation, the pea.xlsx file can you post it? Did you publish your findings ?

  • @lakshmipriya-sf5mo
    @lakshmipriya-sf5mo 7 днів тому

    can you please make video for circular dendrogram...

  • @JMSBRK
    @JMSBRK 2 роки тому

    The topic was very simple clearly & well explained.
    Your video is now among my go to resources in data science.
    Just a small constructive criticism : You have already added your R code however the dataset you used (pea.xlsx) hasn't been included.
    Thus, your script won't work without it & it may have no use for people who wishes to try practice themselves.
    So, that would be much better if you include the excel file as well, imho.
    But overall fantastic tutorial & very helpful for rookies
    👍

  • @mukeshdhadhich2733
    @mukeshdhadhich2733 6 місяців тому

    After calculating d sq distance according to privious video.
    Then according to this video number of cluster is different how we can solve this. Please respond

    • @Guruprasad_A
      @Guruprasad_A  6 місяців тому

      You won't get similar results stick to one method.

  • @samrathbaghel9026
    @samrathbaghel9026 Рік тому

    Hi I did clustering using ward.d , and got 5 optimal number of clusters but in cluster mean it is giving mean for only 4 clusters .,why

    • @Guruprasad_A
      @Guruprasad_A  Рік тому

      I hope there might be a problem while selecting number of clusters object, in case of that you can manual calculate the average by adding one more extra column alongside of treatments indicating which cluster they belong, later sort them and get the average using MSExcel.

  • @sandipbohara9534
    @sandipbohara9534 9 місяців тому

    sir,how to make the circular cluster dendrogram

  • @zeruyimer3764
    @zeruyimer3764 3 роки тому +1

    Thanks more for sharing the video. If possible can you show an other video on Prep-design and lattice design (i.e. simple and triple lattice) data analysis ? Thank you...

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      You are welcome Zeru, you can check the recent video on Agricultural statistical tools which is uploaded recently in my data analysis playlist you may find what you're looking for in STAR app manual.

  • @gpb100percent_bkpraveen
    @gpb100percent_bkpraveen 2 роки тому

    Nicely explained

  • @revanthsrirangaraju8863
    @revanthsrirangaraju8863 3 роки тому +1

    I wanted to perform hierarchical clustering for my data which has 4k observations,
    I have applied 'NbClust' with smaller number of clusters i.e 2 - 9, and it throws this error -
    " Error in plot.new() : figure margins too large "

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому +1

      Try to adjust the number of clusters in between 1 to 15 or so..

    • @revanthsrirangaraju8863
      @revanthsrirangaraju8863 3 роки тому +1

      @@Guruprasad_A Sure, I will try that
      Thank you

  • @刺猬带刀
    @刺猬带刀 3 роки тому

    how to understand wss silhouette NbClust giving different clusters number suggestion? which we should believe more?

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      Just look the things given in my video description.

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      NBClust. because it is based on 30 different indices.

  • @bartolodimattia2501
    @bartolodimattia2501 Рік тому

    Amazing, BIG!

  • @samrathbaghel9026
    @samrathbaghel9026 2 роки тому

    Error in t(jeu) %*% jeu :
    requires numeric/complex matrix/vector arguments
    Getting this error while computing the optimum number of clusters using NbClust ...Please help

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому +1

      Does your dataset contain any non numeric variable.

    • @samrathbaghel9026
      @samrathbaghel9026 2 роки тому

      @@Guruprasad_A: no it does not. I am using the adjusted mean data of the augmented RCBD design. I did that analysis using by seeing your video only "augmented RCBD in R".

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому +1

      While importing data check whether all variables in double.

    • @samrathbaghel9026
      @samrathbaghel9026 2 роки тому

      @@Guruprasad_A : Got it fixed, thanks alot for the wonderful video,please share how to extract the analysis report in word format, as you did in previous video.

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому

      It's not possible in this package.

  • @muhiuddinfaruqueeirribd8336
    @muhiuddinfaruqueeirribd8336 8 місяців тому

    When I run NbClust(data=rice.s, diss= NULL, distance= "euclidean", min.nc = 2, max.nc = 15,
    method = "complete", index= "all", alphaBeale = 0.1), then I got the following error:
    Error: division by zero!Error in solve.default(W) : Lapack routine dgesv: system is exactly singular: U[6,6] = 0
    How can I solve this?
    Thank you.

  • @anandjaiswar3929
    @anandjaiswar3929 2 роки тому

    where can i get the pea dataset

  • @rahulm.r2269
    @rahulm.r2269 3 роки тому

    How to get percent contribution of each independent trait on the dependent variable similar to that one used by Tocher's ?

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      stackoverflow.com/questions/62332254/is-there-a-way-to-determine-the-weight-of-different-attributes-used-for-r-cluste

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      Check out the above article on FeatureImpCluster, I think you need to get it from devtools.

  • @anilkhar
    @anilkhar 3 роки тому +1

    When I used NbClust I am getting this message 'Error in NbClust(data = Table.s, diss = NULL, distance = "euclidean", :
    The TSS matrix is indefinite. There must be too many missing values. The index cannot be calculated."
    The silhouette method is given number of clusters as 7

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      stats.stackexchange.com/questions/204760/r-how-to-fix-nbclust-error-with-error-message-the-tss-matrix-is-indefinite?newreg=6dbb3e394e5f40cf8b1e50a16f88ee84

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      Consider 7 only for k means clustering

  • @mahidargowd3432
    @mahidargowd3432 Рік тому

    Can we get label font size clear and small

  • @im_hung9058
    @im_hung9058 3 роки тому

    Hi. I am new to this field. I'am trying to conduct as you illustrated, but I got a pause at clustering with NbClust: Error in NbClust(data = newdata, diss = NULL, distance = "euclidean", :
    The TSS matrix is indefinite. There must be too many missing values. The index cannot be calculated.
    Could you help me?

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому +1

      stackoverflow.com/questions/46067602/the-tss-matrix-is-indefinite-there-must-be-too-many-missing-values-the-index

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      stats.stackexchange.com/questions/204760/r-how-to-fix-nbclust-error-with-error-message-the-tss-matrix-is-indefinite?newreg=6dbb3e394e5f40cf8b1e50a16f88ee84

  • @tinymee589
    @tinymee589 Рік тому

    How we generate output file for all this process ?

    • @Guruprasad_A
      @Guruprasad_A  Рік тому

      sink("output.txt")
      # your code to get the output
      .
      .
      sink()

  • @anoopnehra7298
    @anoopnehra7298 3 роки тому

    hello sir , I'm getting error after running this command:
    NbClust(data = clust.s, diss = NULL, distance = "euclidean", min.nc = 2,
    max.nc =15,method = "kmeans",index = "all",alphaBeale = 0.1)
    error is:
    Error in NbClust(data = clust.s, diss = NULL, distance = "euclidean", :
    The TSS matrix is indefinite. There must be too many missing values. The index cannot be calculated.
    please gives your valuable suggestions regarding this

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому +1

      stackoverflow.com/questions/46067602/the-tss-matrix-is-indefinite-there-must-be-too-many-missing-values-the-index

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому +1

      stats.stackexchange.com/questions/204760/r-how-to-fix-nbclust-error-with-error-message-the-tss-matrix-is-indefinite?newreg=6dbb3e394e5f40cf8b1e50a16f88ee84

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому +1

      Consider silhouette method

  • @charupriyachauhan8654
    @charupriyachauhan8654 3 роки тому

    An error is comming while loading package factoextra : package or namespace load failed for 'ggplot2' in loadnamespace (i, c(lib.loc, .libPaths()), versioncheck = vI[[i]] : namespace 'ellipsis' 0.3 .1 is already loaded , but >= 0.3.2 is required.
    Please provide solution for this

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      Have you already installed ggplot2. If no or already installed, also try installing once again with this command
      Install.packages("ggplot2")

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      After loading ggplot2
      Then load factoextra

    • @charupriyachauhan8654
      @charupriyachauhan8654 3 роки тому +1

      @@Guruprasad_A thanks for guiding....an update was needed

  • @warwan.search
    @warwan.search 2 роки тому

    Can you please do analysis for path and corelation .i am not able to run the program

  • @matinakand8874
    @matinakand8874 2 роки тому

    can i have the code for vertical viewing of this dendrogram

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому

      www.sthda.com/english/wiki/beautiful-dendrogram-visualizations-in-r-5-must-known-methods-unsupervised-machine-learning

  • @deepikachandrasekaran3554
    @deepikachandrasekaran3554 3 роки тому

    Thank you for the video sir. If scaling is only for quantitative trait what could we do for qualitative traits...how to do cluster analysis for qualitative traits?

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому +1

      Most often we won't consider qualitative traits, if you are considering them the clustering will not be good, if you want to that you can do it in SPSS using two step clustering option.

    • @deepikachandrasekaran3554
      @deepikachandrasekaran3554 3 роки тому

      @@Guruprasad_A Ok sir. Thank you for your reply.

  • @anilkhar
    @anilkhar 3 роки тому

    When I am running the NbClust it gives me error Error in solve.default(W) :
    system is computationally singular: reciprocal condition number = 8.06347e-18

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      stackoverflow.com/questions/56160674/how-do-i-fix-nbclust-error-solve-defaultw-in-mtcars-dataset

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      It's because of your data, just ignore this method and if you are looking for the optimum number of cluster for k-means use silhouette method.

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      www.biostars.org/p/407232/

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      If possible try taking out too much correlated data, if you have replication use Tocher method/D2 statistics

    • @anilkhar
      @anilkhar 3 роки тому

      @@Guruprasad_A Yes silhouette method is giving 2 clusters

  • @samrathbaghel9026
    @samrathbaghel9026 Рік тому

    Error in hclust(d, "ward.D") : Invalid clustering method , getting this error

    • @Guruprasad_A
      @Guruprasad_A  Рік тому +1

      try using hclust(dist(data, "ward.D")

  • @deeptitiwari7097
    @deeptitiwari7097 2 роки тому

    When I went to make dendrogram by watching your video, it is saying that figure margins are too large and I m not getting anything in plots.

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому

      Try to export with optimum resolution

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому

      Or do it in any other computer and see.

    • @Guruprasad_A
      @Guruprasad_A  2 роки тому

      stackoverflow.com/questions/23050928/error-in-plot-new-figure-margins-too-large-scatter-plot

  • @rukoochawla9714
    @rukoochawla9714 3 роки тому

    How to fill rectangle and lines with color in hierarchical dendrogram

  • @rakhimahto376
    @rakhimahto376 3 роки тому

    Can you please make video on basics of R...or recommend any source for the same

  • @shivangitare7102
    @shivangitare7102 Рік тому

    in this result where is the genotypes grouping on the basis of clusters

  • @harshinikasturi2983
    @harshinikasturi2983 Рік тому

    Error in solve.default(W) :
    system is computationally singular: reciprocal condition number = 6.36052e-19
    In addition: Warning message:
    In log(det(P)/det(W)) : NaNs produced
    Sir please help with this error.

    • @Guruprasad_A
      @Guruprasad_A  Рік тому

      It's because of too much correlations in your data

    • @sreevandana520
      @sreevandana520 9 місяців тому

      Then how to solve this problem sir​@@Guruprasad_A

  • @minhaoling3056
    @minhaoling3056 3 роки тому

    Dear Sir, I am doing cluster analysis of 40,000 points. I used the efficient hierarchical clustering algorithm and successfully did the clustering. Now I want to choose the optimal no of clusters. Which one would you suggest for dealing with large dataset? Because I need to test from k=1 , … , k=40000, which is huge

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      www.datanovia.com/en/lessons/clara-in-r-clustering-large-applications/

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      ?NbClust
      Pass the above argument in the R script to get more help, where you can understand what you can make out with help of NbClust

    • @minhaoling3056
      @minhaoling3056 3 роки тому

      @@Guruprasad_A hi i tried nbclust, but still its quite slow to compute all one by one.

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      @@minhaoling3056 Try to define a narrow range for the number of clusters in the NbClust function i.e min.nc and max.nc

  • @ikrambashir8604
    @ikrambashir8604 3 роки тому

    > NbClust(data = pea.s, diss =NULL, distance = "euclidean", min.nc = 2, max.nc = 15,
    + method = "kmeans" , index = "all", alphaBeale = 0.1)
    Error in NbClust(data = pea.s, diss = NULL, distance = "euclidean", min.nc = 2, :
    The TSS matrix is indefinite. There must be too many missing values. The index cannot be calculated.
    can you tell me how to overcome this problem???

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      You can use the results from other methods like silhouette.

  • @abc_def789
    @abc_def789 3 роки тому

    Which inter class and intra class cluster should we use?

  • @amalubiju8255
    @amalubiju8255 3 роки тому

    Could you share the data set pls

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      It's my research data, I will share the link once after it's published in Krishikosh by our university. I hope you understand.

  • @drchinmoymishra
    @drchinmoymishra 3 роки тому

    Please share the data file "pea"

    • @Guruprasad_A
      @Guruprasad_A  3 роки тому

      It's my research data sir, I have to wait until it get published in Krishikosh

  • @tejapegada1781
    @tejapegada1781 6 місяців тому

    I have problem with finding clusters!

  • @gpb100percent_bkpraveen
    @gpb100percent_bkpraveen 2 роки тому

    library(cluster)
    library(class)
    library(clv)
    data(faba.s)
    # compute intercluster distances and intracluster diameters
    #kmeans
    kid