# Tips and Tricks

This page contains some general tips and tricks for getting the best results out of IAI algorithms.

### When to use sample weights

Sample weights are typically used to deal with unbalanced data, especially in classification problems. A very common approach is to reweight the data so that the different classes have equal weight in the overall problem, which can be easily achieved by setting :autobalance for the sample weights.

You might also find that you can deal with class imbalances by selecting an alternative scoring criterion. In particular, both Gini Impurity and Entropy are typically effective in handling scenarios with unbalanced data.