regression.py - lotteph/tweedejaarsproject GitHub Wiki

regression.py

This file is called on form the main file and performs the regression algorithms.

Ridge regression

This function takes a parameter which controls the amount of shrinkage, the training set of the input features, the test set of the input features, the training set of the output, the test set of the output and the offset, which is the factor with which the output must be taken in order to get realistic output. It runs ridge regression and returns the predictions for the test set.

Bayes regression

This function takes a parameter which controls the amount of shrinkage, the training set of the input features, the test set of the input features, the training set of the output, the test set of the output and the offset, which is the factor with which the output must be taken in order to get realistic output. It runs bayes regression and returns the predictions for the test set.

Decision tree

A function which has the the training set of the input features, the test set of the input features, the training set of the output, the test set of the output and the offset as input. It makes a decision tree and returns the predictions for the test set.

K Nearest

This function takes a parameter which controls the amount of shrinkage, the training set of the input features, the test set of the input features, the training set of the output, the test set of the output and the offset, which is the factor with which the output must be taken in order to get realistic output. It runs K nearest neighbour regression and returns the predictions for the test set.

Multiple Years

This function determines whether multiple years are of influence to the predictions or not. It takes the amount of year s, the amount of iterations, the weather dataset and the results as input.