ML example for java API

Hi, here is the linear regression example for the new JAVA API.