Skip to content

Commit 899eb08

Browse files
author
minjk-bl
committed
Add info option for Clustering
1 parent ef94fa1 commit 899eb08

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

js/m_ml/ModelInfo.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -551,16 +551,18 @@ define([
551551
break;
552552
case 'Clustering':
553553
infos = {
554-
// 'Size of clusters': {
555-
// name: 'Size of clusters',
556-
// code: "print(f'Size of clusters: {np.bincount(pred)}')", // FIXME: model.cluster_centers_ / use model info or hide it
557-
// options: []
558-
// }
554+
'get_params': {
555+
...defaultInfos['get_params']
556+
}
559557
}
560558

561559
if (modelType == 'KMeans') {
562560
infos = {
563561
...infos,
562+
'score': {
563+
...defaultInfos['score'],
564+
description: 'Return the mean accuracy on the given test data and labels.'
565+
},
564566
'cluster_centers_': {
565567
name: 'cluster_centers',
566568
label: 'Cluster centers',
@@ -587,6 +589,16 @@ define([
587589
}
588590
}
589591
}
592+
593+
if (modelType == 'GaussianMixture') {
594+
infos = {
595+
...infos,
596+
'score': {
597+
...defaultInfos['score'],
598+
description: 'Compute the per-sample average log-likelihood of the given data X.'
599+
}
600+
}
601+
}
590602
break;
591603
case 'Dimension Reduction':
592604
if (modelType == 'LDA') {

0 commit comments

Comments
 (0)