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
Dataset <- read.csv("Dataset.csv", stringsAsFactors=TRUE, header=TRUE) | |
Dataset <- Dataset[Dataset$Assignment != "",] | |
View(Dataset) | |
drugs <- data.frame( | |
Name = c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD"), | |
Color = c("Red", "Red", "Green", "Yellow", "Red", "Yellow", "Red", "Red", "Red", "Red", "Green", "Red", "Red", "Red", "Green", "Red", "Red", "Green", "Yellow", "Red", "Red", "Yellow", "Yellow", "Red", "Yellow", "Red", "Yellow", "Red", "Red", "Green") | |
) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 43 columns, instead of 6 in line 7.
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
ID,GENDER,AGE,RACE/ETHNICITY,Diagnosis,MD,Assignment,EMR,LOS,RAR,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,# Psychotropic Medications,# Administrations,Therapeutic Guidances | |
1,F,49,W,"MDD, Recurrent, Unspecified",L,G,C,70,0,2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,6,EG | |
2,F,21,W,"MDD, Recurrent, Unspecified",A,G,C,309,0,0,0,0,1,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,3,27,CT | |
3,M,28,L,"MDD, Single Episode, Severe With Psychotic Features",I,G,C,376,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,5,0,26,0,0,0,8,0,0,0,15,0,4,0,0,6,64,CT | |
4,F,63,L,Depressive Disorder NOS,L,G,C,115,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,5,0,0,0,0,3,14,CT | |
5,M,34,L,"MDD, Single Episode, Severe With Psychotic Features",G,S,C,120,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,1,0,0,0,0,0,0,0,0,5,0,0,0,0,0,3,11,EG | |
6,F,24,L,"MDD, Single Episode,Severe Without Psychotic Features",T,S,C,120,0,0,5,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,4,13,EG | |
7,M,42,W,"MDD, Single Episode, Unspecified", |
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
from keras.constraints import max_norm | |
def get_res_blocks(definitions, input, l2_factor=0.0001, kernel_constraint_norm=2.0): | |
hiddenx = tf.keras.layers.Dense(definitions[0], | |
activation='relu', | |
kernel_regularizer=tf.keras.regularizers.l2(l2_factor), | |
kernel_constraint=max_norm(kernel_constraint_norm), | |
bias_initializer=he_init)(input) | |
hiddeny = tf.keras.layers.Dense(definitions[0], | |
# activation='relu', |
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
def build_sequences(time_series, valid_periods, categories, train_size, test_size): | |
""" | |
Creates all possible test sequences with size <test_size> which have | |
a training sequence of <train_size> in front. | |
""" | |
X = [] | |
y = [] | |
final_categories = [] | |
for ts, range, category in zip(time_series, valid_periods, categories): | |
valid_ts = cut_valid(ts, range) |
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
def build_sequences(time_series, valid_periods, categories, train_size, test_size): | |
""" | |
Creates all possible test sequences with size <test_size> which have | |
a training sequence of <train_size> in front. | |
""" | |
X = [] | |
y = [] | |
final_categories = [] | |
for ts, range, category in zip(time_series, valid_periods, categories): | |
valid_ts = cut_valid(ts, range) |
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
def build_sequences(time_series, valid_periods, categories, train_size, test_size): | |
""" | |
Creates all possible test sequences with size <test_size> which have | |
a training sequence of <train_size> in front. | |
""" | |
X = [] | |
y = [] | |
final_categories = [] | |
for ts, range, category in zip(time_series, valid_periods, categories): | |
valid_ts = cut_valid(ts, range) |
OlderNewer