private static void summarizeModelCommonFields ( ModelSummary summary , Model model ) { String [ ] names = model . _names ; summary . warnings = model . warnings ; summary . model_algorithm = model . getClass ( ) . toString ( ) ; // fallback only // model.job() is a local copy; on multinode clusters we need to get from the DKV Key job_key = ( ( Job ) model . job ( ) ) . self ( ) ; if ( null == job_key ) throw H2O . fail ( "Null job key for model: " + ( model == null ? "null model" : model . _key ) ) ; // later when we deserialize models from disk we'll relax this constraint Job job = DKV . get ( job_key ) . get ( ) ; summary . state = job . getState ( ) ; summary . model_category = model . getModelCategory ( ) ; UniqueId unique_id = model . getUniqueId ( ) ; summary . id = unique_id . getId ( ) ; summary . key = unique_id . getKey ( ) ; summary . creation_epoch_time_millis = unique_id . getCreationEpochTimeMillis ( ) ; summary . training_duration_in_ms = model . training_duration_in_ms ; summary . response_column_name = names [ names . length - 1 ] ; for ( int i = 0 ; i < names . length - 1 ; i ++ ) summary . input_column_names . ( names [ i ] ) ; // Ugh. VarImp vi = model . varimp ( ) ; if ( null != vi ) { summary . variable_importances = new LinkedHashMap ( ) ; summary . variable_importances . put ( "varimp" , vi . varimp ) ; summary . variable_importances . put ( "variables" , vi . getVariables ( ) ) ; summary . variable_importances . put ( "method" , vi . method ) ; summary . variable_importances . put ( "max_var" , vi . max_var ) ; summary . variable_importances . put ( "scaled" , vi . scaled ( ) ) ; } }
Summarize fields which are generic to water . Model .