This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Authored by Konrad Kollnig | |
| # Oxford, 20 April 2019 | |
| import wikipedia | |
| from nltk.tokenize import sent_tokenize, RegexpTokenizer | |
| from nltk.corpus import stopwords | |
| from collections import defaultdict | |
| import math | |
| import numpy as np | |
| from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| nmsmax(fun, x[, trace = true, initial_simplex = 0, target_f = Inf, max_its = Inf, max_evals = Inf, tol = 1e-3]) | |
| Nelder-Mead simplex method for direct search optimization. | |
| This function attempts to maximize the function `fun`, using the | |
| starting vector `x`. The Nelder-Mead direct search method is used. | |
| Adaption of the original *MATLAB* source by Nick Higham to *Julia*. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| import locale | |
| import csv, codecs, cStringIO | |
| from pprint import pprint | |
| import time | |
| from BeautifulSoup import BeautifulSoup | |
| # From the Pyton documentation |
NewerOlder