Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
woodRock committed Feb 27, 2024
1 parent 81f6534 commit 50ebba9
Showing 1 changed file with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1589,44 +1589,45 @@
{
"cell_type": "code",
"source": [
"evaluate_classification(hof[5], verbose=True)"
"evaluate_classification(hof[0], verbose=True)"
],
"metadata": {
"id": "Bf5CtPl1OmD2",
"outputId": "a3e5e51a-2a39-4ffe-9fdc-4963f3fb0d66",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"id": "Bf5CtPl1OmD2",
"outputId": "e586caa8-0e2c-4815-8760-c63de84ffa10"
},
"execution_count": 93,
"execution_count": 113,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Train accuracy: 0.75, Validation accuracy: 0.25, Test accuracy: 0.625\n",
"Train intra-class: 0.01010067071847364, Val intra-class: 0.040860701995226026\n",
"Train inter-class: 0.030589506073171104, Val inter-class: 0.02462512581591685\n"
"Train accuracy: 1.0, Validation accuracy: 1.0, Test accuracy: 0.75\n",
"Train intra-class: 0.020913951056888987, Val intra-class: 0.003623208743376263\n",
"Train inter-class: 0.02345620832973173, Val inter-class: 0.04916539597760036\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"(0.4997873370412306,)"
"(0.9024042222253533,)"
]
},
"metadata": {},
"execution_count": 93
"execution_count": 113
}
]
},
{
"cell_type": "code",
"source": [
"X_train, X_temp, y_train, y_temp = train_test_split(X, y, stratify=y, test_size=0.66, random_state=42)\n",
"X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, stratify=y_temp, test_size=0.5, random_state=42)\n",
"# X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, test_size=0.5, random_state=42)\n",
"train_split = 0.66\n",
"X_train, X_temp, y_train, y_temp = train_test_split(X, y, stratify=y, test_size=(1-train_split), random_state=42)\n",
"# X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, stratify=y_temp, test_size=0.5, random_state=42)\n",
"X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, test_size=0.5, random_state=42)\n",
"\n",
"\n",
"# print(f\"np.unique(y_train): {np.unique(y_train)}\\n np.unique(y_val): {np.unique(y_val)} \\n np.unique(y_test): {np.unique(y_test)}\")\n",
Expand All @@ -1647,29 +1648,29 @@
"base_uri": "https://localhost:8080/"
},
"id": "SZrI3MjywK_K",
"outputId": "16635906-f567-4792-f9a7-2234295c7c5d"
"outputId": "3d9076a0-138a-4be1-ed83-1a72dbf7ada2"
},
"execution_count": 87,
"execution_count": 114,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"train: [0. 1. 2. 3. 4. 5.]\n",
"Class Counts: [2 2 1 2 2 1], Class Ratios: [0.06666667 0.06666667 0.03333333 0.06666667 0.06666667 0.03333333]\n",
"Class Counts: [4 4 2 4 3 2], Class Ratios: [0.13333333 0.13333333 0.06666667 0.13333333 0.1 0.06666667]\n",
"Number of features: 1023\n",
"Number of instances: 30\n",
"Number of classes 6.\n",
"val: [0. 1. 2. 3. 4. 5.]\n",
"Class Counts: [2 2 1 2 2 1], Class Ratios: [0.06666667 0.06666667 0.03333333 0.06666667 0.06666667 0.03333333]\n",
"val: [0. 2. 3. 4.]\n",
"Class Counts: [2 1 1 1], Class Ratios: [0.06666667 0.03333333 0.03333333 0.03333333]\n",
"Number of features: 1023\n",
"Number of instances: 30\n",
"Number of classes 6.\n",
"test: [0. 1. 2. 3. 4. 5.]\n",
"Class Counts: [2 2 1 2 2 1], Class Ratios: [0.06666667 0.06666667 0.03333333 0.06666667 0.06666667 0.03333333]\n",
"Number of classes 4.\n",
"test: [1. 3. 4. 5.]\n",
"Class Counts: [2 1 2 1], Class Ratios: [0.06666667 0.03333333 0.06666667 0.03333333]\n",
"Number of features: 1023\n",
"Number of instances: 30\n",
"Number of classes 6.\n"
"Number of classes 4.\n"
]
}
]
Expand All @@ -1685,7 +1686,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 115,
"metadata": {
"id": "pEqouLDs4xBJ"
},
Expand Down Expand Up @@ -1720,6 +1721,7 @@
"\n",
"| Date | Title | Description | Update |\n",
"| --- | --- | --- | ---- |\n",
"| 2024-02-27 16:31 | Fix fitness | Fixed fitness function to penalize intra-class distance <br> and reward inter-class distance. |\n",
"| 2024-02-26 15:59 | Intra/inter | Updated fitness value to include a normalized sum of <br> intraclass and interclass distance |\n",
"| 2024-02-14 16:56 | Mass spectra | Applications for MT-GP for rapid mass spectrometry dataset. | |\n",
"| 2022-08-21 17:30 | Multi-Objective - Onehot Encoding | Change to multi-objective problem, one-vs-all with a tree classifier for each class.<br> Y labels are encoded in onehot encodings, error is absolute difference between $|\\hat{y} - y|$|\n",
Expand Down Expand Up @@ -1749,7 +1751,7 @@
"machine_shape": "hm",
"provenance": [],
"mount_file_id": "1Yg4t38NHSYPAlu_099cQeOR-qSwIaaTl",
"authorship_tag": "ABX9TyP6O28Yu8hU6dhjCcl2cFFD",
"authorship_tag": "ABX9TyN62J1TwVCMTDGBsq91KjUA",
"include_colab_link": true
},
"gpuClass": "standard",
Expand Down

0 comments on commit 50ebba9

Please sign in to comment.