function preprocess (data) {
    if (isMatrix(data)) {
      return preprocess(data.valueOf())
    }

    if (isArray(data)) {
      return data.map(preprocess)
    }

    return data
  }
Preprocess data, which can be an Array or DenseMatrix with nested Arrays and
Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays
@memberof DenseMatrix
@param {Array | Matrix} data
@return {Array} data