Skip to content

Instantly share code, notes, and snippets.

View KaleabTessera's full-sized avatar
🎯
Focusing

Kale-ab Tessera KaleabTessera

🎯
Focusing
View GitHub Profile
# Load model with best rMse and make prediction
fileName = "results/" + "bestRegressionModel_" + str(LineaReggressionMetrics.ROOT_MEAN_SQUARED_ERROR.name) + ".sav"
bestRegression = joblib.load(fileName)
#Example ICO
#Format - price_usd,price_btc,total_supply,market_cap_usd,available_supply,usd_raised,eth_price_launch,btc_price_launch,ico_duration,month,day,country
example_x = np.array([1.71456,0.00019931,1000000000,905793616,528295082,24000000,297.63,3420.4,7,8,9,182])
y_pred = makePrediction(bestRegression,example_x)
print("Predicted value of example ICO after six months: ",y_pred )
# Function which will be called to make a prediction
def makePrediction(model,example_to_predict):
# One-hot encode the example to match the data it was trained on.
encoded_x = encodeSingleElement(x,example_to_predict)
y_pred = model.predict(encoded_x.reshape(1, -1))
return y_pred
# Load model with best rMse and make prediction
fileName = "results/" + "bestRegressionModel_" + str(LineaReggressionMetrics.ROOT_MEAN_SQUARED_ERROR.name) + ".sav"
@KaleabTessera
KaleabTessera / mongo_backup.sh
Last active October 9, 2018 15:37 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
HOST_NAME="host_name_or_localhost"
USERNAME="username_database"
PASSWORD="password_database"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
@KaleabTessera
KaleabTessera / findAllSubsets.py
Created September 2, 2018 12:48
This gist contains functions which recursively find all subsets of a set. The min and max subset size can be specified.
import numpy as np
#This function retrieves all subsets in a set recursively.
def findSubsets(allSubsets,subset,currentIndex,maxSubsetSize):
if(len(subset) == currentIndex):
return allSubsets
newSet = []
for i in range(0,len(allSubsets)):
if(len(allSubsets[i]) < maxSubsetSize):
@KaleabTessera
KaleabTessera / runNord.sh
Last active August 7, 2018 12:59
Shell Script to Run Nord VPN
#!/bin/bash
chosenVPNServer=za8.nordvpn.com.udp.ovpn
cd /etc/openvpn
cd ovpn_udp
ls -al
sudo openvpn $chosenVPNServer
@KaleabTessera
KaleabTessera / installNord.sh
Created August 7, 2018 12:56
Shell Script to install Nord
#!/bin/bash
sudo apt-get install openvpn
cd /etc/openvpn
sudo wget https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip
sudo apt-get install ca-certificates
sudo apt-get install unzip
sudo unzip ovpn.zip
sudo rm zip