def resetparams(self, parameters): try: utils.update_dictionary_items(self.params,parameters) except AttributeError: # Variable self.params does not exist, so not updated # Create an empty set of params for future reference self.params = {}
def reset(self, params): """ Can pass parameters to reset with new parameters """ try: utils.update_dictionary_items(self.params,params) except AttributeError: # Variable self.params does not exist, so not updated # Create an empty set of params for future reference self.params = {}
def resetparams(self, parameters): """ Can pass parameters to reset with new parameters """ self.weights = None try: utils.update_dictionary_items(self.params,parameters) except AttributeError: # Variable self.params does not exist, so not updated # Create an empty set of params for future reference self.params = {}
def __init__(self, parameters={}): """ Params can contain any useful parameters for the algorithm """ # red_class_bias is an additional bias we place in favour of the red fighter, # where 1 means no bias, 2 means we will only choose blue if it is twice as likely as red, # 0.5 means that we will only choose red is it is twice as likely as blue, and so on self.params = utils.update_dictionary_items({'red_class_bias': 1}, parameters)
def __init__(self, parameters={}): """Website References: https://analyticsindiamag.com/understanding-the-basics-of-svm-with-example-and-python-implementation/ https://towardsdatascience.com/support-vector-machine-python-example-d67d9b63f1c8 https://www.kdnuggets.com/2016/06/select-support-vector-machine-kernels.html https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html """ self.params = utils.update_dictionary_items({'kernel': 'linear'}, parameters) if self.params['kernel'] == 'poly': self.classifier = SVC(kernel=self.params['kernel'], gamma='scale', degree=self.params['degree']) else: self.classifier = SVC(kernel=self.params['kernel'], gamma='scale')
def __init__(self, parameters={}): self.params = utils.update_dictionary_items( { 'nh': 4, 'transfer': 'sigmoid', 'stepsize': 0.001, 'epochs': 10, }, parameters) if self.params['transfer'] is 'sigmoid': self.transfer = utils.sigmoid self.dtransfer = utils.dsigmoid else: # For now, only allowing sigmoid transfer raise Exception( 'NeuralNet -> can only handle sigmoid transfer, must set option transfer to string sigmoid' ) self.wi = None self.wo = None