in tensorflow_model_analysis/frontend/tfma-multi-class-confusion-matrix-at-thresholds/tfma-multi-class-confusion-matrix-at-thresholds.js [167:376]
static get properties() {
return {
/**
* The input data. It should be of type MultiClassConfusionMatrix.
* @type {!Object}
*/
data: {type: Object},
/**
* A map where the keys are the class names in string and the values are
* class ids in number.
* @type {!Object<number>}
*/
classNames: {type: Object, value: () => ({})},
/**
* A map where the keys are the class ids and the values are the
* corresponding class name strings.
* @private {!Object<string>}
*/
displayNames_: {
type: Object,
computed: 'computeDisplayNames_(classNames, availableClassIds_)',
},
/**
* Whether the data contains results for a multi-label multi-class model
* or single-label multi-class model.
*/
multiLabel: {type: Boolean, value: false},
/**
* An array of thresholds.
* @private {!Array<number>}
*/
thresholds_: {
type: Array,
computed: 'computeThresholds_(data)',
observer: 'thresholdsChanged_',
},
/**
* The selected threshold.
* @private {number}
*/
selectedThreshold_: {type: String},
/**
* An array of class ids.
* @private {!Array<string>}
*/
availableClassIds_: {
type: Array,
computed: 'computeAvailableClassIds_(data)',
},
/**
* The key is the threshold and the value is the summary built from input
* data.
* @private {!Object<!SummaryMatrix>}
*/
summary_: {
type: Object,
computed: 'computeSummary_(data, multiLabel, availableClassIds_)'
},
/**
* The matrix with the selected threshold.
* @private {!SummaryMatrix}
*/
selectedMatrix_: {
type: Object,
computed: 'computeSelectedMatrix_(summary_, selectedThreshold_)',
},
/**
* A list of class ids sorted according to the user's choice.
* @private {!Array<string>}
*/
sortedClassIds_: {
type: Array,
computed: 'computeSortedClassIds_(' +
'selectedMatrix_, availableClassIds_, displayNames_, sort_)',
observer: 'sortedClassIdsChanged_'
},
/**
* The 2d array used for building the matrix.
* @private {!Array<!Array<!Object>>}
*/
matrix_: {
type: Array,
computed: 'computeMatrix_(' +
'selectedMatrix_, sortedClassIds_, numberOfClassesShown_, ' +
'displayNames_, sort_, showPercentage_)'
},
/**
* The mode in which the matrix should be visualized.
* @private {string}
*/
mode_: {type: String, value: SortBy.POSITIVES},
/**
* The method in which classes in the matrix should be sorted.
* @private {!SortBy}
*/
sort_: {type: String, value: SortBy.ALPHABETICAL},
/**
* Whether to show percentage or raw value.
* @private {boolean}
*/
showPercentage_: {type: Boolean, value: false},
/**
* The number of classes to show. This helps keep the component performant
* by ommitting some classes from being rendered.
* @private {number}
*/
numberOfClassesShown_: {type: Number},
/**
* Whether the controls are visible.
* @private {boolean}
*/
controlOpened_: {
type: Boolean,
value: true,
},
compact_: {
type: Boolean,
value: false,
},
sortBy_: {
type: Object,
value: {
'ALPHABETICAL': SortBy.ALPHABETICAL,
'POSITIVES': SortBy.POSITIVES,
'FALSE_POSITIVES': SortBy.FALSE_POSITIVES,
'FALSE_NEGATIVES': SortBy.FALSE_NEGATIVES,
'NO_PREDICTION': SortBy.NO_PREDICTION,
'TRUE_POSITIVES': SortBy.TRUE_POSITIVES,
}
},
/**
* The predicted class of the predicted cell.
* @private {string}
*/
selectedPrecitedClass_: {type: String},
/**
* The predicted class of the selected cell.
* @private {string}
*/
selectedActualClass_: {type: String},
/**
* The total value for sorting for the selected row.
* @private {number}
*/
selectedRowTotal_: {type: Number},
/**
* The value selected cell.
* @private {number}
*/
selectedCellValue_: {type: Number},
/**
* The percentage of the selected cell compared against the sort value in
* the toltip.
* @private {string}
*/
selectedCellPercentage_: {type: String},
/**
* Whether the tooltip should be visible.
* @private {boolean}
*/
showTooltip_: {type: Boolean, value: false},
/**
* The id of the seTimeout that removes the tooltip from the UI.
* @private {number}
*/
removeTooltipTimeout_: {type: Number, value: 0},
/**
* The anchor element for the tooltip.
* @private {?Element}
*/
anchor_: {
type: Object,
value: null,
},
/**
* The target anchor element.
* @private {?Element}
*/
targetAnchor_: {
type: Object,
value: null,
},
};
}