This is a great cake adding lemon curd or raspberry jams between layer or layers. I suggest to use a cream cheese icing . I have used fondant and butter cream with this cake and people like it best with cream cheese icing. If there is a nut allergie then you can omit the pecans. Enjoy this is one of my favorite and best cakes I make.
Preheat oven to 350 degrees F. Adjust the position of the rack to the center of the oven. Grease and flour 2 (9-inch) pans or 3 (8-inch) pans. Set aside.
In a large bowl, stir together the flour, baking soda, baking powder, salt, cinnamon, nutmeg, and granulated sugar. Set aside. In the bowl of a mixer, cream margarine and brown sugar on low speed, and then increase speed to medium and beat until well-combined. Gradually add the dry ingredients and beat on low speed until just incorporated. Add eggs, 1 at a time, beating well after each egg and scraping down the sides of the bowl after the addition of each egg. Add vanilla, sweet potatoes, pineapple, raisins, and walnuts and blend on low speed until thoroughly mixed.
Pour batter into pans and smooth the surface with a metal spatula. Bake for 1 hour to 1 hour and 10 minutes, or until a toothpick inserted in center comes out clean; when you touch the center of the cake, it should spring back. Allow to cool in pans for 10 minutes, and then invert onto a rack and cool completely.