Determining the Method option that FindClusters uses with AbsoluteOptions












4












$begingroup$


I am trying to determine which method mathematica chooses when using FindClusters. The documentation says that it chooses the best one for the data. I have tried to use AbsoluteOptions, which says it returns the options for a command, but it does not seem to be working.



GaussianRandomData[n_Integer, p_, sigma_] := 
Table[p +
{Re[#], Im[#]}&[RandomReal[NormalDistribution[0, sigma]] E^(I RandomReal[{0, 2 π}])], {n}];
datapairs = BlockRandom[SeedRandom[2134];
Join[
GaussianRandomData[100, {2, 1}, .3],
GaussianRandomData[100, {1, 1.8}, .2],
GaussianRandomData[100, {1, 1.1}, .4],
GaussianRandomData[100, {1.75, 1.75}, 0.1]]];

AbsoluteOptions[FindClusters[datapairs, Method -> Automatic], Method]


Any help would be appreciated.










share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$












  • $begingroup$
    You might be interested to know you can replace {Re[#], Im[#]}& with ReIm
    $endgroup$
    – m_goldberg
    58 mins ago
















4












$begingroup$


I am trying to determine which method mathematica chooses when using FindClusters. The documentation says that it chooses the best one for the data. I have tried to use AbsoluteOptions, which says it returns the options for a command, but it does not seem to be working.



GaussianRandomData[n_Integer, p_, sigma_] := 
Table[p +
{Re[#], Im[#]}&[RandomReal[NormalDistribution[0, sigma]] E^(I RandomReal[{0, 2 π}])], {n}];
datapairs = BlockRandom[SeedRandom[2134];
Join[
GaussianRandomData[100, {2, 1}, .3],
GaussianRandomData[100, {1, 1.8}, .2],
GaussianRandomData[100, {1, 1.1}, .4],
GaussianRandomData[100, {1.75, 1.75}, 0.1]]];

AbsoluteOptions[FindClusters[datapairs, Method -> Automatic], Method]


Any help would be appreciated.










share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$












  • $begingroup$
    You might be interested to know you can replace {Re[#], Im[#]}& with ReIm
    $endgroup$
    – m_goldberg
    58 mins ago














4












4








4


1



$begingroup$


I am trying to determine which method mathematica chooses when using FindClusters. The documentation says that it chooses the best one for the data. I have tried to use AbsoluteOptions, which says it returns the options for a command, but it does not seem to be working.



GaussianRandomData[n_Integer, p_, sigma_] := 
Table[p +
{Re[#], Im[#]}&[RandomReal[NormalDistribution[0, sigma]] E^(I RandomReal[{0, 2 π}])], {n}];
datapairs = BlockRandom[SeedRandom[2134];
Join[
GaussianRandomData[100, {2, 1}, .3],
GaussianRandomData[100, {1, 1.8}, .2],
GaussianRandomData[100, {1, 1.1}, .4],
GaussianRandomData[100, {1.75, 1.75}, 0.1]]];

AbsoluteOptions[FindClusters[datapairs, Method -> Automatic], Method]


Any help would be appreciated.










share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I am trying to determine which method mathematica chooses when using FindClusters. The documentation says that it chooses the best one for the data. I have tried to use AbsoluteOptions, which says it returns the options for a command, but it does not seem to be working.



GaussianRandomData[n_Integer, p_, sigma_] := 
Table[p +
{Re[#], Im[#]}&[RandomReal[NormalDistribution[0, sigma]] E^(I RandomReal[{0, 2 π}])], {n}];
datapairs = BlockRandom[SeedRandom[2134];
Join[
GaussianRandomData[100, {2, 1}, .3],
GaussianRandomData[100, {1, 1.8}, .2],
GaussianRandomData[100, {1, 1.1}, .4],
GaussianRandomData[100, {1.75, 1.75}, 0.1]]];

AbsoluteOptions[FindClusters[datapairs, Method -> Automatic], Method]


Any help would be appreciated.







cluster-analysis






share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago









m_goldberg

85.7k872196




85.7k872196






New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 5 hours ago









MikeMike

233




233




New contributor




Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Mike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • $begingroup$
    You might be interested to know you can replace {Re[#], Im[#]}& with ReIm
    $endgroup$
    – m_goldberg
    58 mins ago


















  • $begingroup$
    You might be interested to know you can replace {Re[#], Im[#]}& with ReIm
    $endgroup$
    – m_goldberg
    58 mins ago
















$begingroup$
You might be interested to know you can replace {Re[#], Im[#]}& with ReIm
$endgroup$
– m_goldberg
58 mins ago




$begingroup$
You might be interested to know you can replace {Re[#], Im[#]}& with ReIm
$endgroup$
– m_goldberg
58 mins ago










1 Answer
1






active

oldest

votes


















6












$begingroup$

Using Trace with the option TraceInternal -> True gives:



DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, Method -> Automatic], 
HoldPattern[Rule["Method", _]], TraceInternal -> True]]



{"Method"->"GaussianMixture"}




If you specify the number of clusters:



DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic], 
HoldPattern[Rule["Method", _]], TraceInternal -> True]]



{"Method"->"KMeans"}




With PerformanceGoal -> "Quality"



DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic, 
PerformanceGoal -> "Quality"], HoldPattern[Rule["Method", _]],
TraceInternal -> True]]



{"Method"->"KMedoids"}




l = {RGBColor[1., 0.5544801460824762, 0.12056345655596812`], RGBColor[
1., 0.2818404077149421, 0.1073945311994069], RGBColor[
1., 0.12423838985259317`, 0.19023691956664956`], RGBColor[
0.8, 0.4542154246540884, 0.31688034954543], RGBColor[
0.8, 0.5483770742736782, 0.16977938137471082`], RGBColor[
0.8, 0.03163746197875539, 0.5781619271042624], RGBColor[
0.8, 0.1612089376881538, 0.15737556414394493`], RGBColor[
0.5, 0.8592283961197744, 0.04768022523989446], RGBColor[
0.1544029090531034, 0.5400111921283921, 0.1332688011328087],
RGBColor[0.5550268260924609, 0.6650311925481958, 0.24096295360192643`],
RGBColor[0.8424867588418756, 0.9610747917029776, 0.38159472421539053`],
RGBColor[0.5, 0.6654316628707297, 0.9850955091132039], RGBColor[
0.1726013976586489, 0.7948159289195966, 0.9375970360424373],
RGBColor[0.07338116039584297, 0.6615692536088942, 0.9035903703739081],
RGBColor[0.0396922307314016, 0.06815211658088716, 0.9401879243429714],
RGBColor[0.26561262398696184`, 0.1750699399994622, 0.47868645290098866`]};

DeleteDuplicates[Flatten@Trace[FindClusters[l], HoldPattern[Rule["Method", _]],
TraceInternal -> True]]



{Method -> DBSCAN}




The function MachineLearning`file40Decisions`PackagePrivate`automaticClusterNumberMethods seems to determine the method to be used based on input type, data dimensions and the setting for the option PerformanceGoal:



automaticClusterNumberMethods[type_, performanceGoal_, dims_]:= If[
MachineLearning`file40Decisions`PackagePrivate`vectorSpaceQ[type],
Switch[
performanceGoal, Automatic | "Memory",
If[Greater[Last @ dims, 7],
{"DBSCAN", "NeighborhoodContraction", "Agglomerate"},
{"DBSCAN", "NeighborhoodContraction", "GaussianMixture",
"Agglomerate"}
],
"Speed",
{"DBSCAN", "GaussianMixture", "NeighborhoodContraction"},
"Quality",
{
"Agglomerate", "DBSCAN", "JarvisPatrick", "MeanShift",
"Spectral", "SpanningTree",
"NeighborhoodContraction", "GaussianMixture"
},
"TrainingSpeed",
{"DBSCAN", "NeighborhoodContraction"}
],
{"DBSCAN", "JarvisPatrick"}
];


If the number of clusters is given the function MachineLearning`file40Decisions`PackagePrivate`givenClusterNumberMethods is called to determine the method to be used:



givenClusterNumberMethods[type_, performanceGoal_] := If[
vectorSpaceQ[type],
Switch[
performanceGoal, Automatic | "Memory" | "Speed",
{"KMeans", "Agglomerate"},
"Quality",
{"KMeans", "Agglomerate", "Spectral", "KMedoids"},
"TrainingSpeed",
{"KMeans"}
],
If[MatchQ[type, {"Location"}],
{"KMedoids"},
{"KMedoids", "Agglomerate"}
]
];





share|improve this answer











$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "387"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Mike is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191087%2fdetermining-the-method-option-that-findclusters-uses-with-absoluteoptions%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    6












    $begingroup$

    Using Trace with the option TraceInternal -> True gives:



    DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, Method -> Automatic], 
    HoldPattern[Rule["Method", _]], TraceInternal -> True]]



    {"Method"->"GaussianMixture"}




    If you specify the number of clusters:



    DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic], 
    HoldPattern[Rule["Method", _]], TraceInternal -> True]]



    {"Method"->"KMeans"}




    With PerformanceGoal -> "Quality"



    DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic, 
    PerformanceGoal -> "Quality"], HoldPattern[Rule["Method", _]],
    TraceInternal -> True]]



    {"Method"->"KMedoids"}




    l = {RGBColor[1., 0.5544801460824762, 0.12056345655596812`], RGBColor[
    1., 0.2818404077149421, 0.1073945311994069], RGBColor[
    1., 0.12423838985259317`, 0.19023691956664956`], RGBColor[
    0.8, 0.4542154246540884, 0.31688034954543], RGBColor[
    0.8, 0.5483770742736782, 0.16977938137471082`], RGBColor[
    0.8, 0.03163746197875539, 0.5781619271042624], RGBColor[
    0.8, 0.1612089376881538, 0.15737556414394493`], RGBColor[
    0.5, 0.8592283961197744, 0.04768022523989446], RGBColor[
    0.1544029090531034, 0.5400111921283921, 0.1332688011328087],
    RGBColor[0.5550268260924609, 0.6650311925481958, 0.24096295360192643`],
    RGBColor[0.8424867588418756, 0.9610747917029776, 0.38159472421539053`],
    RGBColor[0.5, 0.6654316628707297, 0.9850955091132039], RGBColor[
    0.1726013976586489, 0.7948159289195966, 0.9375970360424373],
    RGBColor[0.07338116039584297, 0.6615692536088942, 0.9035903703739081],
    RGBColor[0.0396922307314016, 0.06815211658088716, 0.9401879243429714],
    RGBColor[0.26561262398696184`, 0.1750699399994622, 0.47868645290098866`]};

    DeleteDuplicates[Flatten@Trace[FindClusters[l], HoldPattern[Rule["Method", _]],
    TraceInternal -> True]]



    {Method -> DBSCAN}




    The function MachineLearning`file40Decisions`PackagePrivate`automaticClusterNumberMethods seems to determine the method to be used based on input type, data dimensions and the setting for the option PerformanceGoal:



    automaticClusterNumberMethods[type_, performanceGoal_, dims_]:= If[
    MachineLearning`file40Decisions`PackagePrivate`vectorSpaceQ[type],
    Switch[
    performanceGoal, Automatic | "Memory",
    If[Greater[Last @ dims, 7],
    {"DBSCAN", "NeighborhoodContraction", "Agglomerate"},
    {"DBSCAN", "NeighborhoodContraction", "GaussianMixture",
    "Agglomerate"}
    ],
    "Speed",
    {"DBSCAN", "GaussianMixture", "NeighborhoodContraction"},
    "Quality",
    {
    "Agglomerate", "DBSCAN", "JarvisPatrick", "MeanShift",
    "Spectral", "SpanningTree",
    "NeighborhoodContraction", "GaussianMixture"
    },
    "TrainingSpeed",
    {"DBSCAN", "NeighborhoodContraction"}
    ],
    {"DBSCAN", "JarvisPatrick"}
    ];


    If the number of clusters is given the function MachineLearning`file40Decisions`PackagePrivate`givenClusterNumberMethods is called to determine the method to be used:



    givenClusterNumberMethods[type_, performanceGoal_] := If[
    vectorSpaceQ[type],
    Switch[
    performanceGoal, Automatic | "Memory" | "Speed",
    {"KMeans", "Agglomerate"},
    "Quality",
    {"KMeans", "Agglomerate", "Spectral", "KMedoids"},
    "TrainingSpeed",
    {"KMeans"}
    ],
    If[MatchQ[type, {"Location"}],
    {"KMedoids"},
    {"KMedoids", "Agglomerate"}
    ]
    ];





    share|improve this answer











    $endgroup$


















      6












      $begingroup$

      Using Trace with the option TraceInternal -> True gives:



      DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, Method -> Automatic], 
      HoldPattern[Rule["Method", _]], TraceInternal -> True]]



      {"Method"->"GaussianMixture"}




      If you specify the number of clusters:



      DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic], 
      HoldPattern[Rule["Method", _]], TraceInternal -> True]]



      {"Method"->"KMeans"}




      With PerformanceGoal -> "Quality"



      DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic, 
      PerformanceGoal -> "Quality"], HoldPattern[Rule["Method", _]],
      TraceInternal -> True]]



      {"Method"->"KMedoids"}




      l = {RGBColor[1., 0.5544801460824762, 0.12056345655596812`], RGBColor[
      1., 0.2818404077149421, 0.1073945311994069], RGBColor[
      1., 0.12423838985259317`, 0.19023691956664956`], RGBColor[
      0.8, 0.4542154246540884, 0.31688034954543], RGBColor[
      0.8, 0.5483770742736782, 0.16977938137471082`], RGBColor[
      0.8, 0.03163746197875539, 0.5781619271042624], RGBColor[
      0.8, 0.1612089376881538, 0.15737556414394493`], RGBColor[
      0.5, 0.8592283961197744, 0.04768022523989446], RGBColor[
      0.1544029090531034, 0.5400111921283921, 0.1332688011328087],
      RGBColor[0.5550268260924609, 0.6650311925481958, 0.24096295360192643`],
      RGBColor[0.8424867588418756, 0.9610747917029776, 0.38159472421539053`],
      RGBColor[0.5, 0.6654316628707297, 0.9850955091132039], RGBColor[
      0.1726013976586489, 0.7948159289195966, 0.9375970360424373],
      RGBColor[0.07338116039584297, 0.6615692536088942, 0.9035903703739081],
      RGBColor[0.0396922307314016, 0.06815211658088716, 0.9401879243429714],
      RGBColor[0.26561262398696184`, 0.1750699399994622, 0.47868645290098866`]};

      DeleteDuplicates[Flatten@Trace[FindClusters[l], HoldPattern[Rule["Method", _]],
      TraceInternal -> True]]



      {Method -> DBSCAN}




      The function MachineLearning`file40Decisions`PackagePrivate`automaticClusterNumberMethods seems to determine the method to be used based on input type, data dimensions and the setting for the option PerformanceGoal:



      automaticClusterNumberMethods[type_, performanceGoal_, dims_]:= If[
      MachineLearning`file40Decisions`PackagePrivate`vectorSpaceQ[type],
      Switch[
      performanceGoal, Automatic | "Memory",
      If[Greater[Last @ dims, 7],
      {"DBSCAN", "NeighborhoodContraction", "Agglomerate"},
      {"DBSCAN", "NeighborhoodContraction", "GaussianMixture",
      "Agglomerate"}
      ],
      "Speed",
      {"DBSCAN", "GaussianMixture", "NeighborhoodContraction"},
      "Quality",
      {
      "Agglomerate", "DBSCAN", "JarvisPatrick", "MeanShift",
      "Spectral", "SpanningTree",
      "NeighborhoodContraction", "GaussianMixture"
      },
      "TrainingSpeed",
      {"DBSCAN", "NeighborhoodContraction"}
      ],
      {"DBSCAN", "JarvisPatrick"}
      ];


      If the number of clusters is given the function MachineLearning`file40Decisions`PackagePrivate`givenClusterNumberMethods is called to determine the method to be used:



      givenClusterNumberMethods[type_, performanceGoal_] := If[
      vectorSpaceQ[type],
      Switch[
      performanceGoal, Automatic | "Memory" | "Speed",
      {"KMeans", "Agglomerate"},
      "Quality",
      {"KMeans", "Agglomerate", "Spectral", "KMedoids"},
      "TrainingSpeed",
      {"KMeans"}
      ],
      If[MatchQ[type, {"Location"}],
      {"KMedoids"},
      {"KMedoids", "Agglomerate"}
      ]
      ];





      share|improve this answer











      $endgroup$
















        6












        6








        6





        $begingroup$

        Using Trace with the option TraceInternal -> True gives:



        DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, Method -> Automatic], 
        HoldPattern[Rule["Method", _]], TraceInternal -> True]]



        {"Method"->"GaussianMixture"}




        If you specify the number of clusters:



        DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic], 
        HoldPattern[Rule["Method", _]], TraceInternal -> True]]



        {"Method"->"KMeans"}




        With PerformanceGoal -> "Quality"



        DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic, 
        PerformanceGoal -> "Quality"], HoldPattern[Rule["Method", _]],
        TraceInternal -> True]]



        {"Method"->"KMedoids"}




        l = {RGBColor[1., 0.5544801460824762, 0.12056345655596812`], RGBColor[
        1., 0.2818404077149421, 0.1073945311994069], RGBColor[
        1., 0.12423838985259317`, 0.19023691956664956`], RGBColor[
        0.8, 0.4542154246540884, 0.31688034954543], RGBColor[
        0.8, 0.5483770742736782, 0.16977938137471082`], RGBColor[
        0.8, 0.03163746197875539, 0.5781619271042624], RGBColor[
        0.8, 0.1612089376881538, 0.15737556414394493`], RGBColor[
        0.5, 0.8592283961197744, 0.04768022523989446], RGBColor[
        0.1544029090531034, 0.5400111921283921, 0.1332688011328087],
        RGBColor[0.5550268260924609, 0.6650311925481958, 0.24096295360192643`],
        RGBColor[0.8424867588418756, 0.9610747917029776, 0.38159472421539053`],
        RGBColor[0.5, 0.6654316628707297, 0.9850955091132039], RGBColor[
        0.1726013976586489, 0.7948159289195966, 0.9375970360424373],
        RGBColor[0.07338116039584297, 0.6615692536088942, 0.9035903703739081],
        RGBColor[0.0396922307314016, 0.06815211658088716, 0.9401879243429714],
        RGBColor[0.26561262398696184`, 0.1750699399994622, 0.47868645290098866`]};

        DeleteDuplicates[Flatten@Trace[FindClusters[l], HoldPattern[Rule["Method", _]],
        TraceInternal -> True]]



        {Method -> DBSCAN}




        The function MachineLearning`file40Decisions`PackagePrivate`automaticClusterNumberMethods seems to determine the method to be used based on input type, data dimensions and the setting for the option PerformanceGoal:



        automaticClusterNumberMethods[type_, performanceGoal_, dims_]:= If[
        MachineLearning`file40Decisions`PackagePrivate`vectorSpaceQ[type],
        Switch[
        performanceGoal, Automatic | "Memory",
        If[Greater[Last @ dims, 7],
        {"DBSCAN", "NeighborhoodContraction", "Agglomerate"},
        {"DBSCAN", "NeighborhoodContraction", "GaussianMixture",
        "Agglomerate"}
        ],
        "Speed",
        {"DBSCAN", "GaussianMixture", "NeighborhoodContraction"},
        "Quality",
        {
        "Agglomerate", "DBSCAN", "JarvisPatrick", "MeanShift",
        "Spectral", "SpanningTree",
        "NeighborhoodContraction", "GaussianMixture"
        },
        "TrainingSpeed",
        {"DBSCAN", "NeighborhoodContraction"}
        ],
        {"DBSCAN", "JarvisPatrick"}
        ];


        If the number of clusters is given the function MachineLearning`file40Decisions`PackagePrivate`givenClusterNumberMethods is called to determine the method to be used:



        givenClusterNumberMethods[type_, performanceGoal_] := If[
        vectorSpaceQ[type],
        Switch[
        performanceGoal, Automatic | "Memory" | "Speed",
        {"KMeans", "Agglomerate"},
        "Quality",
        {"KMeans", "Agglomerate", "Spectral", "KMedoids"},
        "TrainingSpeed",
        {"KMeans"}
        ],
        If[MatchQ[type, {"Location"}],
        {"KMedoids"},
        {"KMedoids", "Agglomerate"}
        ]
        ];





        share|improve this answer











        $endgroup$



        Using Trace with the option TraceInternal -> True gives:



        DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, Method -> Automatic], 
        HoldPattern[Rule["Method", _]], TraceInternal -> True]]



        {"Method"->"GaussianMixture"}




        If you specify the number of clusters:



        DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic], 
        HoldPattern[Rule["Method", _]], TraceInternal -> True]]



        {"Method"->"KMeans"}




        With PerformanceGoal -> "Quality"



        DeleteDuplicates[Flatten@Trace[FindClusters[datapairs, 3, Method -> Automatic, 
        PerformanceGoal -> "Quality"], HoldPattern[Rule["Method", _]],
        TraceInternal -> True]]



        {"Method"->"KMedoids"}




        l = {RGBColor[1., 0.5544801460824762, 0.12056345655596812`], RGBColor[
        1., 0.2818404077149421, 0.1073945311994069], RGBColor[
        1., 0.12423838985259317`, 0.19023691956664956`], RGBColor[
        0.8, 0.4542154246540884, 0.31688034954543], RGBColor[
        0.8, 0.5483770742736782, 0.16977938137471082`], RGBColor[
        0.8, 0.03163746197875539, 0.5781619271042624], RGBColor[
        0.8, 0.1612089376881538, 0.15737556414394493`], RGBColor[
        0.5, 0.8592283961197744, 0.04768022523989446], RGBColor[
        0.1544029090531034, 0.5400111921283921, 0.1332688011328087],
        RGBColor[0.5550268260924609, 0.6650311925481958, 0.24096295360192643`],
        RGBColor[0.8424867588418756, 0.9610747917029776, 0.38159472421539053`],
        RGBColor[0.5, 0.6654316628707297, 0.9850955091132039], RGBColor[
        0.1726013976586489, 0.7948159289195966, 0.9375970360424373],
        RGBColor[0.07338116039584297, 0.6615692536088942, 0.9035903703739081],
        RGBColor[0.0396922307314016, 0.06815211658088716, 0.9401879243429714],
        RGBColor[0.26561262398696184`, 0.1750699399994622, 0.47868645290098866`]};

        DeleteDuplicates[Flatten@Trace[FindClusters[l], HoldPattern[Rule["Method", _]],
        TraceInternal -> True]]



        {Method -> DBSCAN}




        The function MachineLearning`file40Decisions`PackagePrivate`automaticClusterNumberMethods seems to determine the method to be used based on input type, data dimensions and the setting for the option PerformanceGoal:



        automaticClusterNumberMethods[type_, performanceGoal_, dims_]:= If[
        MachineLearning`file40Decisions`PackagePrivate`vectorSpaceQ[type],
        Switch[
        performanceGoal, Automatic | "Memory",
        If[Greater[Last @ dims, 7],
        {"DBSCAN", "NeighborhoodContraction", "Agglomerate"},
        {"DBSCAN", "NeighborhoodContraction", "GaussianMixture",
        "Agglomerate"}
        ],
        "Speed",
        {"DBSCAN", "GaussianMixture", "NeighborhoodContraction"},
        "Quality",
        {
        "Agglomerate", "DBSCAN", "JarvisPatrick", "MeanShift",
        "Spectral", "SpanningTree",
        "NeighborhoodContraction", "GaussianMixture"
        },
        "TrainingSpeed",
        {"DBSCAN", "NeighborhoodContraction"}
        ],
        {"DBSCAN", "JarvisPatrick"}
        ];


        If the number of clusters is given the function MachineLearning`file40Decisions`PackagePrivate`givenClusterNumberMethods is called to determine the method to be used:



        givenClusterNumberMethods[type_, performanceGoal_] := If[
        vectorSpaceQ[type],
        Switch[
        performanceGoal, Automatic | "Memory" | "Speed",
        {"KMeans", "Agglomerate"},
        "Quality",
        {"KMeans", "Agglomerate", "Spectral", "KMedoids"},
        "TrainingSpeed",
        {"KMeans"}
        ],
        If[MatchQ[type, {"Location"}],
        {"KMedoids"},
        {"KMedoids", "Agglomerate"}
        ]
        ];






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 3 hours ago

























        answered 3 hours ago









        kglrkglr

        182k10200415




        182k10200415






















            Mike is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Mike is a new contributor. Be nice, and check out our Code of Conduct.













            Mike is a new contributor. Be nice, and check out our Code of Conduct.












            Mike is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Mathematica Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191087%2fdetermining-the-method-option-that-findclusters-uses-with-absoluteoptions%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            what is the purpose of having a “thru cal” on RF PCB?

            What does Gandalf whisper to the Moth on the Orthanc in Isengard?

            magento2 creating a lot of catalogrule_product_temp tables