Irony is a linguistic phenomenon that can be seen as a funny or strange aspect of a situation that is very different from what is expected, using words that say the opposite of what they really mean, often as a joke, and with a voice that shows that. When it is just text, detecting irony becomes quite challenging. In this paper, we adopt an approach organized into three stages: feature extraction, sampling techniques, and feature selection to detect ironic texts written in the Portuguese language. We evaluate our strategy on the IDPT corpus and achieve 0.55 balanced accuracy, outperforming state-of-the-art results. Moreover, we found out that both sampling techniques and feature selection may improve the results.