code: function getDist(type, node, centroid, attributes, mode) {
    var getP = mode === 'kMedoids' ? function (i) {
      return attributes[i](centroid);
    } : function (i) {
      return centroid[i];
    };
  
    var getQ = function getQ(i) {
      return attributes[i](node);
    };
  
    return clusteringDistance(type, attributes.length, getP, getQ);
  }
docs: /* eslint-enable