def Build_Weight_Database(  self,
                                database,
                                version,
                                num_of_kpts,
                                cutoff,
                                force_update = False,
                                K = 10,
                                depth = 4,
                                nleaves = 10000):
                

        
        updated = self.Train_Database_Sign(database,version, num_of_kpts, force_update, K, depth, nleaves)
        
        #load signature
        sign_dir = os.path.join(self.SIGN_DIR, 'db_version_' + str(version))
        sign = Signature()
        sign.load_sign(sign_dir, self.SIGN_FILE+str(num_of_kpts))
        
        print 'Siganture Loaded'
        
        wt_file = os.path.join(sign_dir, self.WEIGHT_FILE+str(num_of_kpts)+'_'+str(cutoff))
        wts_file = os.path.join(sign_dir, self.WEIGHT_SIGN_FILE+str(num_of_kpts)+'_'+str(cutoff))
        
        if updated or (not os.path.isfile(wt_file) and not os.path.isfile(wts_file)):
            wt = Weight(cutoff)
            wt.get_weight(sign.sign_database)        
            wt.weight_train_database(sign.sign_database)
        
            wt.save_weights(sign_dir, self.WEIGHT_FILE+str(num_of_kpts)+'_'+str(cutoff))
            wt.save_weighted_sign(sign_dir, self.WEIGHT_SIGN_FILE+str(num_of_kpts)+'_'+str(cutoff))
            
            print ' '
            print 'Wegihted Sign Generated'
        
        else:
            print 'Weighted Sign Has Already Been Generated'