TikTok has become one of the social media platforms with a significant influence on public opinion formation in Indonesia. However, the linguistic characteristics of user comments which are expressive, concise, and feature emotional forms like emojis, emoticons, and excessive capitalization pose challenges for sentiment analysis. This research aims to optimize a sentiment classification model for TikTok comments using emotion-based preprocessing and hyperparameter optimization via Grid Search. The dataset comprises 4,500 comments from three different time periods discussing the Minister of Finance, Purbaya Yudhi Sadewa. Three testing scenarios were conducted: common preprocessing, emotion-based preprocessing, and a combination of emotion-based preprocessing with Grid Search. The results indicate that emotion-based preprocessing improved model accuracy by 4–5%, while Grid Search optimization provided an additional increase of up to 3%, achieving a peak F1-score of 0.92 with the LightGBM model. Analysis based on sentiment time-periods reveals that across the three different periods, sentiments remained predominantly positive. The integration of emotion-based processing and parameter tuning proved effective in enhancing the model's ability to understand emotional variations in text and to map periodic changes in public sentiment on Indonesian-language social media.