[scikit-learn] My first Program using sklearn

Thouraya TH thouraya87 at gmail.com
Sun Aug 5 12:00:51 EDT 2018


 Hi,
Please i'd like to use prediction techniques in tenserflow.
I have this file:


x | y

1| 1
2| 4
4|16


--> prediction techniques must give me this model y=x*x


using this model i can predict the value y of x=3
This is a sample example. In my experiment i use a file with 1000 lines.
Please, how can transform these lines on codes ?


Code:

 from sklearn.preprocessing import PolynomialFeatures

from sklearn import linear_model



X = [[1, 2, 4], [1, 4, 16]]



poly = PolynomialFeatures(degree=2)



X_ = poly.fit_transform(X)


Thank you so much for help.
Kind regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20180805/7c59722c/attachment.html>


More information about the scikit-learn mailing list