@@ -1425,18 +1425,17 @@ <h2>Show similarity to selected datapoint</h2>
14251425 < paper-radio-group
14261426 selected ="{{nearestCounterfactualDist}} "
14271427 >
1428- < paper-radio-button name ="L1 "
1429- > L1</ paper-radio-button
1430- >
1431- < paper-radio-button name ="L2 "
1432- > L2</ paper-radio-button
1433- >
1428+ < paper-radio-button name ="L1 "> L1</ paper-radio-button >
1429+ < paper-radio-button name ="L2 "> L2</ paper-radio-button >
14341430 </ paper-radio-group >
14351431 < template is ="dom-if " if ="[[isRegression_(modelType)]] ">
1436- < div title ="Minimum distance in inferred value to consider counterfactual "
1437- class ="counterfactual-delta ">
1432+ < div
1433+ title ="Minimum distance in inferred value to consider counterfactual "
1434+ class ="counterfactual-delta "
1435+ >
14381436 < label > Delta</ label >
1439- < paper-slider pin
1437+ < paper-slider
1438+ pin
14401439 value ="{{minCounterfactualValueDist}} "
14411440 max ="{{maxCounterfactualValueDist}} "
14421441 > </ paper-slider >
@@ -1479,14 +1478,19 @@ <h2>Show similarity to selected datapoint</h2>
14791478 </ div >
14801479 < div >
14811480 Compares the selected datapoint with its nearest
1482- neighbor from a different classification using L1
1483- or L2 distance.
1481+ neighbor from a different classification using L1 or
1482+ L2 distance.
14841483 </ div >
14851484 < div >
1486- < template is ="dom-if " if ="[[isRegression_(modelType)]] " restamp >
1487- For regression, a neighbor point is considered as
1488- a different classification if the difference in infered
1489- value is equal or greater than selected threshold.
1485+ < template
1486+ is ="dom-if "
1487+ if ="[[isRegression_(modelType)]] "
1488+ restamp
1489+ >
1490+ For regression, a neighbor point is considered as
1491+ a different classification if the difference in
1492+ infered value is equal or greater than selected
1493+ threshold.
14901494 </ template >
14911495 </ div >
14921496 </ paper-dialog >
@@ -3809,12 +3813,13 @@ <h2>Show similarity to selected datapoint</h2>
38093813 isSameInferenceClass_ : function ( val1 , val2 ) {
38103814 return this . isRegression_ ( this . modelType )
38113815 ? Math . abs ( val1 - val2 ) < this . minCounterfactualValueDist
3812- : val1 == val2 ;
3816+ : val1 == val2 ;
38133817 } ,
38143818
38153819 adjustCounterfactualValueDistRange_ : function ( selected , valueStr ) {
38163820 this . maxCounterfactualValueDist = Math . max (
3817- this . distanceStats_ [ valueStr ] . max - this . visdata [ selected ] [ valueStr ] ,
3821+ this . distanceStats_ [ valueStr ] . max -
3822+ this . visdata [ selected ] [ valueStr ] ,
38183823 this . visdata [ selected ] [ valueStr ] - this . distanceStats_ [ valueStr ] . min
38193824 ) ;
38203825 } ,
@@ -3825,15 +3830,21 @@ <h2>Show similarity to selected datapoint</h2>
38253830 inferenceValueStr ,
38263831 this . nearestCounterfactualModelIndex
38273832 ) ;
3828- this . adjustCounterfactualValueDistRange_ ( selected , modelInferenceValueStr )
3833+ this . adjustCounterfactualValueDistRange_ (
3834+ selected ,
3835+ modelInferenceValueStr
3836+ ) ;
38293837 let closestDist = Number . POSITIVE_INFINITY ;
38303838 let closest = - 1 ;
38313839 for ( let i = 0 ; i < this . visdata . length ; i ++ ) {
38323840 // Skip the selected example itself and examples with the same inference class.
3833- if ( i == selected || this . isSameInferenceClass_ (
3834- this . visdata [ selected ] [ modelInferenceValueStr ] ,
3835- this . visdata [ i ] [ modelInferenceValueStr ]
3836- ) ) {
3841+ if (
3842+ i == selected ||
3843+ this . isSameInferenceClass_ (
3844+ this . visdata [ selected ] [ modelInferenceValueStr ] ,
3845+ this . visdata [ i ] [ modelInferenceValueStr ]
3846+ )
3847+ ) {
38373848 continue ;
38383849 }
38393850 let dist = this . getDist (
0 commit comments