{"cells":[{"metadata":{},"cell_type":"markdown","source":"# Overview\n\nThis notebook performs training more more than one model with TPU, performs inference for each of them and creates a baseline ensemble out of them.","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"!pip install -q efficientnet ","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","trusted":true},"cell_type":"code","source":"import os\nimport re\n\nimport numpy as np\nimport pandas as pd\nimport math\n\nfrom matplotlib import pyplot as plt\n\nfrom sklearn import metrics\nfrom sklearn.model_selection import train_test_split\n\nimport tensorflow as tf\nimport tensorflow.keras.layers as L\n\nimport efficientnet.tfkeras as efn\n\nfrom kaggle_datasets import KaggleDatasets","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## Training Configuration","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"TRAINING = False # set to True if you wanna train ze models!","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# TPU Strategy and other configs ","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"# Detect hardware, return appropriate distribution strategy\ntry:\n    # TPU detection. No parameters necessary if TPU_NAME environment variable is\n    # set: this is always the case on Kaggle.\n    tpu = tf.distribute.cluster_resolver.TPUClusterResolver()\n    print('Running on TPU ', tpu.master())\nexcept ValueError:\n    tpu = None\n\nif tpu:\n    tf.config.experimental_connect_to_cluster(tpu)\n    tf.tpu.experimental.initialize_tpu_system(tpu)\n    strategy = tf.distribute.experimental.TPUStrategy(tpu)\nelse:\n    # Default distribution strategy in Tensorflow. Works on CPU and single GPU.\n    strategy = tf.distribute.get_strategy()\n\nprint(\"REPLICAS: \", strategy.num_replicas_in_sync)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# For tf.dataset\nAUTO = tf.data.experimental.AUTOTUNE\n\n# Data access\nGCS_PATH = KaggleDatasets().get_gcs_path('siim-isic-melanoma-classification')\n\n# Configuration\nEPOCHS = 5\nBATCH_SIZE = 8 * strategy.num_replicas_in_sync\nIMAGE_SIZE = [1024, 1024]","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Load Labels and Paths","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"def append_path(pre):\n    return np.vectorize(lambda file: os.path.join(GCS_DS_PATH, pre, file))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"sub = pd.read_csv('/kaggle/input/siim-isic-melanoma-classification/sample_submission.csv')\nTRAINING_FILENAMES = tf.io.gfile.glob(GCS_PATH + '/tfrecords/train*.tfrec')\nTEST_FILENAMES = tf.io.gfile.glob(GCS_PATH + '/tfrecords/test*.tfrec')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"print(len(TRAINING_FILENAMES))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"print(TRAINING_FILENAMES)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"VALIDATION_FILENAMES = TRAINING_FILENAMES[int(0.8*len(TRAINING_FILENAMES)):]\nTRAINING_FILENAMES = TRAINING_FILENAMES[:int(0.8*len(TRAINING_FILENAMES))]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"len(TRAINING_FILENAMES)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"len(VALIDATION_FILENAMES)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def decode_image(image_data):\n    image = tf.image.decode_jpeg(image_data, channels=3)\n    image = tf.cast(image, tf.float32) / 255.0  # convert image to floats in [0, 1] range\n    image = tf.reshape(image, [*IMAGE_SIZE, 3]) # explicit size needed for TPU\n    return image\n\ndef read_labeled_tfrecord(example):\n    LABELED_TFREC_FORMAT = {\n        \"image\": tf.io.FixedLenFeature([], tf.string), # tf.string means bytestring\n        #\"class\": tf.io.FixedLenFeature([], tf.int64),  # shape [] means single element\n        \"target\": tf.io.FixedLenFeature([], tf.int64),  # shape [] means single element\n    }\n    example = tf.io.parse_single_example(example, LABELED_TFREC_FORMAT)\n    image = decode_image(example['image'])\n    #label = tf.cast(example['class'], tf.int32)\n    label = tf.cast(example['target'], tf.int32)\n    return image, label # returns a dataset of (image, label) pairs\n\ndef read_unlabeled_tfrecord(example):\n    UNLABELED_TFREC_FORMAT = {\n        \"image\": tf.io.FixedLenFeature([], tf.string), # tf.string means bytestring\n        \"image_name\": tf.io.FixedLenFeature([], tf.string),  # shape [] means single element\n        # class is missing, this competitions's challenge is to predict flower classes for the test dataset\n    }\n    example = tf.io.parse_single_example(example, UNLABELED_TFREC_FORMAT)\n    image = decode_image(example['image'])\n    idnum = example['image_name']\n    return image, idnum # returns a dataset of image(s)\n\ndef load_dataset(filenames, labeled=True, ordered=False):\n    # Read from TFRecords. For optimal performance, reading from multiple files at once and\n    # disregarding data order. Order does not matter since we will be shuffling the data anyway.\n\n    ignore_order = tf.data.Options()\n    if not ordered:\n        ignore_order.experimental_deterministic = False # disable order, increase speed\n\n    dataset = tf.data.TFRecordDataset(filenames, num_parallel_reads=AUTO) # automatically interleaves reads from multiple files\n    dataset = dataset.with_options(ignore_order) # uses data as soon as it streams in, rather than in its original order\n    dataset = dataset.map(read_labeled_tfrecord if labeled else read_unlabeled_tfrecord, num_parallel_calls=AUTO)\n    # returns a dataset of (image, label) pairs if labeled=True or (image, id) pairs if labeled=False\n    return dataset\n\ndef data_augment(image, label):\n    # data augmentation. Thanks to the dataset.prefetch(AUTO) statement in the next function (below),\n    # this happens essentially for free on TPU. Data pipeline code is executed on the \"CPU\" part\n    # of the TPU while the TPU itself is computing gradients.\n    image = tf.image.random_flip_left_right(image)\n    #image = tf.image.random_saturation(image, 0, 2)\n    return image, label   \n\ndef get_training_dataset():\n    dataset = load_dataset(TRAINING_FILENAMES, labeled=True)\n    dataset = dataset.map(data_augment, num_parallel_calls=AUTO)\n    dataset = dataset.repeat() # the training dataset must repeat for several epochs\n    dataset = dataset.shuffle(2048)\n    dataset = dataset.batch(BATCH_SIZE)\n    dataset = dataset.prefetch(AUTO) # prefetch next batch while training (autotune prefetch buffer size)\n    return dataset\n\ndef get_validation_dataset(ordered=False):\n    dataset = load_dataset(VALIDATION_FILENAMES, labeled=True, ordered=ordered)\n    dataset = dataset.batch(BATCH_SIZE)\n    dataset = dataset.cache()\n    dataset = dataset.prefetch(AUTO) # prefetch next batch while training (autotune prefetch buffer size)\n    return dataset\n\ndef get_test_dataset(ordered=False):\n    dataset = load_dataset(TEST_FILENAMES, labeled=False, ordered=ordered)\n    dataset = dataset.batch(BATCH_SIZE)\n    dataset = dataset.prefetch(AUTO) # prefetch next batch while training (autotune prefetch buffer size)\n    return dataset\n\ndef count_data_items(filenames):\n    # the number of data items is written in the name of the .tfrec files, i.e. flowers00-230.tfrec = 230 data items\n    n = [int(re.compile(r\"-([0-9]*)\\.\").search(filename).group(1)) for filename in filenames]\n    return np.sum(n)\n\nNUM_TRAINING_IMAGES = count_data_items(TRAINING_FILENAMES)\nNUM_TEST_IMAGES = count_data_items(TEST_FILENAMES)\nSTEPS_PER_EPOCH = NUM_TRAINING_IMAGES // BATCH_SIZE\nprint('Dataset: {} training images, {} unlabeled test images'.format(NUM_TRAINING_IMAGES, NUM_TEST_IMAGES))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def build_lrfn(lr_start=0.00001, lr_max=0.000075, \n               lr_min=0.000001, lr_rampup_epochs=20, \n               lr_sustain_epochs=0, lr_exp_decay=.8):\n    lr_max = lr_max * strategy.num_replicas_in_sync\n\n    def lrfn(epoch):\n        if epoch < lr_rampup_epochs:\n            lr = (lr_max - lr_start) / lr_rampup_epochs * epoch + lr_start\n        elif epoch < lr_rampup_epochs + lr_sustain_epochs:\n            lr = lr_max\n        else:\n            lr = (lr_max - lr_min) * lr_exp_decay**(epoch - lr_rampup_epochs - lr_sustain_epochs) + lr_min\n        return lr\n    \n    return lrfn","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Models","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    with strategy.scope():\n        model = tf.keras.Sequential([\n            efn.EfficientNetB7(\n                input_shape=(*IMAGE_SIZE, 3),\n                weights='imagenet',\n                include_top=False\n            ),\n            L.GlobalAveragePooling2D(),\n            L.Dense(1, activation='sigmoid')\n        ])\n        model.compile(\n            optimizer='adam',\n            loss = 'binary_crossentropy',\n            metrics=['accuracy']\n        )\n        model.summary()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    with strategy.scope():\n        model2 = tf.keras.Sequential([\n            efn.EfficientNetB0(\n                input_shape=(*IMAGE_SIZE, 3),\n                weights='imagenet',\n                include_top=False\n            ),\n            L.GlobalAveragePooling2D(),\n            L.Dense(1, activation='sigmoid')\n        ])\n        model2.compile(\n            optimizer='adam',\n            loss = 'binary_crossentropy',\n            metrics=['accuracy']\n        )\n        model2.summary()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"from tensorflow.keras.applications import DenseNet201\n\nif TRAINING:\n    with strategy.scope():\n        dnet201 = DenseNet201(\n            input_shape=(*IMAGE_SIZE, 3),\n            weights='imagenet',\n            include_top=False\n        )\n        dnet201.trainable = True\n\n        model3 = tf.keras.Sequential([\n            dnet201,\n            L.GlobalAveragePooling2D(),\n            L.Dense(1, activation='sigmoid')\n        ])\n        model3.compile(\n            optimizer='adam',\n            loss = 'binary_crossentropy',\n            metrics=['accuracy']\n        )\n\n    model3.summary()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Training","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"lrfn = build_lrfn()\nlr_schedule = tf.keras.callbacks.LearningRateScheduler(lrfn, verbose=1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"train_dataset = get_training_dataset()\nvalid_dataset = get_validation_dataset()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    history = model.fit(\n        train_dataset, \n        epochs=EPOCHS, \n        callbacks=[lr_schedule],\n        steps_per_epoch=STEPS_PER_EPOCH,\n        validation_data=valid_dataset\n    )\n    model.save(\"efficientnetb7.h5\")","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    history2 = model2.fit(\n        train_dataset, \n        epochs=EPOCHS, \n        callbacks=[lr_schedule],\n        steps_per_epoch=STEPS_PER_EPOCH,\n        validation_data=valid_dataset\n    )\n    model2.save(\"efficientnetb0.h5\")","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"#model3.save(\"densenet201.h5\")","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Training Evaluation","execution_count":null},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"def display_training_curves(training, validation, title, subplot):\n    \"\"\"\n    Source: https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu\n    \"\"\"\n    if subplot%10==1: # set up the subplots on the first call\n        plt.subplots(figsize=(10,10), facecolor='#F0F0F0')\n        plt.tight_layout()\n    ax = plt.subplot(subplot)\n    ax.set_facecolor('#F8F8F8')\n    ax.plot(training)\n    ax.plot(validation)\n    ax.set_title('model '+ title)\n    ax.set_ylabel(title)\n    #ax.set_ylim(0.28,1.05)\n    ax.set_xlabel('epoch')\n    ax.legend(['train', 'valid.'])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"if TRAINING:\n    display_training_curves(\n        history.history['loss'], \n        history.history['val_loss'], \n        'model 1 loss', 211)\n    display_training_curves(\n        history.history['accuracy'], \n        history.history['val_accuracy'], \n        'model 1 accuracy', 212)","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"if TRAINING:\n    display_training_curves(\n        history2.history['loss'], \n        history2.history['val_loss'], \n        'model 2 loss', 211)\n    display_training_curves(\n        history2.history['accuracy'], \n        history2.history['val_accuracy'], \n        'model 2 accuracy', 212)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Prediction & Submission","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"# create copies for each model if you want to\nsub1 = sub.copy()\nsub2 = sub.copy()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    test_ds = get_test_dataset(ordered=True)\n\n    print('Computing predictions...')\n    test_images_ds = test_ds.map(lambda image, idnum: image)\n    probabilities = model.predict(test_images_ds)\n    probabilities2 = model2.predict(test_images_ds)\n    print('Generating submission.csv file...')\n    test_ids_ds = test_ds.map(lambda image, idnum: idnum).unbatch()\n    test_ids = next(iter(test_ids_ds.batch(NUM_TEST_IMAGES))).numpy().astype('U') # all in one batch","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    pred_df = pd.DataFrame({'image_name': test_ids, 'target': np.concatenate(probabilities)})\n    pred_df2 = pd.DataFrame({'image_name': test_ids, 'target': np.concatenate(probabilities2)})\n    del sub1['target']\n    sub1 = sub1.merge(pred_df, on='image_name')\n    sub1.to_csv('submission_efficientnetb7.csv', index=False)\n    del sub2['target']\n    sub2 = sub2.merge(pred_df2, on='image_name')\n    sub2.to_csv('submission_efficientnetb0.csv', index=False)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Simple Blend of Predictions","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"if TRAINING:\n    sub_es = sub1[['image_name']]\n    sub_es['target'] = 0.5*sub1['target'] + 0.5*sub2['target']\n    sub_es.to_csv('submission_blend.csv', index=False)\n    sub_es.head()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Stacking Submission Files\n\n## Submission Files Overview\n\n- Filenames with 'noimg' suffix are from models that do not use image data in training and predictions\n- All other filenames are from either pure image models or blends of image and non-image model predictions (e.g. the one with suffix '0.914')\n- The submission files are from both publicly available notebooks and also from my privately trained models (whose training pipeline and model architecture differ from public ones)\n- The public notebooks that contributed to some of the submission files are:\n    - https://www.kaggle.com/anshuls235/melanoma-eda-and-prediction/notebook?select=submission.csv\n    - https://www.kaggle.com/shonenkov/inference-single-model-melanoma-starter\n    - https://www.kaggle.com/cdeotte/image-and-tabular-data-0-915\n    - https://www.kaggle.com/ajaykumar7778/melanoma-tpu-efficientnet-b5-dense-head\n    - https://www.kaggle.com/soham1024/melanoma-efficientnetb6-inference\n    - https://www.kaggle.com/nroman/melanoma-pytorch-starter-efficientnet\n    - https://www.kaggle.com/redwankarimsony/melanoma-eda-efficentnets-densenet-ensemble\n    - https://www.kaggle.com/zzy990106/pytorch-5-fold-efficientnet-baseline\n    - https://www.kaggle.com/yasufuminakama/tpu-siim-isic-efficientnetb3-inference\n    - https://www.kaggle.com/arroqc/siim-isic-pytorch-lightning-starter-seresnext50","execution_count":null},{"metadata":{"trusted":true},"cell_type":"code","source":"import seaborn as sns","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"sub_path = \"../input/siimisic-submission-files\"\nall_files = os.listdir(sub_path)\nall_files","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"outs = [pd.read_csv(os.path.join(sub_path, f), index_col=0) for f in all_files]\nconcat_sub = pd.concat(outs, axis=1)\ncols = list(map(lambda x: \"target\" + str(x), range(len(concat_sub.columns))))\nconcat_sub.columns = cols\nconcat_sub.reset_index(inplace=True)\nconcat_sub.head()\nncol = concat_sub.shape[1]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# check correlation\nconcat_sub.iloc[:,1:ncol].corr()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"corr = concat_sub.iloc[:,1:].corr()\nmask = np.zeros_like(corr, dtype=np.bool)\nmask[np.triu_indices_from(mask)] = True\n\n# Set up the matplotlib figure\nf, ax = plt.subplots(figsize=(11, 9))\n\n# Generate a custom diverging colormap\ncmap = sns.diverging_palette(220, 10, as_cmap=True)\n\n# Draw the heatmap with the mask and correct aspect ratio\nsns.heatmap(corr, mask=mask, cmap=cmap, vmax=.3, center=0,\n            square=True, linewidths=.5, cbar_kws={\"shrink\": .5})","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# get the data fields ready for stacking\nconcat_sub['target_max'] = concat_sub.iloc[:, 1:ncol].max(axis=1)\nconcat_sub['target_min'] = concat_sub.iloc[:, 1:ncol].min(axis=1)\nconcat_sub['target_mean'] = concat_sub.iloc[:, 1:ncol].mean(axis=1)\nconcat_sub['target_median'] = concat_sub.iloc[:, 1:ncol].median(axis=1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"concat_sub.describe()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cutoff_lo = 0.002\ncutoff_hi = 0.11","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"concat_sub['target'] = concat_sub['target_mean']\nconcat_sub[['image_name', 'target']].to_csv('submission_mean.csv', \n                                        index=False, float_format='%.6f')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"concat_sub['target'] = concat_sub['target_median']\nconcat_sub[['image_name', 'target']].to_csv('submission_median.csv', \n                                        index=False, float_format='%.6f')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"concat_sub['target'] = np.where(np.all(concat_sub.iloc[:,1:ncol] > cutoff_lo, axis=1), 1, \n                                    np.where(np.all(concat_sub.iloc[:,1:ncol] < cutoff_hi, axis=1),\n                                             0, concat_sub['target_median']))\nconcat_sub[['image_name', 'target']].to_csv('submission_pushout_median.csv', \n                                        index=False, float_format='%.6f')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"concat_sub['target'] = np.where(np.all(concat_sub.iloc[:,1:ncol] > cutoff_lo, axis=1), \n                                    concat_sub['target_max'], \n                                    np.where(np.all(concat_sub.iloc[:,1:ncol] < cutoff_hi, axis=1),\n                                             concat_sub['target_min'], \n                                             concat_sub['target_mean']))\nconcat_sub[['image_name', 'target']].to_csv('submission_minmax_mean.csv', \n                                        index=False, float_format='%.6f')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"concat_sub['target'] = np.where(np.all(concat_sub.iloc[:,1:ncol] > cutoff_lo, axis=1), \n                                    concat_sub['target_max'], \n                                    np.where(np.all(concat_sub.iloc[:,1:ncol] < cutoff_hi, axis=1),\n                                             concat_sub['target_min'], \n                                             concat_sub['target_median']))\nconcat_sub[['image_name', 'target']].to_csv('submission_minmax_median.csv', \n                                        index=False, float_format='%.6f')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# References\n\n- https://www.kaggle.com/mgornergoogle/getting-started-with-100-flowers-on-tpu\n- https://www.kaggle.com/xhlulu/alaska2-efficientnet-on-tpus \n- https://www.kaggle.com/anshuls235/melanoma-eda-and-prediction/notebook?select=submission.csv\n- https://www.kaggle.com/shonenkov/inference-single-model-melanoma-starter\n- https://www.kaggle.com/cdeotte/image-and-tabular-data-0-915\n- https://www.kaggle.com/ajaykumar7778/melanoma-tpu-efficientnet-b5-dense-head\n- https://www.kaggle.com/soham1024/melanoma-efficientnetb6-inference\n- https://www.kaggle.com/nroman/melanoma-pytorch-starter-efficientnet\n- https://www.kaggle.com/redwankarimsony/melanoma-eda-efficentnets-densenet-ensemble\n- https://www.kaggle.com/zzy990106/pytorch-5-fold-efficientnet-baseline\n- https://www.kaggle.com/yasufuminakama/tpu-siim-isic-efficientnetb3-inference\n- https://www.kaggle.com/arroqc/siim-isic-pytorch-lightning-starter-seresnext50","execution_count":null},{"metadata":{},"cell_type":"markdown","source":"# Future Work & Tips\n\n- As validation data was not provided explicitly, we have to derive them from the training data. Currently a 80-20 split is performed with fixed start point. Next step is to impose K-fold cross-validation on the training set and ensemble each model's fold's predictions.","execution_count":null},{"metadata":{},"cell_type":"markdown","source":"## This notebook will be periodically updated with better performing models to reflect the progress in the competition. Augmentation techniques will be introduced in later versions, so stay tuned!","execution_count":null}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}