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 bash | |
while true | |
do | |
cat /proc/loadavg | ts | tee -a loadavg.csv | |
free -m | grep Mem | tr -s " " | cut -d " " -f2,3,4,5,6,7 | ts | tee -a memory.csv | |
iostat | awk '/avg-cpu/ {getline; $1=$1; print}' | ts | tee -a iostat.csv | |
top -b -n 1 | head | awk -F' ' 'FNR == 3 {print $2, $4, $6, $8, $10, $12, $14}' | ts | tee -a cpu_monitor.csv | |
sleep 1 | |
done |
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
from locust import HttpUser, task, between, SequentialTaskSet, events | |
from locust.exception import StopUser | |
import time | |
import logging | |
from bs4 import BeautifulSoup | |
import csv | |
import itertools | |
import json | |
import random |
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
from locust import HttpUser, task, between, SequentialTaskSet, events | |
from locust.exception import StopUser | |
import time | |
import logging | |
from bs4 import BeautifulSoup | |
import csv | |
import itertools | |
import json | |
import random |
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
# Basic neural net with 4 dense layers | |
model = tf.keras.models.Sequential([ | |
tf.keras.layers.Dense(1024, activation='relu', input_shape=(25,)), | |
tf.keras.layers.Dropout(0.2), | |
tf.keras.layers.Dense(1024, activation='relu'), | |
tf.keras.layers.Dropout(0.2), | |
tf.keras.layers.Dense(1024, activation='relu'), | |
tf.keras.layers.Dropout(0.2), | |
tf.keras.layers.Dense(1) | |
]) |
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
# Split data | |
train_annotated, test_annotated = train_test_split(data_annotated, test_size=0.10) | |
# Calculate correlation matrix | |
corr_array = [] | |
for col in train_annotated.columns: | |
corr_array.append(train_annotated[col].corr(train_annotated["Age"])) | |
print(len(corr_array)) | |
corr_df = pd.DataFrame(corr_array, columns=["Correlation"], index=train_annotated.columns) |
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
# Get dataset. It's is too big to come as a single file | |
!wget -O "./GSE87571_Matrix_Avg_Beta.txt.gz" "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE87571&format=file&file=GSE87571%5Fmatrix1of2%2Etxt%2Egz" | |
!wget -O "./GSE87571_Matrix_Avg_Beta2.txt.gz" "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE87571&format=file&file=GSE87571%5Fmatrix2of2%2Etxt%2Egz | |
# Extract dataset | |
!gunzip "./GSE87571_Matrix_Avg_Beta.txt.gz" | |
!gunzip "./GSE87571_Matrix_Avg_Beta2.txt.gz | |
# Merge data set files into one | |
!cut -d$'\t' -f1 --complement "./GSE87571_Matrix_Avg_Beta2.txt" > newFile && mv newFile "./GSE87571_Matrix_Avg_Beta2.txt" |