I believe that you can instantiate an instance of the AbsoluteError class for the *Loss* object, since that object implements the Loss interface. For example.
val loss = new AbsoluteError() boostingStrategy.setLoss(loss) On Mon, Feb 29, 2016 at 9:33 AM, diplomatic Guru <diplomaticg...@gmail.com> wrote: > Hi Kevin, > > Yes, I've set the bootingStrategy like that using the example. But I'm not > sure how to create and pass the Loss object. > > e.g > > boostingStrategy.setLoss(......); > > Not sure how to pass the selected Loss. > > How do I set the Absolute Error in setLoss() function? > > > > > On 29 February 2016 at 15:26, Kevin Mellott <kevin.r.mell...@gmail.com> > wrote: > >> You can use the constructor that accepts a BoostingStrategy object, which >> will allow you to set the tree strategy (and other hyperparameters as well). >> >> *GradientBoostedTrees >> <http://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/tree/GradientBoostedTrees.html#GradientBoostedTrees(org.apache.spark.mllib.tree.configuration.BoostingStrategy)>* >> (BoostingStrategy >> <http://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/tree/configuration/BoostingStrategy.html> >> boostingStrategy) >> >> On Mon, Feb 29, 2016 at 9:21 AM, diplomatic Guru < >> diplomaticg...@gmail.com> wrote: >> >>> Hello guys, >>> >>> I think the default Loss algorithm is Squared Error for regression, but >>> how do I change that to Absolute Error in Java. >>> >>> Could you please show me an example? >>> >>> >>> >> >