| Models | Examples |
|---|---|
| Display ads | Yahoo! |
| Search ads |
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
| import numpy as np | |
| import pandas as pd | |
| import pylab as pl | |
| baseball = pd.read_csv("http://bit.ly/144sh7t") | |
| # group by year and get a summary of each numeric column | |
| baseball.groupby(["year"]).describe() | |
| # for each year, get the mean of each column | |
| baseball.groupby(["year"]).aggregate(np.mean) |
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
| """ | |
| Use a Counter to find the most common words in "The Wonderful Wizard of Oz" by | |
| L. Frank Baum. | |
| Available in (mostly) plain text at: | |
| https://archive.org/stream/wonderfulwizardo00baumiala/wonderfulwizardo00baumiala_djvu.txt | |
| Note: This code also counts the words in the header, so it's not a *realistic* | |
| applicaton, but more of a demonstration of python's Counter. |
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
| public class Maze_Best { | |
| public int counter = 0; | |
| private final static int MAX_VALUE = 1000; | |
| int best_solution = MAX_VALUE; | |
| public char[][] maze = | |
| {{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#'}, | |
| {'#', ' ', ' ', ' ', '#', ' ', '#', ' ', ' ', '#'}, |
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
| public class Maze { | |
| public int counter = 0; | |
| public char[][] maze = | |
| {{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#'}, | |
| {'#', ' ', ' ', ' ', '#', ' ', '#', ' ', ' ', '#'}, | |
| {'#', ' ', ' ', ' ', '#', ' ', '#', ' ', '#', '#'}, | |
| {'#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'}, | |
| {'#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'}, |
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/python | |
| # | |
| # (originally entered at https://gist.github.com/1035399) | |
| # | |
| # License: GPLv3 | |
| # | |
| # To download the AFINN word list do: | |
| # wget http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/6010/zip/imm6010.zip | |
| # unzip imm6010.zip | |
| # |
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
| # pylint: disable=W0612 | |
| import time | |
| import pandas as pd | |
| import numpy as np | |
| import iopro | |
| import gc |
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
| """Information Retrieval metrics | |
| Useful Resources: | |
| http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt | |
| http://www.nii.ac.jp/TechReports/05-014E.pdf | |
| http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf | |
| http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf | |
| Learning to Rank for Information Retrieval (Tie-Yan Liu) | |
| """ | |
| import numpy as np |
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
| """ | |
| usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ] | |
| """ | |
| import sys | |
| import io | |
| from IPython.nbformat import current | |