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
| Word2VecModel model_stemmed = ModelUtil.loadWord2VecModel("/Users/mueller/Coding/Word2Vectors/webbase10p/model_word2vec_stemmed.ser"); | |
| Word2VecModel model_unstemmed = ModelUtil.loadWord2VecModel("/Users/mueller/Coding/Word2Vectors/webbase10p/model_word2vec.ser"); | |
| System.out.println("Stemmed example"); | |
| System.out.println("#############################################"); | |
| String term1= "scholar"; | |
| String term2 ="student"; | |
| //To Stem terms the Porter Stemmer from Apache Lucene is used | |
| double result = Word2VecSim.cousineSimilarityBetweenTerms(model_stemmed,ModelUtil.porter_stem(term1),ModelUtil.porter_stem(term2)); |
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
| # Perform Dataset preparation and the comparison | |
| import numpy as np | |
| import random | |
| import time | |
| from collections import defaultdict | |
| from sklearn.neighbors import BallTree | |
| from sklearn.neighbors import DistanceMetric | |
| n_samples_min = int(1e3) | |
| n_samples_max = int(1e7) |
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
| RADIANT_TO_KM_CONSTANT = 6367 | |
| import proximitypyhash as ppyh | |
| import pygeohash as pgh | |
| from sklearn.neighbors import DistanceMetric | |
| import numpy as np | |
| from collections import defaultdict | |
| class GeoHashIndexer: | |
| def __init__(self, precision, lat_longs): |
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 sklearn.neighbors import BallTree | |
| import numpy as np | |
| RADIANT_TO_KM_CONSTANT = 6367 | |
| class BallTreeIndex: | |
| def __init__(self,lat_longs): | |
| self.lat_longs = np.radians(lat_longs) | |
| self.ball_tree_index =BallTree(self.lat_longs, metric='haversine') | |
| def query_radius(self,query,radius): | |
| radius_km = radius/1e3 |
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 sklearn.neighbors import DistanceMetric | |
| import numpy as np | |
| RADIANT_TO_KM_CONSTANT = 6367 | |
| class BruteForce: | |
| def __init__(self,lat_longs): | |
| self.haversine =DistanceMetric.get_metric('haversine') | |
| self.lat_longs = np.radians(lat_longs) | |
| def query_radius(self,query,radius): | |
| radius_km = radius/1e3 |
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 random | |
| n_samples_min = int(1e3) | |
| n_samples_max = int(5e7) | |
| lat_longs = np.array([[random.uniform(50, 52), | |
| random.uniform(8, 15) ] | |
| for i in range(n_samples_max)]) |
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
| ## Install scala 2.11.8 | |
| export scalaVer="2.11.8" | |
| sudo apt-get remove scala-library scala | |
| wget www.scala-lang.org/files/archive/scala-"$scalaVer".deb | |
| sudo dpkg -i scala-"$scalaVer".deb | |
| sudo apt-get -y --force-yes update | |
| sudo apt-get -y --force-yes install scala | |
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
| ssh-keygen -t rsa -b 4096 -C "your_email@example.com" |
OlderNewer