Despite his socially liberal views, Mr. Bloomberg changed parties to run in the Republican mayoral primary in 2001. He registered as an independent midway through his time at City Hall.
https://www.nytimes.com/interactive/2020/us/elections/michael-bloomberg.html

