Preheat your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.
In a medium bowl, whisk together the flour, baking soda, salt, cinnamon, nutmeg, and cloves.
In a large bowl, cream together the softened butter and granulated sugar until light and fluffy.
Beat in the eggs one at a time, then stir in the vanilla extract.
In a small bowl, combine the mashed sweet potatoes and buttermilk.
Gradually add the dry ingredients to the wet ingredients, alternating with the sweet potato mixture, beginning and ending with the dry ingredients. Mix until just combined. Do not overmix.
Divide the batter evenly between the prepared cake pans.
Bake for 30-35 minutes, or until a wooden skewer inserted into the center comes out clean.
Let the cakes cool in the pans for 10 minutes before inverting them onto a wire rack to cool completely.
While the cakes cool, prepare the frosting. In a large bowl, beat the softened cream cheese and butter until smooth.
Gradually add the powdered sugar, alternating with the milk, until the frosting reaches your desired consistency. Stir in the vanilla extract.
Once the cakes are completely cool, frost the top of one layer, then place the second layer on top. Frost the top and sides of the entire cake.
Garnish with chopped pecans, if desired.
Notes
For a sheet cake, bake in a greased and floured 9×13 inch pan for 35-40 minutes.
Ensure your sweet potatoes are fully cooked and mashed smoothly for the best texture.
You can make the cake layers a day in advance and store them wrapped tightly at room temperature.