patchGNU Octave - Patches: patch #10052, [octave forge] (statistics) Add...

 
 

patch #10052: [octave forge] (statistics) Add function evalclusters

Submitter:  None
Submitted:  Sat 03 Apr 2021 04:12:40 PM UTC
   
 
Category:  Forge : new function Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  philipnienhuis Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 23 Nov 2021 08:31:53 PM UTC, comment #5: 

assuming this can be closed now that a few months have passed.

Nicholas Jankowski <nrjank>
Group Member
Fri 23 Jul 2021 08:48:39 AM UTC, comment #4: 

Sorry, I missed your comment about the texinfo, otherwise I would have done (or at least tried to do) better.

About the line endings, I am quite sure that is not a fault of my editors, because I use exclusively Linux at home.

This function is quite sizeable so I did not test it thoroughly, in particular I tested some parts much more than others. Moreover, in the meantime, I toyed a bit with the PCA criterion, but it is not quite there yet. So, I fully agree with the "ready for test" status to stay for some time.

Anonymous
Wed 21 Jul 2021 09:27:07 PM UTC, comment #3: 

Forgot to mention:

  • changed CRFL EOLs into LF - but those Windows line endings may have been introduced by one of my editors.
Philip Nienhuis <philipnienhuis>
Group Member
Wed 21 Jul 2021 09:24:01 PM UTC, comment #2: 

I've pushed your cset here:
http://hg.code.sf.net/p/octave/statistics/rev/3bee8e4c0686
with some minor style edits:

  • two spaces after period in Texinfo
  • added empty lines after each "case" clause (but I wasn't very consistent)
  • strcmp => strcmpi everywhere so case won't matter in inputs. Also saves some calls to lower()
  • no spaces on empty lines.


Thanks very much for your contribution.

I'll leave Status to "Ready for test" for a while.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 18 Jul 2021 06:51:21 PM UTC, comment #1: 

@Stefano:
picking up again after some months with a bit of overload at work).

I've had a brief look at the code.
Repeating myself from patch #9985: although I have little detailed knowledge about these functions I'll process this patch as IMO these well-written functions shouldn't rot here until maybe some clustering statistics guru happens to stumble over this patch.

I'll briefly check operation, check style and Texinfo. Style looks pretty good AFAICS, only Texinfo thing I noted is two spaces after each period separating two sentences (don't ask, it's just the local style here).

Philip Nienhuis <philipnienhuis>
Group Member
Sat 03 Apr 2021 04:12:40 PM UTC, original submission:  

This is a patch to add function "evalclusters" and its related classes.

The function "evalclusters" returns a "ClusterCriterion" object, which is used to evaluate different clustering solutions.

Example:

>> load fisheriris;
>> eva = evalclusters(meas,"kmeans","calinskiharabasz","KList",[1:6])
eva =

  CalinskiHarabaszEvaluation object with properties:

      ClusteringFunction: kmeans
           CriterionName: CalinskiHarabasz
         CriterionValues: [1x6 double]
              InspectedK: [1x6 double]
                 Missing: [1x150 double]
         NumObservations: [1x1 double]
                OptimalK: [1x1 double]
                OptimalY: [150x1 double]
                       X: [150x4 double]
>> eva.OptimalK
ans = 3
>> figure();
>> eva.plot();


The "CalinskiHarabaszEvaluation" class is a subclass of "ClusterCriterion", which uses the Calinski-Harabasz criterion to guess the optimal clustering solution.

The implemented criterions are: "CalinskiHarabasz", "DaviesBouldin", "gap", "silhouette".

The method "compact", which converts an evaluation object into a compact evaluation object is not implemented.

For the gap criterion the reference distribution "PCA" is not implemented: when the reference distribution is set to "PCA", it uses "uniform" instead and throws a warning. Note: function "princomp", which is used to do a principal component analysis of some data, is now called "pca" in MATLAB.

I tested most stuff, but not everything. There are many available options and different combinations of such options to test.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #51182:  evalclusters.diff added by None (69KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-23 nrjank StatusReady For Test Done
        Open/ClosedOpen Closed
    2021-07-21 philipnienhuis StatusIn Progress Ready For Test
    2021-07-20 philipnienhuis Carbon-Copy- Added philipnienhuis
    2021-07-18 philipnienhuis StatusNone In Progress
        Assigned toNone philipnienhuis
    2021-04-03 None Attached File- Added evalclusters.diff, #51182

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code