If we have some data of a function that maps $X \in R^D$ to $y \in R$, can we have a measure of convexity for it?
For example for three points, I can imagine a line passes through two of them, and if the third point is in between, it's positive distance to the line could be a measure of convexity.
or if we can define a convex surface and compute the distance between the points to this surface