Preheat your oven to 350°F (175°C). Grease a 9x13-inch baking dish.
In a large bowl, combine the grated sweet potatoes, granulated sugar, and melted butter. Mix well.
Add the flour, cinnamon, nutmeg, salt, and baking powder. Stir to combine.
Mix in the eggs, coconut milk, and vanilla extract until the mixture is smooth and well combined.
If using, fold in the raisins and chopped nuts.
Pour the mixture into the prepared baking dish and spread evenly.
Bake in the preheated oven for 45-50 minutes, or until a toothpick inserted into the center comes out clean.
Allow the Pain Patate to cool in the baking dish before cutting into squares.
Enjoy your meal!