public OrdinalModelPrediction predictOrdinal ( RowData data , double offset ) throws PredictException { double [ ] preds = preamble ( ModelCategory . Ordinal , data , offset ) ; OrdinalModelPrediction p = new OrdinalModelPrediction ( ) ; p . classProbabilities = new double [ m . getNumResponseClasses ( ) ] ; p . labelIndex = ( int ) preds [ 0 ] ; String [ ] domainValues = m . getDomainValues ( m . getResponseIdx ( ) ) ; p . label = domainValues [ p . labelIndex ] ; System . arraycopy ( preds , 1 , p . classProbabilities , 0 , p . classProbabilities . length ) ; return p ; }
Make a prediction on a new data point using a Ordinal model .