优化算法

This commit is contained in:
2018-03-07 18:28:57 +08:00
parent 97e2fc615c
commit b0e3c626e7
5 changed files with 56 additions and 36 deletions
+15 -13
View File
@@ -25,6 +25,7 @@ import time
import fangjia
import sklearn.svm
import datetime
from fangjia import timer
# import yesterday
@@ -85,7 +86,7 @@ value_type = pandas.Series([1, 2, 3, 4, 5, 6, 7],
# 1:指导价 2:自身样本 3:第三方 4:交易数据 5:周边楼盘, 6:推导
@timer
def commonprice(ct, rl, p):
def add_block(ppd):
if 'block' not in ppd.columns:
@@ -137,7 +138,7 @@ def commonprice(ct, rl, p):
return numpy.array([])
else:
return numpy.array([])
@timer
def take_location(ct, rl, p):
dirlt = p[0]
@@ -306,6 +307,7 @@ def commonprice(ct, rl, p):
# print('df[kk]',df[kk])
return ppp
@timer
def neighbor(lng, lat, scale, ct, rl, p):
###################
@@ -414,7 +416,7 @@ def commonprice(ct, rl, p):
else:
km = vv['price'].dropna()
return int(k_means(km))
@timer
def no_source_price(ct, rl, location, p):
lk = p[0]
hg = location.shape[0]
@@ -582,7 +584,7 @@ def commonprice(ct, rl, p):
return cc1
else:
return cc1
@timer
def consider_villa(ct, rl, p):
# print('villa p=',p)
@@ -637,6 +639,7 @@ def commonprice(ct, rl, p):
return villa
@timer
def dsfjujia(ct, rl, lk):
query = {"city": ct, "region": rl,
@@ -802,6 +805,7 @@ def commonprice(ct, rl, p):
return lzf, anst
@timer
def dglg_out1(junjia, neighb):
"""
@@ -851,6 +855,7 @@ def commonprice(ct, rl, p):
location = take_location(ct, rl, p)
# ttp=time.time()
neighb = no_source_price(ct, rl, location, p)
# print(time.time()-ttp,'m'*20)
@@ -956,7 +961,7 @@ def commonprice(ct, rl, p):
print('诸葛找房算法')
from zhuge import zhuge_consist
data['avg'] = data['total_price'] / data['area']
@timer
def guolv_data11(data, neighb):
if type(neighb) is not str:
@@ -1071,7 +1076,7 @@ dsf = db136.district_stat
# client136 = pymongo.MongoClient('192.168.0.136',27017)
# db136 = client136.fangjia
@timer
def region_district_list(ct, rl):
# import pandas
# client1 = pymongo.MongoClient('192.168.0.136',27017)
@@ -1117,13 +1122,13 @@ def region_list(city):
data = pandas.DataFrame(pos)
return data['name']
@timer
def add_alias(ppd):
if 'alias' not in ppd.columns:
ppd['alias'] = '无'
return ppd
@timer
def ghhh(kkg):
kkg = kkg.fillna('无')
a = list()
@@ -1141,7 +1146,7 @@ pt = client1.fangjia_log.calc_command
#################################################################
@timer
def region_district_list_lk(ct, rl, lk):
# import pandas
# client1 = pymongo.MongoClient('192.168.0.136',27017)
@@ -1327,7 +1332,4 @@ def out_put_price(ct, rl, lk, weekend):
'remark': 'week', 'category': 'sell', 'weekend': weekend, 'priority': int(0),
'problem': mm[0],
}, True
)
)