eef5a61
joyvan 6 years ago
2 changed file(s) with 1 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
20502050 "metadata": {},
20512051 "outputs": [],
20522052 "source": [
2053 "# 2.数据划分\n",
20542053 "from sklearn.model_selection import train_test_split\n",
20552054 "X_train,X_test,Y_train,Y_test = train_test_split(X, y, test_size=0.1, random_state=0)\n"
20562055 ]
21062105 "metadata": {},
21072106 "outputs": [],
21082107 "source": [
2109 "# 5.模型评估\n",
21102108 "print(\"\\n得出来的权重:\", estimator.coef_)\n",
21112109 "print(\"\\nLogistic Regression模型训练集的准确率:%.1f%%\" %(estimator.score(X_train, Y_train)*100))"
21122110 ]
1717 "cell_type": "markdown",
1818 "metadata": {},
1919 "source": [
20 "<img src=\"https://s3.amazonaws.com/keras.io/img/keras-logo-2018-large-1200.png\" width=300>\n",
20 "<img src=\"http://imgbed.momodel.cn//20200112152635.png\" width=300>\n",
2121 "\n",
2222 "Keras 是一个用 Python 编写的高级神经网络 API,它能够以 TensorFlow,CNTK 或者 Theano 作为后端运行。\n",
2323 "\n",