Direkt zum Hauptbereich

Posts

Posts mit dem Label "KNN" werden angezeigt.

Pi And More 11 - R Script For Neuronal Net And Training

This is the R script used to create and train the neuronal net for the Python project . Please consider that the lines for the export of the neuron weights are disabled by the comment marker #. ################################## # # COMMON SAMPLE DATA HANDLING # ################################## load_samples = function (filename, attrib) { data = read.csv(filename, sep = "\t" ) # Remove result column data = data[, -5 ] # Calculate all combination with count of measure points n = aggregate(x ~ run + subset, data = data, FUN = length) # Keep only measurement with 80 points n = n[n[, 3 ] == 80 ,] # Create the training data matrix for non-matches dataset = matrix(ncol = 80 , nrow = 0 ) # Fill up the training data matrix with the valid cases (n) of data and transpose it for (i in 1 : dim(n)[ 1 ]) dataset = rbind(dataset, t(data $ x[(data $ run == n[i, 1 ]) & (data $ subset == n[i, 2 ])])) # add class column dataset = cbind(c(attr