Effective Transfer Learning With The Use Of Distance Metrics