This file contains 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
# Start an MLflow experiment run | |
with mlflow.start_run(): | |
lr = ElasticNet(alpha=alpha, l1_ratio=l1_ratio, random_state=42) | |
lr.fit(train_x, train_y) | |
predicted_qualities = lr.predict(test_x) | |
rmse = np.sqrt(mean_squared_error(actual, pred)) | |
mae = mean_absolute_error(actual, pred) |
This file contains 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 mlflow | |
import os | |
REMOTE_SERVER_URI = "http://mlflow:5555" | |
S3_ENDPOINT_URL = "http://minio:9000" | |
# set the tracking server hostname/port | |
mlflow.set_tracking_uri(REMOTE_SERVER_URI) | |
# set the artifact backend to be the local minio backend |
This file contains 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
if [ "$SPARK_MODE" == "worker" ]; then | |
DRIVER_HOST="$(hostname | sed -E 's/spark-([a-z0-9]+)-(worker|master)-[0-9]+/spark-driver-\1.domino-compute.svc.cluster.local/g')" | |
echo "Starting ray worker targeting head at \"${DRIVER_HOST}\" after head startup delay" | |
for i in {1..10}; do ray start --address=${DRIVER_HOST}:6379 --redis-password=pass --num-gpus=1 && break || sleep 60; done | |
else | |
echo "taking no action on master" | |
# DRIVER_HOST="$(hostname | sed -E 's/spark-([a-z0-9]+)-(worker|master)-[0-9]+/spark-driver-\1.domino-compute.svc.cluster.local/g')" | |
# PROXY_PATH="$(hostname | sed -E 's/spark-([a-z0-9]+)-(worker|master)-[0-9]+/kevin_flansburg\/Ray\/workspaces\/\1\/spark\/ui/g')" | |
# echo "Starting ray ui proxying \"/${PROXY_PATH}\" to head at \"${DRIVER_HOST}\"" | |
# touch /usr/sbin/proxy.txt |
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 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
pragma solidity ^0.4.16; | |
contract Ownable { | |
address public owner; | |
constructor () public { | |
owner = msg.sender; | |
} | |
modifier onlyOwner(){ |
This file contains 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
res <- rq(lalonde$re78 ~ X_all, tau=seq(0.2, 0.8, by=0.1)) | |
sm <- summary(res) | |
plot(sm) |
This file contains 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
compressed_image_data_train = pca.transform(image_data_train) | |
uncompressed_image_data_train = pca.inverse_transform(compressed_image_data_train) | |
fig=plt.figure(figsize=(12, 20)) | |
columns = 4 | |
rows = 8 | |
for i in range(1, 33, 4): | |
component_id = int(i/4) | |
eigen_image = image_from_component_values(pca.components_[component_id]) | |
inverted_egein_image = PIL.ImageOps.invert(eigen_image) |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
###################### | |
# Speech recognition # | |
###################### | |
# 1. Work through the following resources: | |
# Viterbi algorithm. (n.d.). In Wikipedia. Retrieved November 9, 2016, from | |
# https://en.wikipedia.org/wiki/Viterbi_algorithm | |
# The 44 Phonemes in English. (n.d.). Retrieved November 9, 2016, from | |
# http://www.dyslexia-reading-well.com/44-phonemes-in-english.html |
This file contains 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
@celery.task | |
def async_training_task(data_file_name, k_iterations): | |
train_model(file=data_file_name, iterations=k_iterations) | |
# This is the standard flask handler. | |
# Maybe you get some params from the request/ | |
def get(self, request): | |
async_training_task.delay(data_file_name=request.file_name, iterations=10) | |
return Response("Training has been started!") |
NewerOlder