the best way to represent data depends not only on the semantics of the databut also on the kind of model you are using linear models and tree-based models (such as decision treesgradient boosted treesand random forests)two large and very commonly used familieshave very different properties when it comes to how they work with different feature representations let' go back to the wave regression dataset that we used in it has only single input feature here is comparison of linear regression model and decision tree regressor on this dataset (see figure - )in[ ]from sklearn linear_model import linearregression from sklearn tree import decisiontreeregressor xy mglearn datasets make_wave(n_samples= line np linspace(- endpoint=falsereshape(- reg decisiontreeregressor(min_samples_split= fit(xyplt plot(linereg predict(line)label="decision tree"reg linearregression(fit(xyplt plot(linereg predict(line)label="linear regression"plt plot( [: ] ' ' =' 'plt ylabel("regression output"plt xlabel("input feature"plt legend(loc="best"as you knowlinear models can only model linear relationshipswhich are lines in the case of single feature the decision tree can build much more complex model of the data howeverthis is strongly dependent on the representation of the data one way to make linear models more powerful on continuous data is to use binning (also known as discretizationof the feature to split it up into multiple featuresas described here representing data and engineering features