Yeah, I know.
@SunDeep, I don't know enough about Madagascar, actually.
In Madagascar's Merina Kingdom, you have a ruling dynasty over the entire island which is even older than the Tokugawa Shogunate. In Radama II, you have a king who ended the island's long-standing policy of isolationism and Christian persecution by re-opening the island to European influence in 1861. In Japan, Perry's ships had forced the Japanese to do exactly the same thing only three years earlier. Unlike in Japan though, where the traditionalist reactionaries in power were overthrown by the progressive modernists in the Meiji restoration, the opposite happened in Madagascar IOTL; the ruling monarch Radama II, who was himself held in high repute as a progressive, liberal modernist, was assassinated by the traditionalist reactionaries in court, bringing about the downfall of the Merina dynasty. Like the Japanese, Madagascans were perceived to be different to the rest of the people on their continent by the Europeans; they had visibly lighter skin, and this led to them being deemed by the Europeans to be 'racially superior' to other Africans, in much the same manner that the Japanese were deemed to be superior to other Asian peoples. In Radama II, they had a leader who was prepared to make a concerted effort to modernise, and to industrialise.
Even more crucially though, unlike most other candidates in Africa, Madagascar has the resources to do it, with the island possessing even greater coal and iron reserves that those of either pre-industrial Japan or Great Britain. And just like Japan, Madagascar has a long naval tradition; it's the only significant island nation in Africa, so its land borders are completely secure as long as it can modernise its navy. For this reason, just like Japan, the focus of the industrialising Madagascar's military complex will be on its Imperial Navy (and an Air Force, once the concept emerges); and you can even extend the 'African Japan' analogy for Madagascar to its neighbours. Zanzibar, and its dominions along the Zanj Coast, could easily serve as Madagscar's 'African Korea'.