@@ -120,12 +120,14 @@ export class DataService extends LitService {
120
120
this . setValuesForNewDatapoints ( newDatapoints ) ) ;
121
121
}
122
122
123
+ /**
124
+ * Get the column name given a model, key, and optional type.
125
+ *
126
+ * Note that colons are used as separators between these three pieces of data,
127
+ * so none of these values should contain a colon.
128
+ */
123
129
getColumnName ( model : string , predKey : string , type ?: CalculatedColumnType ) {
124
- let columnName = `${ model } :${ predKey } ` ;
125
- if ( type != null ) {
126
- columnName += ` ${ type } ` ;
127
- }
128
- return columnName ;
130
+ return `${ model } :${ predKey } ${ type != null ? `:${ type } ` : '' } ` ;
129
131
}
130
132
131
133
/**
@@ -161,7 +163,7 @@ export class DataService extends LitService {
161
163
( result : ClassificationResults ) => result [ key ] . predicted_class ) ;
162
164
const correctness = classificationResults . map (
163
165
( result : ClassificationResults ) => result [ key ] . correct ) ;
164
- const source = `CLASSIFICATION_SOURCE_PREFIX:${ model } ` ;
166
+ const source = `${ CLASSIFICATION_SOURCE_PREFIX } :${ model } ` ;
165
167
this . addColumnFromList (
166
168
scores , data , scoreFeatName ,
167
169
this . appState . createLitType ( 'MulticlassPreds' , false ) , source ) ;
@@ -212,7 +214,7 @@ export class DataService extends LitService {
212
214
const sqErrors = regressionResults . map (
213
215
( result : RegressionResults ) => result [ key ] . squared_error ) ;
214
216
const dataType = this . appState . createLitType ( 'Scalar' , false ) ;
215
- const source = `REGRESSION_SOURCE_PREFIX:${ model } ` ;
217
+ const source = `${ REGRESSION_SOURCE_PREFIX } :${ model } ` ;
216
218
this . addColumnFromList ( scores , data , scoreFeatName , dataType , source ) ;
217
219
if ( output [ key ] . parent != null ) {
218
220
this . addColumnFromList ( errors , data , errorFeatName , dataType , source ) ;
0 commit comments