How to deal with data ambiguity in TEC-006
Today, I will talk to you about how to carry out TEC-006 data fuzzy processing, which may not be well understood by many people. In order to let everyone know more, Xiaobian summarizes the following contents for everyone. I hope everyone can gain something according to this article.
Data in the user layer to do fuzzy processing, continuous data range, no overlap, think of a solution, through the range of the beginning of the position sort by binary search to obtain fuzzy value interval;
The data conversion format is as follows:
eg.1
Below 50 (=50,=70,=90,=110,=130,=150,=200)
eg.2
Within a month (0-30 days)
Within two months (31-60 days)
Within 3 months (61-90 days)
Within half a year (91-180 days)
Within one year (181 days-365 days)
More than one year (365 days)
demo:
class VlCode {
const CONSTRUCTION_AREA=[50,70,90,110,130,150,200];
const FINAL_PRICE=[100,150,200,250,300,400,500,800,1000];
const LOAN_AMOUNT=[30,50,100,150,200,250,300,400,500];
const LOAN_DATE=[30,31,60,61,90,91,180,181,365];
const LOAN_DATE_CEIL=[
'-1'=>"within a month",
'1'=>"within two months",
'3'=>"within three months",
'5'=>"within half a year",
'7'=>"within one year",
'9'=>"More than one year"
];
/**
Description: Get Range Value Escape
@date: April 9, 2018 10:00:44 AM
@$arr range value,@$target reference value
@author lwy
*/
static public function getRanges($arr,$target,$ceil=''){
if(empty($target)||$target=0&&$target>=@$arr[$pre]){