{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import clusim.clugen as clugen\n",
    "import clusim.sim as sim\n",
    "from clusim.plotutils import print_clustering"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "01|25|934|86|7\n",
      "01|26|93|47|5|8\n",
      "            jaccard_index                     0.25\n",
      "               rand_index       0.8666666666666667\n",
      "    fowlkes_mallows_index       0.4082482904638631\n",
      "    rogers_tanimoto_index       0.7647058823529411\n",
      "          southwood_index       0.3333333333333333\n",
      "        czekanowski_index                      0.4\n",
      "               dice_index                      0.4\n",
      "           sorensen_index                      0.4\n",
      "      pearson_correlation    0.0017198248905565979\n",
      "     classification_error      0.29999999999999993\n",
      "             purity_index       0.7000000000000001\n",
      "                 fmeasure                      0.4\n",
      "                      nmi       0.7744534657094393\n",
      "                       vi       1.0754887502163468\n",
      "       geometric_accuracy       0.7483314773547882\n",
      "          overlap_quality                     -0.0\n",
      "                     onmi        0.683581142891832\n",
      "              omega_index       0.3283582089552241\n"
     ]
    }
   ],
   "source": [
    "c1 = clugen.make_random_clustering(n_elements = 10, n_clusters = 2)\n",
    "c2 = clugen.make_random_clustering(n_elements = 10, n_clusters = 5)\n",
    "\n",
    "print_clustering(c1)\n",
    "print_clustering(c2)\n",
    "\n",
    "row_format2 =\"{:>25}\" * (2)\n",
    "for simfunc in sim.available_similarity_measures:\n",
    "    print(row_format2.format(simfunc, eval('sim.' + simfunc+'(c1, c2)')))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
