Massachusetts Roads遥感道路语义分割数据集迅雷链接下载预处理

整体步骤:

  • 首先在网页端打开需要下载的网页。
  • 然后右键选择“查看源文件”。
  • 将里面的内容复制保存到txt文件中。
  • 对txt文件进行处理。
  • 打开迅雷下载即可。

对txt文件进行处理

运行完毕后,将生成的txt的最前面删除[],最后面处理一下。即可。

import os
# 1为train sat 的网页“查看源文件”的内容复制。
# 2为train map
# 3为valid sat
# 4为valid map
# 5为test sat
# 6为test map
with open('1.txt', 'r') as file1:
    lines1 = file1.readlines()
file1.close()
out1 = []
for line1 in lines1:
    temp1 = line1[9:84]
    print(temp1, end='\n')
    temp1= temp1+'\n'
    out1 = str(out1) + str(temp1)
os.system('clear')
file11 = open('11.txt', 'w')
file11.write(out1)
file11.close()

with open('2.txt', 'r') as file2:
    lines2 = file2.readlines()
file2.close()
out2 = []
for line2 in lines2:
    temp2 = line2[9:83]
    print(temp2, end='\n')
    temp2 = temp2 + '\n'
    out2 = str(out2) + str(temp2)
os.system('clear')
file22 = open('22.txt', 'w')
file22.write(out2)
file22.close()

with open('3.txt', 'r') as file3:
    lines3 = file3.readlines()
file3.close()
out3 = []
for line3 in lines3:
    temp3 = line3[9:84]
    print(temp3, end='\n')
    temp3 = temp3 + '\n'
    out3 = str(out3) + str(temp3)
os.system('clear')
file33 = open('33.txt', 'w')
file33.write(out3)
file33.close()

with open('4.txt', 'r') as file4:
    lines4 = file4.readlines()
file4.close()
out4 = []
for line4 in lines4:
    temp4 = line4[9:83]
    print(temp4, end='\n')
    temp4 = temp4 + '\n'
    out4 = str(out4) + str(temp4)
os.system('clear')
file44 = open('44.txt', 'w')
file44.write(out4)
file44.close()

with open('5.txt', 'r') as file5:
    lines5 = file5.readlines()
file5.close()
out5 = []
for line5 in lines5:
    temp5 = line5[9:83]
    print(temp5, end='\n')
    temp5 = temp5 + '\n'
    out5 = str(out5) + str(temp5)
os.system('clear')
file55 = open('55.txt', 'w')
file55.write(out5)
file55.close()

with open('6.txt', 'r') as file6:
    lines6 = file6.readlines()
file6.close()
out6 = []
for line6 in lines6:
    temp6 = line6[9:82]
    print(temp6, end='\n')
    temp6 = temp6 + '\n'
    out6 = str(out6) + str(temp6)
file66 = open('66.txt', 'w')
file66.write(out6)
file66.close()
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
sklearn中自带了波士顿房价数据集,可以通过以下代码导入: ``` from sklearn.datasets import load_boston boston = load_boston() X = boston.data # 特征矩阵 y = boston.target # 目标向量 ``` 其中,X是一个13维的特征矩阵,y是一个样本数量为506的目标向量。可以通过以下代码查看数据集的描述: ``` print(boston.DESCR) ``` 输出结果如下: ``` .. _boston_dataset: Boston house prices dataset --------------------------- **Data Set Characteristics:** :Number of Instances: 506 :Number of Attributes: 13 numeric/categorical predictive. Median Value (attribute 14) is usually the target. :Attribute Information (in order): - CRIM per capita crime rate by town - ZN proportion of residential land zoned for lots over 25,000 sq.ft. - INDUS proportion of non-retail business acres per town - CHAS Charles River dummy variable (= 1 if tract bounds river; 0 otherwise) - NOX nitric oxides concentration (parts per 10 million) - RM average number of rooms per dwelling - AGE proportion of owner-occupied units built prior to 1940 - DIS weighted distances to five Boston employment centres - RAD index of accessibility to radial highways - TAX full-value property-tax rate per $10,000 - PTRATIO pupil-teacher ratio by town - B 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town - LSTAT % lower status of the population - MEDV Median value of owner-occupied homes in $1000's :Missing Attribute Values: None :Creator: Harrison, D. and Rubinfeld, D.L. This is a copy of UCI ML housing dataset. https://archive.ics.uci.edu/ml/machine-learning-databases/housing/ This dataset was taken from the StatLib library which is maintained at Carnegie Mellon University. The Boston house-price data of Harrison, D. and Rubinfeld, D.L. 'Hedonic prices and the demand for clean air', J. Environ. Economics & Management, vol.5, 81-102, 1978. Used in Belsley, Kuh & Welsch, 'Regression diagnostics ...', Wiley, 1980. N.B. Various transformations are used in the table on pages 244-261 of the latter. The Boston house-price data has been used in many machine learning papers that address regression problems. **References** - Belsley, Kuh & Welsch, 'Regression diagnostics: Identifying Influential Data and Sources of Collinearity', Wiley, 1980. 244-261. - Quinlan,R. (1993). Combining Instance-Based and Model-Based Learning. In Proceedings on the Tenth International Conference of Machine Learning, 236-243, University of Massachusetts, Amherst. Morgan Kaufmann.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

袁博特

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值