use of hex.quantile.QuantileModel in project h2o-3 by h2oai.
the class DeepLearningModel method calcOutlierThreshold.
/**
* Compute quantile-based threshold (in reconstruction error) to find outliers
* @param mse Vector containing reconstruction errors
* @param quantile Quantile for cut-off
* @return Threshold in MSE value for a point to be above the quantile
*/
public double calcOutlierThreshold(Vec mse, double quantile) {
Frame mse_frame = new Frame(Key.<Frame>make(), new String[] { "Reconstruction.MSE" }, new Vec[] { mse });
DKV.put(mse_frame._key, mse_frame);
QuantileModel.QuantileParameters parms = new QuantileModel.QuantileParameters();
parms._train = mse_frame._key;
parms._probs = new double[] { quantile };
Job<QuantileModel> job = new Quantile(parms).trainModel();
QuantileModel kmm = job.get();
job.remove();
double q = kmm._output._quantiles[0][0];
kmm.delete();
DKV.remove(mse_frame._key);
return q;
}
Aggregations