Appropriate way to thank a professor towards the end of the semester
In the U.S., probably best to not express thanks publicly, unless you are thinking to get others to join in. If you can put a thank-you note in the professor's paper-mail mailbox in their department, that might be optimal. It does demonstrate a bit more effort (and, thus, more non-trivial expression of thanks) than just an email, for example.

But an email thank-you is good, too.

And, yes, probably better to wait until after grades are settled, if there's any potential volatility there. Don't want to create even a hint of conflict-of-interest on any side.