Preheat oven to 350°F. Line 9-inch baking pan with parchment paper and grease lightly.
Peel and finely grate sweet potatoes. Wrap in kitchen towel and squeeze out excess moisture firmly.
Soak raisins in rum or warm water 10 to 30 minutes. Drain.
Whisk coconut milk, brown sugar, melted butter, eggs, vanilla, and rum together until sugar mostly dissolved.
Add flour, cinnamon, nutmeg, ginger, allspice, and salt. Stir until just combined.
Fold in grated sweet potato until fully incorporated. Fold in raisins.
Pour into prepared pan. Smooth top. Cover tightly with foil.
Bake covered 45 minutes.
Remove foil. Bake uncovered 30 to 45 minutes more until top is deep golden brown and toothpick comes out with just moist crumbs.
Cool in pan 30 minutes minimum before cutting.