def detectSingleParaProp(self, a_record, a_threshold): """ Depending on the UrlRecord's parameter field and a given threshold, HostModel detects whether it is a anomaly. :param a_record: UrlRecord :param a_threshold: float :return: dict --> {str: str} -- the detection result and it's reason. """ para_prop_result = CalProp.detectParaProp(a_record, self.__path_para_dict, a_threshold) return para_prop_result
def calSinglePathProp_modi(self, a_record): """ get the probability of a UrlRecord's url path by the modification-way. :param a_record: UrlRecord :return: dict --> {str: float} -- url's encoded path map to it's probability. """ a_path_prop = CalProp.calPathProp_modi({a_record: 1}, self.__path_cell, self.__2path_cells)[0] a_path_code = a_record.get_path() return {a_path_code: a_path_prop}
def __calModelProp(self): self.__model_path_props = CalProp.calPathProp_modi( self.__records, self.__path_cell, self.__2path_cells)
def __calModelProp(self): self.__model_path_props = CalProp.calPathProp_modi(self.__records, self.__path_cell, self.__2path_cells)