For the cake: Adjust oven rack to middle position and heat oven to 350 degrees. Spray two 9-inch round cake pans or spring form pans with nonstick cooking spray. Line bottoms of pans with parchment and spray parchment.
In a large bowl, whisk together flour, baking powder, baking soda, cinnamon, black pepper, nutmeg, cardamom, cloves, and salt in large bowl; set aside.
Clean and grate/shred carrots (you should have about 3 cups); transfer carrots to bowl and set aside.
In another bowl beat granulated and brown sugars and eggs on medium-high until thoroughly combined, about 45 seconds. With mixer running, add oil in slow, steady stream, being careful to pour oil against inside of bowl (if oil begins to splatter, reduce speed to low until oil is incorporated, then resume adding oil). Increase speed to high and mix until mixture is light in color and well emulsified, about 45 seconds to 1 minute longer. Turn off mixer and stir in carrots and dry ingredients by hand until incorporated and no streaks of flour remain. Pour into prepared pans.
Bake until toothpick or skewer inserted into center of cake comes out clean, 35 to 40 minutes, rotating pans halfway through baking time. Cool cakes to room temperature in pan on wire rack, about 2 hours.
When the cake is cool, make the cream cheese frosting. In a bowl, beat the cream cheese, butter, and vanilla at medium high speed until well combined, about 30 seconds, scraping down bowl with rubber spatula as needed. Add confectioners’ sugar and mix until very fluffy, about 1 minute. Put half the frosting in a separate bowl, and add 4 heaping tablespoons apricot preserve and mix.
To assemble the cake, place one layer on desired serving dish flat side down, spread the middle layer with the apricot frosting mixture, add the second layer, flat side facing up, and then frost the cake with the remaining frosting. Sprinkle on candied pecans and gently press down.