protected Set < Long > getModelTrainingDifference ( final DataModelIF < Long , Long > model , final Long user ) { final Set < Long > items = new HashSet < Long > ( ) ; if ( training . getUserItems ( user ) != null ) { final Set < Long > trainingItems = new HashSet <> ( ) ; for ( Long i : training . getUserItems ( user ) ) { trainingItems . add ( i ) ; } for ( Long item : model . getItems ( ) ) { if ( ! trainingItems . contains ( item ) ) { items . add ( item ) ; } } } return items ; }
Get the items appearing in the training set and not in the data model .