Skip to content
Snippets Groups Projects
Commit 2ebd118f authored by 지수's avatar 지수
Browse files

Update Apriori

parent 6d2b18ce
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"import seaborn as sns\n", "import seaborn as sns\n",
"import time" "import time"
], ],
"execution_count": 1, "execution_count": null,
"outputs": [] "outputs": []
}, },
{ {
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
"data = pd.read_csv('DM_data.csv')\n", "data = pd.read_csv('DM_data.csv')\n",
"data.info()" "data.info()"
], ],
"execution_count": 2, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
"from sklearn.model_selection import train_test_split\n", "from sklearn.model_selection import train_test_split\n",
"from sklearn.preprocessing import MinMaxScaler, StandardScaler" "from sklearn.preprocessing import MinMaxScaler, StandardScaler"
], ],
"execution_count": 3, "execution_count": null,
"outputs": [] "outputs": []
}, },
{ {
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
"source": [ "source": [
"from mlxtend.frequent_patterns import apriori,association_rules" "from mlxtend.frequent_patterns import apriori,association_rules"
], ],
"execution_count": 4, "execution_count": null,
"outputs": [] "outputs": []
}, },
{ {
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
"\n", "\n",
"#StandardScaler로 data scaling" "#StandardScaler로 data scaling"
], ],
"execution_count": 5, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -705,7 +705,7 @@ ...@@ -705,7 +705,7 @@
"\n", "\n",
"#classification을 위해 scaling 시킨 data들을 음수면 0, 양수면 1로 encoding" "#classification을 위해 scaling 시킨 data들을 음수면 0, 양수면 1로 encoding"
], ],
"execution_count": 6, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -1244,7 +1244,7 @@ ...@@ -1244,7 +1244,7 @@
"\n", "\n",
"#train data와 test data를 7:3 의 비율로 split" "#train data와 test data를 7:3 의 비율로 split"
], ],
"execution_count": 7, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
...@@ -1270,7 +1270,7 @@ ...@@ -1270,7 +1270,7 @@
"\n", "\n",
"df.head()" "df.head()"
], ],
"execution_count": 8, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -1582,7 +1582,7 @@ ...@@ -1582,7 +1582,7 @@
"result_desc = frequent_itemsets.sort_values(['support'],ascending =[False])\n", "result_desc = frequent_itemsets.sort_values(['support'],ascending =[False])\n",
"result_desc" "result_desc"
], ],
"execution_count": 9, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -1708,7 +1708,7 @@ ...@@ -1708,7 +1708,7 @@
"rules = rules.sort_values(['confidence','lift'], ascending=[False , False])\n", "rules = rules.sort_values(['confidence','lift'], ascending=[False , False])\n",
"rules" "rules"
], ],
"execution_count": 10, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -1917,7 +1917,7 @@ ...@@ -1917,7 +1917,7 @@
"rules_list = rules[rules['consequents'] == {\"class\"}]\n", "rules_list = rules[rules['consequents'] == {\"class\"}]\n",
"rules_list" "rules_list"
], ],
"execution_count": 11, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -2086,7 +2086,7 @@ ...@@ -2086,7 +2086,7 @@
"test = pd.DataFrame(X_test, columns=data.drop(columns = [\"index_num\"]).columns)\n", "test = pd.DataFrame(X_test, columns=data.drop(columns = [\"index_num\"]).columns)\n",
"test.head(n=10)" "test.head(n=10)"
], ],
"execution_count": 12, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "execute_result", "output_type": "execute_result",
...@@ -2627,7 +2627,7 @@ ...@@ -2627,7 +2627,7 @@
"print(test_df.shape)\n", "print(test_df.shape)\n",
"print(test_err.shape)" "print(test_err.shape)"
], ],
"execution_count": 13, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
...@@ -2658,7 +2658,7 @@ ...@@ -2658,7 +2658,7 @@
"print(test_df.shape)\n", "print(test_df.shape)\n",
"print(test_err.shape)" "print(test_err.shape)"
], ],
"execution_count": 14, "execution_count": null,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment