That's basically nonsensical. Madagascar as Westernised (in the Thailand sense, and probably better) is doable. But industrial revolution, starting there? What? I'd buy Madagascar stomping Portugal in a war, maybe,
maybe Madagascar beating France, but...what you propose is just impossible. But I can overlook (from a literary standpoint) that if you have an interesting enough setting.
You're going to have to go pretty far back for that. Madagascar is a rain forest with ungodly difficult mountains in the middle, far from any cradle of civilization. For this to happen, Madagascar will need extraordinary luck and would be heavily dependent on its empire. Knowing fuckall about Madagascar history, the best I can say is have the Arabs establish a kingdom in the 600's there and have it conquer a portion of arable Southern Africa that it can use as a manpower base or have a rich kingdom in Southern Africa so Madagascar can get rich off of trade with it and by serving as an intermediary. Either one could be leveraged into an empire if the rulers play their cards to the fullest, but once again, it will take massive amounts of luck.
Yeah, and those mountains created the Merina which unified Madagascar and made one of the most capable sub-Saharan African civilisations for resisting Europeans. Plus the Sakalava were pretty capable in their own right, and definitely the Merina were not the only people who could unify Madagascar. No need for South African land or Arabs to help. And the key part, avoid any isolationism like Ranavalona I and the violence she inspired--there were ways of unifying Madagascar beside her effective but ultimately destructive methods.
I see Madagascar as a nation which in a sort of Russo-Japanese War analogue can easily defeat Portugal in a fight. Madagascar would likely try and gain the Comoros, Reunion, and other French islands in the Indian Ocean. This would tie them to German, and affect any World War I campaign in Africa. Obviously, being an island will mean that above all else, Madagascar will focus on a strong navy. It might end like Thailand's navy in WWII vs. France, but it wouldn't stop the Malagasy from trying. And with the right situation with the right help, Madagascar genuinely could defeat France and seize the nearby Indian Ocean islands, as their ambitions vs. France might be.