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
export PATH_TO_FX = /path/to/javafx | |
export JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home #might be a bit different | |
sudo $JAVA_HOME/bin/jlink --module-path $PATH_TO_FX --add-modules java.se,javafx.base --bind-services --output /Library/Java/JavaVirtualMachines/jdkfx-12.0.2.jdk | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdkfx-12.0.2.jdk/ |
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
#geocoding function using googlemaps python client | |
def geocode(address): | |
try: geocode_result = gmaps.geocode(address) | |
except: | |
print("Exception occured for "+address) | |
return (None, None, None) | |
geocode_result = geocode_result[0] | |
return (geocode_result['geometry']['location']['lat'], | |
geocode_result['geometry']['location']['lng'], | |
geocode_result['place_id'] |
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
#dependencies | |
apt-get update &&\ | |
apt-get install -y libgtk2.0-0 libgconf-2-4 \ | |
libasound2 libxtst6 libxss1 libnss3 xvfb | |
npm install segmentio/nightmare | |
# Start Xvfb | |
Xvfb -ac -screen scrn 1280x2000x24 :9.0 & export DISPLAY=:9.0 | |
#I would usually format it by breaking the line at & but if you dont run the export in the same statement it doesnt seem to work |
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
""" | |
Using extreme gradient boosting to predict the price of a taxi from point a to point b using google public data | |
""" | |
#importing libs | |
from numpy import loadtxt | |
from xgboost import XGBRegressor | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import accuracy_score | |
import pandas as pd |
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 csv | |
import requests | |
import json | |
#all you need to edit | |
INPUT_FILE = ""; | |
OUTPUT_FILE = ""; | |
API_KEY = ""; | |