Preheat the oven to 325 degrees F (165 degrees C). Cut a rectangle out of waxed paper to fit an 8x12-inch cake pan. Spray the pan with cooking spray, then place waxed paper liner over the bottom.
Melt butter in a large skillet. Add 2 cups sugar and cook until sugar has dissolved and mixture is bubbling, about 3 minutes. Add pear slices; reduce heat to low and cook for 5 minutes. Turn off heat and add cranberries.
Whisk flour, baking soda, cinnamon, salt, cloves, and nutmeg together in a bowl.
Combine remaining 2 cups sugar, milk, oil, eggs, and vanilla in another bowl using a hand mixer until cake batter is smooth. Gradually mix in dry ingredients until well combined. Fold in walnuts.
Pour pear-cranberry mixture into the prepared cake pan. Use a spatula to spread cake batter evenly on top of fruit.
Bake in the preheated oven until a toothpick inserted into the center comes out clean, about 70 minutes. Remove from the oven and cool on a wire rack for 10 minutes.
Place a platter on top of the cake pan and carefully flip the pan and platter over, allowing the cake to settle on the platter. Lift cake pan off and serve.