values (many small ones and few very large onesis very common in practice howeverit is something most linear models can' handle very well let' try to fit ridge regression to this modelin[ ]from sklearn linear_model import ridge x_trainx_testy_trainy_test train_test_split(xyrandom_state= score ridge(fit(x_trainy_trainscore(x_testy_testprint("test score{ }format(score)out[ ]test score as you can see from the relatively low scoreridge was not able to really capture the relationship between and applying logarithmic transformation can helpthough because the value appears in the data (and the logarithm is not defined at )we can' actually just apply logbut we have to compute log( )in[ ]x_train_log np log(x_train x_test_log np log(x_test after the transformationthe distribution of the data is less asymmetrical and doesn' have very large outliers anymore (see figure - )in[ ]plt hist(np log(x_train_log[: )bins= color='gray'plt ylabel("number of appearances"plt xlabel("value" this is poisson distributionwhich is quite fundamental to count data representing data and engineering features