Interaction-induced magnetoresistance: From diffusive to ballistic regime