|
@@ -16,7 +16,7 @@ def pipeline(city_name, year, land_type, policy_factors):
|
|
|
land_type_list = ["工业用地(万元/㎡)", "住宅用地(万元/㎡)", "商服用地(万元/㎡)", "其他用地(万元/㎡)"]
|
|
|
land_type2feature_list = {}
|
|
|
for sample_land in land_type_list:
|
|
|
- with open(f"jupyter/{sample_land.split('(')[0]}", "r") as f:
|
|
|
+ with open(f"jupyter/{sample_land.split('(')[0]}", "r", encoding="utf-8") as f:
|
|
|
land_type2feature_list[sample_land] = f.read().split(",")
|
|
|
|
|
|
# -------------------------------- 1. 读取历年土地基本信息 --------------------
|
|
@@ -37,8 +37,6 @@ def pipeline(city_name, year, land_type, policy_factors):
|
|
|
_[0] == city_name and _[1] in ["2022", "2023"]]
|
|
|
y_data = list(reversed(y_data))
|
|
|
x_data = list(reversed(x_data))
|
|
|
- print('x_data;y_data')
|
|
|
- print(x_data, y_data)
|
|
|
model = LinearRegression()
|
|
|
model.fit(x_data, y_data)
|
|
|
pred_feature = model.predict([[year]])
|