def init_W(self, mode='<STR_LIT>'):
if (self.status != '<STR_LIT>') and (self.status != '<STR_LIT:train>'):<EOL><INDENT>print("<STR_LIT>")<EOL>return self.W<EOL><DEDENT>self.status = '<STR_LIT>'<EOL>self.data_num = len(self.train_Y)<EOL>self.data_demension = len(self.train_X[<NUM_LIT:0>])<EOL>self.W = np.zeros(self.data_demension)<EOL>if (self.svm_kernel != '<STR_LIT>' and self.svm_kernel != '<STR_LIT>'):<EOL><INDENT>if mode == '<STR_LIT>':<EOL><INDENT>accelerator = linear_regression.Accelerator()<EOL>self.W = accelerator.init_W(self)<EOL><DEDENT><DEDENT>return self.W<EOL>
Init the W
Simple way is init W all zeros