Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| VGG_ILSVRC_19_layers_train_val.prototxt | |
| name: "VGG_ILSVRC_19_layers" | |
| layers { | |
| name: "data" | |
| type: DATA | |
| include { | |
| phase: TRAIN | |
| } | |
| transform_param { | |
| crop_size: 224 |
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
| from mincepie import mapreducer, launcher | |
| import gflags | |
| import glob | |
| import leargist | |
| import numpy as np | |
| import os | |
| from PIL import Image | |
| import uuid | |
| # constant value |
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
| class BloomFilter(val size: Int, val expectedElements: Int){ | |
| require(size > 0) | |
| require(expectedElements > 0) | |
| val bitArray = new BitArray(size) | |
| val k = Math.ceil((bitArray.size / expectedElements) * Math.log(2.0)).toInt | |
| val expectedFalsePositiveProbability = Math.pow(1 - Math.exp(-k * 1.0 * expectedElements / bitArray.size), k) | |
| def add(hash: Int) { | |
| def add(i: Int, seed: Int) { |
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
| /* | |
| Copyright 2012 Twitter, Inc. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and |
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 breeze.linalg._ | |
| import breeze.stats._ | |
| import scala.math.sqrt | |
| /** | |
| * Effecient for sparse vectors. Scales in O(activeSize) | |
| */ | |
| // Must take SparseVector, for implicits to be linked correctly | |
| def pearson(a: SparseVector[Double], b: SparseVector[Double]): Double = { |
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
| // genrate all combinations of integers in range from 0 to `len`-1 | |
| // fast as fuck | |
| def combIdxs(len: Int, k: Int): Iterator[Array[Int]] = { | |
| val arr = Array.range(0, k) | |
| arr(k-1) -= 1 | |
| val end = k-1 | |
| Iterator.continually { | |
| arr(end) += 1 | |
| if (arr(end) >= len) { |