For the carrot cake: Preheat the oven to 350 degrees F. Grease two 9- by 13-inch rimmed baking sheets and line each baking sheet with parchment paper (see Cook's Note).
Whisk together the flour, cinnamon, baking soda, baking powder, salt, ginger and allspice in a large bowl. In a separate large bowl, whisk together the oil, pineapple, brown sugar, granulated sugar and vanilla. Beat in the eggs one at a time until well combined. Mix the dry ingredients into the wet ingredients until the batter is smooth. Set aside 2 tablespoons of the grated carrots for garnish and fold in the remaining carrots, raisins and walnuts into the cake batter.
Divide the batter between the prepared baking sheets. Bake until a toothpick inserted into the center of each cake comes out clean, 35 to 40 minutes. Let cool for 30 minutes, then transfer to cooling racks, taking the parchment off the base of each cake as you go. Allow the cakes cool completely before frosting.
For the cream cheese frosting: While the cake is baking, chill the bowl and paddle attachment for your stand mixer. Once the cake is cooled, beat together the cream cheese and butter until very smooth in the bowl of a stand mixer. Add the vanilla, then slowly add the confectioners' sugar, about 1 cup at a time. The consistency should be fairly thick yet easy to spread. If it becomes too loose, add more powdered sugar (a little at a time).
Transfer the frosting into a piping bag or a resealable plastic bag. Pipe the frosting evenly over the top of one of the cake layers. Top with the other cake layer. (If you have the time, pop the cake into the freezer here for a few minutes to make it easier to cut). Carefully cut the layered cake into 2-inch squares, so that you have individual, square, naked cakes. Pipe a little more frosting on top and decorate with the reserved grated carrots and walnuts.
You could also use one deep 9- by 13-inch baking dish, or a 13- by 18-inch rimmed baking sheet or two 9-inch round cake pans. Cooking times will vary slightly.