{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Getting start with the classification problem.\n", "\n", "Let's start with the baby step example for classification problem.\n", "Below is the basic example of the configuration for binary classification problem using example data contained in the package. For the required data type or more detailed configuration, please check the detailed information about each option in the [documantation](https://young-won.github.io/deepbiome/prerequisites.html#configuration) and the detailed [examples](https://young-won.github.io/deepbiome/example_with_the_list_of_inputs.html)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from pkg_resources import resource_filename" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "network_info = {\n", " 'architecture_info': {\n", " 'batch_normalization': 'False',\n", " 'drop_out': '0',\n", " 'weight_initial': 'glorot_uniform',\n", " 'weight_l1_penalty':'0.01',\n", " 'weight_decay': 'phylogenetic_tree',\n", " },\n", " 'model_info': {\n", " 'decay': '0.001',\n", " 'loss': 'binary_crossentropy',\n", " 'lr': '0.01',\n", " 'metrics': 'binary_accuracy, sensitivity, specificity, gmeasure, auc',\n", " 'network_class': 'DeepBiomeNetwork',\n", " 'normalizer': 'normalize_minmax',\n", " 'optimizer': 'adam',\n", " 'reader_class': 'MicroBiomeClassificationReader',\n", " 'taxa_selection_metrics': 'sensitivity, specificity, gmeasure, accuracy',\n", " },\n", " 'training_info': {\n", " 'batch_size': '200', \n", " 'epochs': '10',\n", " 'callbacks': 'ModelCheckpoint',\n", " 'monitor': 'val_loss',\n", " 'mode' : 'min',\n", " 'min_delta': '1e-7',\n", " },\n", " 'validation_info': {\n", " 'batch_size': 'None', \n", " 'validation_size': '0.2'\n", " },\n", " 'test_info': {\n", " 'batch_size': 'None',\n", " },\n", "}\n", "\n", "path_info = {\n", " 'data_info': {\n", " 'data_path': resource_filename('deepbiome', 'tests/data'),\n", " 'idx_path': resource_filename('deepbiome', 'tests/data/onefile_idx.csv'),\n", " 'tree_info_path': resource_filename('deepbiome', 'tests/data/genus48_dic.csv'),\n", " 'x_path': 'onefile_x.csv',\n", " 'y_path': 'classification_y.csv'\n", " },\n", " 'model_info': {\n", " 'evaluation': 'eval.npy',\n", " 'history': 'hist.json',\n", " 'model_dir': './',\n", " 'weight': 'weight.h5'\n", " }\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For logging, we used the python logging library." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import logging\n", "\n", "logging.basicConfig(format = '[%(name)-8s|%(levelname)s|%(filename)s:%(lineno)s] %(message)s',\n", " level=logging.DEBUG)\n", "log = logging.getLogger()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is the `deepbiome.deepbiome_train` function for training:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Using TensorFlow backend.\n", "[root |INFO|deepbiome.py:115] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:153] -------1 simulation start!----------------------------------\n", "[root |INFO|readers.py:58] -----------------------------------------------------------------------\n", "[root |INFO|readers.py:59] Construct Dataset\n", "[root |INFO|readers.py:60] -----------------------------------------------------------------------\n", "[root |INFO|readers.py:61] Load data\n", "[root |INFO|deepbiome.py:164] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:165] Build network for 1 simulation\n", "[root |INFO|build_network.py:521] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:522] Read phylogenetic tree information from /DATA/home/muha/github_repos/deepbiome/deepbiome/tests/data/genus48_dic.csv\n", "[root |INFO|build_network.py:528] Phylogenetic tree level list: ['Genus', 'Family', 'Order', 'Class', 'Phylum']\n", "[root |INFO|build_network.py:529] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:537] Genus: 48\n", "[root |INFO|build_network.py:537] Family: 40\n", "[root |INFO|build_network.py:537] Order: 23\n", "[root |INFO|build_network.py:537] Class: 17\n", "[root |INFO|build_network.py:537] Phylum: 9\n", "[root |INFO|build_network.py:546] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:547] Phylogenetic_tree_dict info: ['Class', 'Number', 'Order', 'Family', 'Phylum', 'Genus']\n", "[root |INFO|build_network.py:548] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:558] Build edge weights between [ Genus, Family]\n", "[root |INFO|build_network.py:558] Build edge weights between [Family, Order]\n", "[root |INFO|build_network.py:558] Build edge weights between [ Order, Class]\n", "[root |INFO|build_network.py:558] Build edge weights between [ Class, Phylum]\n", "[root |INFO|build_network.py:571] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:586] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:587] Build network based on phylogenetic tree information\n", "[root |INFO|build_network.py:588] ------------------------------------------------------------------------------------------\n", "[tensorflow|WARNING|deprecation.py:328] From /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/resource_variable_ops.py:432: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n", "Instructions for updating:\n", "Colocations handled automatically by placer.\n", "[root |INFO|build_network.py:670] ------------------------------------------------------------------------------------------\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Model: \"model_1\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", "input (InputLayer) (None, 48) 0 \n", "_________________________________________________________________\n", "l1_dense (Dense_with_tree) (None, 40) 1960 \n", "_________________________________________________________________\n", "l1_activation (Activation) (None, 40) 0 \n", "_________________________________________________________________\n", "l2_dense (Dense_with_tree) (None, 23) 943 \n", "_________________________________________________________________\n", "l2_activation (Activation) (None, 23) 0 \n", "_________________________________________________________________\n", "l3_dense (Dense_with_tree) (None, 17) 408 \n", "_________________________________________________________________\n", "l3_activation (Activation) (None, 17) 0 \n", "_________________________________________________________________\n", "l4_dense (Dense_with_tree) (None, 9) 162 \n", "_________________________________________________________________\n", "l4_activation (Activation) (None, 9) 0 \n", "_________________________________________________________________\n", "last_dense_h (Dense) (None, 1) 10 \n", "_________________________________________________________________\n", "p_hat (Activation) (None, 1) 0 \n", "=================================================================\n", "Total params: 3,483\n", "Trainable params: 3,483\n", "Non-trainable params: 0\n", "_________________________________________________________________\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:61] Build Network\n", "[root |INFO|build_network.py:62] Optimizer = adam\n", "[root |INFO|build_network.py:63] Loss = binary_crossentropy\n", "[root |INFO|build_network.py:64] Metrics = binary_accuracy, sensitivity, specificity, gmeasure, auc\n", "[root |INFO|deepbiome.py:176] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:177] 1 fold computing start!----------------------------------\n", "[root |INFO|build_network.py:137] Training start!\n", "[tensorflow|WARNING|deprecation.py:328] From /usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/math_ops.py:2862: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n", "Instructions for updating:\n", "Use tf.cast instead.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train on 640 samples, validate on 160 samples\n", "Epoch 1/10\n", "640/640 [==============================] - 1s 1ms/step - loss: 0.6898 - binary_accuracy: 0.6047 - sensitivity: 0.8222 - specificity: 0.1731 - gmeasure: 0.1118 - auc: 0.4496 - val_loss: 0.6786 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.4840\n", "Epoch 2/10\n", "640/640 [==============================] - 0s 205us/step - loss: 0.6752 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5014 - val_loss: 0.6618 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5005\n", "Epoch 3/10\n", "640/640 [==============================] - 0s 90us/step - loss: 0.6596 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5386 - val_loss: 0.6450 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5134\n", "Epoch 4/10\n", "640/640 [==============================] - 0s 63us/step - loss: 0.6434 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.4943 - val_loss: 0.6301 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5203\n", "Epoch 5/10\n", "640/640 [==============================] - 0s 78us/step - loss: 0.6323 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5018 - val_loss: 0.6195 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5243\n", "Epoch 6/10\n", "640/640 [==============================] - 0s 68us/step - loss: 0.6243 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5288 - val_loss: 0.6160 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5334\n", "Epoch 7/10\n", "640/640 [==============================] - 0s 62us/step - loss: 0.6238 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5577 - val_loss: 0.6169 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5526\n", "Epoch 8/10\n", "640/640 [==============================] - 0s 81us/step - loss: 0.6257 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5954 - val_loss: 0.6169 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5736\n", "Epoch 9/10\n", "640/640 [==============================] - ETA: 0s - loss: 0.6430 - binary_accuracy: 0.6650 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.53 - 0s 78us/step - loss: 0.6254 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.6563 - val_loss: 0.6161 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.6002\n", "Epoch 10/10\n", "640/640 [==============================] - 0s 91us/step - loss: 0.6238 - binary_accuracy: 0.6844 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.6318 - val_loss: 0.6161 - val_binary_accuracy: 0.6938 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.6208\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:87] Load trained model weight at ./weight_0.h5 \n", "[root |INFO|build_network.py:147] Training end with time 3.954432725906372!\n", "[root |INFO|build_network.py:83] Saved trained model weight at ./weight_0.h5 \n", "[root |DEBUG|deepbiome.py:185] Save weight at ./weight_0.h5\n", "[root |DEBUG|deepbiome.py:188] Save history at ./hist_0.json\n", "[root |INFO|build_network.py:173] Evaluation start!\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "800/800 [==============================] - 0s 7us/step\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:178] Evaluation end with time 0.015036821365356445!\n", "[root |INFO|build_network.py:179] Evaluation: [0.6221581101417542, 0.6862499713897705, 1.0, 0.0, 0.0, 0.5438174605369568]\n", "[root |INFO|build_network.py:173] Evaluation start!\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "200/200 [==============================] - 0s 22us/step\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:178] Evaluation end with time 0.013112068176269531!\n", "[root |INFO|build_network.py:179] Evaluation: [0.6190831661224365, 0.6899999976158142, 1.0, 0.0, 0.0, 0.6127863526344299]\n", "[root |INFO|deepbiome.py:199] Compute time : 5.095764636993408\n", "[root |INFO|deepbiome.py:200] 1 fold computing end!---------------------------------------------\n", "[root |INFO|deepbiome.py:153] -------2 simulation start!----------------------------------\n", "[root |INFO|readers.py:58] -----------------------------------------------------------------------\n", "[root |INFO|readers.py:59] Construct Dataset\n", "[root |INFO|readers.py:60] -----------------------------------------------------------------------\n", "[root |INFO|readers.py:61] Load data\n", "[root |INFO|deepbiome.py:164] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:165] Build network for 2 simulation\n", "[root |INFO|build_network.py:521] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:522] Read phylogenetic tree information from /DATA/home/muha/github_repos/deepbiome/deepbiome/tests/data/genus48_dic.csv\n", "[root |INFO|build_network.py:528] Phylogenetic tree level list: ['Genus', 'Family', 'Order', 'Class', 'Phylum']\n", "[root |INFO|build_network.py:529] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:537] Genus: 48\n", "[root |INFO|build_network.py:537] Family: 40\n", "[root |INFO|build_network.py:537] Order: 23\n", "[root |INFO|build_network.py:537] Class: 17\n", "[root |INFO|build_network.py:537] Phylum: 9\n", "[root |INFO|build_network.py:546] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:547] Phylogenetic_tree_dict info: ['Class', 'Number', 'Order', 'Family', 'Phylum', 'Genus']\n", "[root |INFO|build_network.py:548] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:558] Build edge weights between [ Genus, Family]\n", "[root |INFO|build_network.py:558] Build edge weights between [Family, Order]\n", "[root |INFO|build_network.py:558] Build edge weights between [ Order, Class]\n", "[root |INFO|build_network.py:558] Build edge weights between [ Class, Phylum]\n", "[root |INFO|build_network.py:571] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:586] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:587] Build network based on phylogenetic tree information\n", "[root |INFO|build_network.py:588] ------------------------------------------------------------------------------------------\n", "[root |INFO|build_network.py:670] ------------------------------------------------------------------------------------------\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Model: \"model_1\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", "input (InputLayer) (None, 48) 0 \n", "_________________________________________________________________\n", "l1_dense (Dense_with_tree) (None, 40) 1960 \n", "_________________________________________________________________\n", "l1_activation (Activation) (None, 40) 0 \n", "_________________________________________________________________\n", "l2_dense (Dense_with_tree) (None, 23) 943 \n", "_________________________________________________________________\n", "l2_activation (Activation) (None, 23) 0 \n", "_________________________________________________________________\n", "l3_dense (Dense_with_tree) (None, 17) 408 \n", "_________________________________________________________________\n", "l3_activation (Activation) (None, 17) 0 \n", "_________________________________________________________________\n", "l4_dense (Dense_with_tree) (None, 9) 162 \n", "_________________________________________________________________\n", "l4_activation (Activation) (None, 9) 0 \n", "_________________________________________________________________\n", "last_dense_h (Dense) (None, 1) 10 \n", "_________________________________________________________________\n", "p_hat (Activation) (None, 1) 0 \n", "=================================================================\n", "Total params: 3,483\n", "Trainable params: 3,483\n", "Non-trainable params: 0\n", "_________________________________________________________________\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:61] Build Network\n", "[root |INFO|build_network.py:62] Optimizer = adam\n", "[root |INFO|build_network.py:63] Loss = binary_crossentropy\n", "[root |INFO|build_network.py:64] Metrics = binary_accuracy, sensitivity, specificity, gmeasure, auc\n", "[root |INFO|deepbiome.py:176] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:177] 2 fold computing start!----------------------------------\n", "[root |INFO|build_network.py:137] Training start!\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Train on 640 samples, validate on 160 samples\n", "Epoch 1/10\n", "640/640 [==============================] - 1s 1ms/step - loss: 0.6910 - binary_accuracy: 0.6062 - sensitivity: 0.7500 - specificity: 0.2500 - gmeasure: 0.0000e+00 - auc: 0.5193 - val_loss: 0.6810 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5068\n", "Epoch 2/10\n", "640/640 [==============================] - 0s 62us/step - loss: 0.6791 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.4727 - val_loss: 0.6677 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.4705\n", "Epoch 3/10\n", "640/640 [==============================] - 0s 61us/step - loss: 0.6666 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5033 - val_loss: 0.6550 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.4520\n", "Epoch 4/10\n", "640/640 [==============================] - 0s 74us/step - loss: 0.6557 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5027 - val_loss: 0.6428 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.4691\n", "Epoch 5/10\n", "640/640 [==============================] - 0s 74us/step - loss: 0.6456 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5123 - val_loss: 0.6316 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.4974\n", "Epoch 6/10\n", "640/640 [==============================] - 0s 61us/step - loss: 0.6358 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5090 - val_loss: 0.6218 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5056\n", "Epoch 7/10\n", "640/640 [==============================] - 0s 91us/step - loss: 0.6285 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5027 - val_loss: 0.6129 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5174\n", "Epoch 8/10\n", "640/640 [==============================] - 0s 60us/step - loss: 0.6203 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.4762 - val_loss: 0.6051 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5225\n", "Epoch 9/10\n", "640/640 [==============================] - 0s 59us/step - loss: 0.6145 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.4875 - val_loss: 0.5979 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5271\n", "Epoch 10/10\n", "640/640 [==============================] - 0s 77us/step - loss: 0.6093 - binary_accuracy: 0.7156 - sensitivity: 1.0000 - specificity: 0.0000e+00 - gmeasure: 0.0000e+00 - auc: 0.5059 - val_loss: 0.5916 - val_binary_accuracy: 0.7375 - val_sensitivity: 1.0000 - val_specificity: 0.0000e+00 - val_gmeasure: 0.0000e+00 - val_auc: 0.5252\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:87] Load trained model weight at ./weight_1.h5 \n", "[root |INFO|build_network.py:147] Training end with time 2.9402072429656982!\n", "[root |INFO|build_network.py:83] Saved trained model weight at ./weight_1.h5 \n", "[root |DEBUG|deepbiome.py:185] Save weight at ./weight_1.h5\n", "[root |DEBUG|deepbiome.py:188] Save history at ./hist_1.json\n", "[root |INFO|build_network.py:173] Evaluation start!\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "800/800 [==============================] - 0s 8us/step\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:178] Evaluation end with time 0.013414382934570312!\n", "[root |INFO|build_network.py:179] Evaluation: [0.6027529239654541, 0.7200000286102295, 1.0, 0.0, 0.0, 0.4951443076133728]\n", "[root |INFO|build_network.py:173] Evaluation start!\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "200/200 [==============================] - 0s 28us/step\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[root |INFO|build_network.py:178] Evaluation end with time 0.011273860931396484!\n", "[root |INFO|build_network.py:179] Evaluation: [0.6027520895004272, 0.7200000286102295, 1.0, 0.0, 0.0, 0.4978918731212616]\n", "[root |INFO|deepbiome.py:199] Compute time : 3.5541372299194336\n", "[root |INFO|deepbiome.py:200] 2 fold computing end!---------------------------------------------\n", "[root |INFO|deepbiome.py:211] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:212] Train Evaluation : ['loss' 'binary_accuracy' 'sensitivity' 'specificity' 'gmeasure' 'auc']\n", "[root |INFO|deepbiome.py:213] mean : [0.612 0.703 1.000 0.000 0.000 0.519]\n", "[root |INFO|deepbiome.py:214] std : [0.010 0.017 0.000 0.000 0.000 0.024]\n", "[root |INFO|deepbiome.py:215] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:216] Test Evaluation : ['loss' 'binary_accuracy' 'sensitivity' 'specificity' 'gmeasure' 'auc']\n", "[root |INFO|deepbiome.py:217] mean : [0.611 0.705 1.000 0.000 0.000 0.555]\n", "[root |INFO|deepbiome.py:218] std : [0.008 0.015 0.000 0.000 0.000 0.057]\n", "[root |INFO|deepbiome.py:219] -----------------------------------------------------------------\n", "[root |INFO|deepbiome.py:230] Total Computing Ended\n", "[root |INFO|deepbiome.py:231] -----------------------------------------------------------------\n" ] } ], "source": [ "from deepbiome import deepbiome\n", "\n", "test_evaluation, train_evaluation, network = deepbiome.deepbiome_train(log, network_info, path_info, number_of_fold=2)" ] } ], "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.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }