Prepare a 9×13 casserole dish by greasing the inside with butter or cooking spray (or see above for how I bake it in an enamel braiser).
Shred the cheeses: cheddar and parmesan. Mix together, then separate into two: 3/4 cup goes into the sauce, 1 1/2 cups goes on top. Set aside for now.
Peel and thinly slice the sweet potatoes, about 1/8 inch thick. Add to the prepared baking dish.
In a skillet add about 2 tbsp olive oil, then over low-medium heat sauté the shallots and garlic until tender.
Stir in the flour, cook for about 2 minutes.
Add the salt, pepper, paprika, fresh rosemary and cinnamon. Sauté for about 2 minutes.
Slowly whisk in the milk.
Then add the cream cheese and 3/4 cup of shredded cheese and stir until melted. Don’t let the mixture boil.
Pour the milk/cheese mixture over the potatoes, making sure to cover them well. Press any exposed sweet potatoes down into the cream sauce.
Sprinkle on the remaining 1 1/2 cups of shredded cheese.
Cover (with foil or an oven proof lid) and bake for 1 hour.
Then after this time, remove the cover and continue to bake for 30 minutes more, until the top is golden brown and bubbling and the sweet potatoes are tender.
Let the dish stand for about 15 minutes before serving.