67 lines
1.4 KiB
Plaintext
67 lines
1.4 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"[ 126.84247142 125.01176842]\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"from sklearn.preprocessing import PolynomialFeatures\n",
|
|
"from sklearn import linear_model\n",
|
|
"import matplotlib.pyplot as plt \n",
|
|
"\n",
|
|
"X = [[0.44, 0.68], [0.99, 0.23]]\n",
|
|
"vector = [109.85, 155.72]\n",
|
|
"predict= [[0.49, 0.18], [0.47, 0.22]]\n",
|
|
"\n",
|
|
"poly = PolynomialFeatures(degree=2)\n",
|
|
"X_ = poly.fit_transform(X)\n",
|
|
"predict_ = poly.fit_transform(predict)\n",
|
|
"\n",
|
|
"clf = linear_model.LinearRegression()\n",
|
|
"clf.fit(X_, vector)\n",
|
|
"y=clf.predict(predict_)\n",
|
|
"print (clf.predict(predict_))\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.6.3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|