示例#1
0
文件: HostModel.py 项目: Lancert9/WUA
 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
示例#2
0
文件: HostModel.py 项目: Lancert9/WUA
 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}
示例#3
0
 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}
示例#4
0
 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
示例#5
0
 def __calModelProp(self):
     self.__model_path_props = CalProp.calPathProp_modi(
         self.__records, self.__path_cell, self.__2path_cells)
示例#6
0
文件: HostModel.py 项目: Lancert9/WUA
 def __calModelProp(self):
     self.__model_path_props = CalProp.calPathProp_modi(self.__records, self.__path_cell, self.__2path_cells)