Skip to content

Instantly share code, notes, and snippets.

View mikkokotila's full-sized avatar

Mikko Kotila mikkokotila

View GitHub Profile
import datetime, coronacaster, pandas
data = coronacaster.get_data_from_eu()
out = []
countries = data.countries
for country in countries:
# parameters start
for ftype in ['poly1', 'poly2', 'poly3', 'logis', 'sigmoid', 'scurve']:
function csvImport(path_to_file) {
d3.csv(path_to_file).then(prepData);
function prepData(dataset) {
// create the columns
var keys = Object.keys(dataset[0])
var headers = []
# name of the service
NAME=$1
# exec and service file paths
EXEC_FILE=$2
SERVICE_FILE=/etc/systemd/system/"$NAME".service
# timing
TIMER_FILE=/etc/systemd/system/"$NAME".timer
TIMING=$3
import talos as ta
x, y = ta.templates.datasets.cervical_cancer()
p = ta.templates.params.cervical_cancer()
model = ta.templates.models.cervical_cancer()
import signs as signs
import pandas as pd
# load some text
df = pd.read_csv('tweets.csv').text
# load vectors
e = signs.Embeds("glove.twitter.27B.25d.txt")
# get Keras embeddings layer
import talos as ta
from keras.models import Sequential
from keras.layers import Dense
def minimal():
x, y = ta.datasets.iris()
p = {'activation':['relu', 'elu'],
'optimizer': ['Nadam', 'Adam'],
import talos
from keras.models import Sequential
from keras.layers import Dense
def minimal():
x, y = talos.templates.datasets.iris()
p = {'activation':['relu', 'elu'],
'optimizer': ['Nadam', 'Adam'],
def iris_model(x_train, y_train, x_val, y_val):
model = Sequential()
model.add(Dense(32, input_dim=8, activation='adam'))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='relu', loss='binary_crossentropy')
out = model.fit(x_train, y_train,
batch_size=24,
epochs=100,
p = {'lr': (0.8, 1.2, 3),
'first_neuron':[4, 8, 16, 32, 64],
'hidden_layers':[0, 1, 2],
'batch_size': (1, 5, 5),
'epochs': [50, 100, 150],
'dropout': (0, 0.2, 3),
'weight_regulizer':[None],
'emb_output_dims': [None],
'shape':['brick','long_funnel'],
'kernel_initializer': ['uniform','normal'],
# and run the experiment
t = ta.Scan(x=x,
y=y,
model=breast_cancer_model,
grid_downsample=0.01,
params=p,
dataset_name='breast_cancer',
experiment_no='1')