'Build a clone recommender with the given dataset
as the training set.
Parameters
dataset: dict
The dataset with the user\'s preferences.
recommender: A scikits.crab.base.BaseRecommender object.
The given recommender to be cloned.'

def _build_recommender(self, dataset, recommender):

    recommender_training = clone(recommender)
    if (not recommender.model.has_preference_values()):
        recommender_training.model.dataset = recommender_training.model._load_dataset(dataset.copy())
    else:
        recommender_training.model.dataset = dataset
    if hasattr(recommender_training.model, 'build_model'):
        recommender_training.model.build_model()
    return recommender_training
