{ "cells": [ { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def edDistRecursive(a,b):\n", " \"\"\" Calculate edit distance between sequences x and y using\n", " recursion. Return distance. \"\"\"\n", " # This implementation is very slow\n", " if len(a) == 0:\n", " return len(b)\n", " if len(b) == 0:\n", " return len(a)\n", " delta = 1 if a[-1] != b[-1] else 0\n", " return min(edDistRecursive(a[:-1], b[:-1]) + delta,\n", " edDistRecursive(a, b[:-1]) + 1,\n", " edDistRecursive(a[:-1], b) + 1)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3\n", "34.848434\n" ] } ], "source": [ "import datetime as d\n", "st = d.datetime.now()\n", "print edDistRecursive(\"Shakespeare\", \"shake spear\")\n", "print(d.datetime.now() -st).total_seconds()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###Dynamic programming for editDistance" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from numpy import zeros\n", "def edDistDP(x,y):\n", " # Create distance matrix\n", " D = zeros((len(x) + 1, len(y) + 1), dtype = int)\n", " \n", " # Initialize the first column of matrix\n", " D[1:,0] = range(1, len(x) + 1)\n", " \n", " # Initialize the first row of matrix\n", " D[0, 1:] = range(1, len(y) + 1)\n", " \n", " # Fill in the rest of matrix\n", " for i in range(1, len(x) + 1):\n", " for j in range(1, len(y) + 1):\n", " distHor = D[i, j-1] + 1\n", " distVer = D[i-1, j] + 1\n", " if x[i-1] == y[j-1]:\n", " distDiag = D[i-1, j-1]\n", " else:\n", " distDiag = D[i-1, j-1] + 1\n", " D[i][j] = min(distHor, distVer, distDiag)\n", " return D[-1][-1]" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3\n", "CPU times: user 6.02 s, sys: 84.8 ms, total: 6.1 s\n", "Wall time: 6.04 s\n" ] } ], "source": [ "%%time\n", "x = 'shake spea'\n", "y = 'Shakespear'\n", "print edDistRecursive(x, y)" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3\n", "CPU times: user 748 µs, sys: 545 µs, total: 1.29 ms\n", "Wall time: 50.2 ms\n" ] } ], "source": [ "%%time\n", "x = 'shake spea'\n", "y = 'Shakespear'\n", "print edDistDP(x, y)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "edDistDP('PLEASANTLY', 'MEANLY')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "1998" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x = 'HMARCIMTIFQQVQCECHALVTTMPPYRCCEMIAGDEGFFLTQSDTWIHQGMESILGCTWHTLEHVFNKSVIPTCHVMDCILVCPIDYKLYHRIENWARFMILGEVDRERLIMQWQGYSNCNKWQIWQDESIKYFKINHDSLYWVPQYVGTMVDYTCIAWATLILMECCQYPHSKGPTWSVYNDAHFSLMKHHAMCMFFSMEHSNEFTFLHKCMATFLLPVKEQPSFGMCCWLQKVGMGPPWFMYMNQCQRKSMGSKKQGNKYSCRHDAEQRSVATKFYDDMFWVSQCLSNYHTYNLSAPSVHWKRRPFYQLHIWANEILIHDTMNLCFLGELTWSHESIDYSRFHEPWFYQSGVSDLTIPFWWQRRGYTLSESLWAMNYCKGMLCDKMEELRTRHRDPHAIGMFRKALKEGPMYALSPWMCQLMARVCGIHQAWAFLQGMCFIWRHIHYKYMCFEYYWWYPIAECMPWPLSMKYTIQPDVSHGSTAYKEYQKKYPPPGQMCIYKQCEMAIMFKGRHKHTIFVSYRGDIAKMQLWQLVNKDISWPRSTVAGMFNFEHAFGEHVWSQVYQNRPQPVRPIMQQQK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WCQVLVQVSPVIWGAEHHQNWPRYYHLEAHAKVFYTSNYWNHIWKMGNHTIDKCVDWQQMVIAFRCMCQSFQYKWPLWLIDMWVIVGMECNTQQCFKIKEYFMHIHPRQYMVWMCTVYVPTCYGSFMDTCNECMANCEGCQNRAFTFVWQVRDWMKYRTGQGQQHSFYMAHSFEEYKCPIRMKVWAWWEHFGQSAKAMMHREYHFVWCYLQFCHMYYYETAFYRFWEEASMQMQNECVRGATRQGFGCKHITMVSSDPIKTTFMERMDKRHCYYKEYADFMRVFDLINMTCNSADCPIQRASASVEHMTWYEFHNCTERIKCNSHYVEIAMILVLIRQIMPVVRKCSDFAGGKRIMSQFHSAAPHKVYENYPLDWIKQISQRCNLGAWTRSRKGYYNTNPCFDEPYRVINQDRYKRNIWWLCNEEKSQCEYTTKSNSDIIFEYYVFTEIKTFNMTCNWTTFFKVDQHWQTHKGHFGIDPSLLRLWSEPYDMGKGDRDKHVNGHLFTRASRHTLKHLMEAANGYEIEIVQFKYMGIKWAFRFQEAHAYAYYLAEDGLDDHELNSFGLGNLQHQELTNWLHVWIFFYAATQGGWTQLESHNVFYIPPFARTSCFGENDIPDVRKWTADCWWAQIGFNAWHALTLEIFFRDLGCNWIMVIGLKLYGGYTTQWMMATEFYYPCRCSICFRSMCQPDQVPVDRPCCRQGFYHWCTNSNCYWWEC'\n", "edDistDP(x, y)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "332" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x, y = [i.strip() for i in open('input/dataset_248_3.txt', 'r')]\n", "edDistDP(x, y)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.5" } }, "nbformat": 4, "nbformat_minor": 0 }