João Vilaça João Vilaça - 4 months ago 31
Python Question

How can train and predict models with custom data?

I have 2 arrays, one with sizes and one with prices. How can I train or predict or use a cost function (i'm a begginner yeah) so i can predict prices according to a random size?

Maybe i'm confused with the terms but I hope someone can understand. thanks.


You must use a regressor and fit it to your data. Once fitted, you can use this regressor to predict unseen samples.

Here is a link that shows all the regressors available on sklearn.

Amongst the regressors you could use I can cite : OLS, Ridge, K-NN, Decision trees, Random Forest ...

The documentation is very clear so you won't find (a priori) any difficulty.

NB :

A training dataset with 14 elements is clearly not sufficient.

Try to find out other samples to add to your dataset.