Preheat the oven to 175°C (350°F). Grease a 9-inch round cake pan and line the bottom with parchment paper. This will help prevent sticking and make removing the cake easier.
In a medium bowl, whisk together the flour, baking powder, baking soda, cinnamon, nutmeg, and salt. Set aside.
In a large mixing bowl, whisk the granulated sugar, brown sugar, and vegetable oil until combined. Add the eggs one at a time, mixing well after each addition. Stir in the vanilla extract.
Gradually add the dry ingredients to the wet mixture. Stir gently until just combined. Fold in the grated carrots and chopped pecans, if using. Avoid overmixing because it can make the cake dense.
In another bowl, beat the softened cream cheese and sugar until smooth and creamy. Add the egg, vanilla extract, bourbon, flour, and sour cream, if desired. Beat until the mixture is lump-free, but do not overmix.
Spread approximately two-thirds of the carrot cake batter into the prepared pan. Spoon the cheesecake mixture evenly over the batter, leaving a small border around the edge. Add the remaining carrot cake batter in spoonfuls across the cheesecake layer.
Using a butter knife or skewer, gently swirl the mixtures together with a few figure-eight movements. Do not over-swirl, as you want distinct ribbons of cheesecake rather than a completely blended batter.
Bake for 45–55 minutes, checking toward the end of the baking time. The cake should be set around the edges, and a toothpick inserted into a cake-only section should come out with a few moist crumbs. Avoid testing only the cheesecake swirl, which may remain creamy.
Remove the cake from the oven and let it cool in the pan for 20–30 minutes. Transfer it carefully to a rack if the pan allows. Cool completely, then refrigerate for at least 1–2 hours so the cheesecake layer can firm up.
Sprinkle chopped pecans and a little cinnamon over the top, if desired. Slice with a clean, sharp knife and wipe the blade between cuts for neat slices. Serve chilled or allow the slices to sit briefly at room temperature before serving.