<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Feature weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# display difference in coefficients if both models have this information\n",
    "display(Markdown(\"### Standardized & relative coefficients\"))\n",
    "df_coefs_diff = combine_old_new_results(outputs_old['df_coef'], outputs_new['df_coef'], 'coefs')\n",
    "if not df_coefs_diff.empty:\n",
    "    display(HTML(df_coefs_diff.to_html(index=True, classes=['alternate_colors3_groups'], float_format=float_format_func)))\n",
    "    section_empty=False\n",
    "else:\n",
    "    display(Markdown(no_info_str))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "if 'betas' in figures_old:\n",
    "    markdown_str = '''### Feature weight graphs for the old model ({})'''.format(experiment_id_old)\n",
    "    Markdown(markdown_str)\n",
    "    if use_thumbnails:\n",
    "        show_thumbnail(figures_old['betas'], next(id_generator))\n",
    "    else:\n",
    "        display(SVG(filename=figures_old['betas']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "if 'betas' in figures_new:\n",
    "    markdown_str = '''### Feature weight graphs for the new model ({})'''.format(experiment_id_new)\n",
    "    display(Markdown(markdown_str))\n",
    "    if use_thumbnails:\n",
    "        show_thumbnail(figures_new['betas'], next(id_generator))\n",
    "    else:\n",
    "        display(SVG(filename=figures_new['betas']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_model_fit_diff = combine_old_new_results(outputs_old['df_model_fit'], outputs_new['df_model_fit'], 'model_fit')\n",
    "if not df_model_fit_diff.empty:\n",
    "    markdown_str = '''### Model fit for old and new model'''\n",
    "    display(Markdown(markdown_str))\n",
    "    display(HTML(df_model_fit_diff.to_html(index=False, classes=['alternate_colors3_groups'], float_format=float_format_func)))\n"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "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.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
<commit_msg>Fix typo in displaying markdown.<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Feature weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# display difference in coefficients if both models have this information\n",
    "display(Markdown(\"### Standardized & relative coefficients\"))\n",
    "df_coefs_diff = combine_old_new_results(outputs_old['df_coef'], outputs_new['df_coef'], 'coefs')\n",
    "if not df_coefs_diff.empty:\n",
    "    display(HTML(df_coefs_diff.to_html(index=True, classes=['alternate_colors3_groups'], float_format=float_format_func)))\n",
    "    section_empty=False\n",
    "else:\n",
    "    display(Markdown(no_info_str))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "if 'betas' in figures_old:\n",
    "    markdown_str = '''### Feature weight graphs for the old model ({})'''.format(experiment_id_old)\n",
    "    display(Markdown(markdown_str))\n",
    "    if use_thumbnails:\n",
    "        show_thumbnail(figures_old['betas'], next(id_generator))\n",
    "    else:\n",
    "        display(SVG(filename=figures_old['betas']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "if 'betas' in figures_new:\n",
    "    markdown_str = '''### Feature weight graphs for the new model ({})'''.format(experiment_id_new)\n",
    "    display(Markdown(markdown_str))\n",
    "    if use_thumbnails:\n",
    "        show_thumbnail(figures_new['betas'], next(id_generator))\n",
    "    else:\n",
    "        display(SVG(filename=figures_new['betas']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_model_fit_diff = combine_old_new_results(outputs_old['df_model_fit'], outputs_new['df_model_fit'], 'model_fit')\n",
    "if not df_model_fit_diff.empty:\n",
    "    markdown_str = '''### Model fit for old and new model'''\n",
    "    display(Markdown(markdown_str))\n",
    "    display(HTML(df_model_fit_diff.to_html(index=False, classes=['alternate_colors3_groups'], float_format=float_format_func)))\n"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "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.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}

{'fraction_non_alphanumeric': 0.1948529411764706, 'fraction_numerical': 0.003851540616246499, 'mean_word_length': 3.408179012345679, 'pattern_counts': {'":': 92, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3420147', 'n_tokens_mistral': 2149, 'n_tokens_neox': 2080, 'n_words': 328}