amoy's recent timeline updates
amoy

amoy

V2EX member #411615, joined on 2019-05-12 22:11:35 +08:00
amoy's recent replies
May 18, 2022
Replied to a topic by Cells 随想 看了房子帖文有感.....
歪个楼,在热榜看到两个这样的有感了,请问这个房子贴文是指哪个帖子?
May 16, 2022
Replied to a topic by amoy 问与答 除了 ssh 还有什么方式可以远程登录?
目前服务器上应该只有 sshd ,这次只好先去线下重启 sshd 服务了。谢谢各位的回复,之后会尝试大家推荐的其它远程登录方式,防止 sshd 再次抽风 。
@JohnChiu 考研的话基本可以保底本校,听学长说被调剂了可以联系自己学校的老师,只要不是太差就会收的。另外想请问一下硕士学历对就业的帮助有多大呢?
Sep 27, 2019
Replied to a topic by zz656565 问与答 大家十一国庆都放几天假啊?
大学在读,国庆三天,挪了两周周末补齐七天,缺的课还得以后找时间补上
Jul 11, 2019
Replied to a topic by amoy 问与答 萌新求问用什么做大数据处理比较好
在里面添加一个 average=None 参数就没有报错了,虽然不知其所以然
Jul 11, 2019
Replied to a topic by amoy 问与答 萌新求问用什么做大数据处理比较好
@CrabAss 大佬,我又来打扰您了,我现在做到那个模型评估那里,其中有两个指标
print('准确率:', accuracy_score(Y_test, y_pred))
print('精确率:', precision_score(Y_test, y_pred))

第一条可以运行出来,第二条会报错
准确率: 0.900968992248062
F:\anaconda\envs\scikit-learn\lib\site-packages\sklearn\metrics\classification.py:1243: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if pos_label not in present_labels:
Traceback (most recent call last):
File "F:/bigdata/scikit-learn/Dataset.py", line 97, in <module>
print('正确率:', precision_score(Y_test, y_pred))
File "F:\anaconda\envs\scikit-learn\lib\site-packages\sklearn\metrics\classification.py", line 1569, in precision_score
sample_weight=sample_weight)
File "F:\anaconda\envs\scikit-learn\lib\site-packages\sklearn\metrics\classification.py", line 1415, in precision_recall_fscore_support
pos_label)
File "F:\anaconda\envs\scikit-learn\lib\site-packages\sklearn\metrics\classification.py", line 1246, in _check_set_wise_labels
"%r" % (pos_label, present_labels))
ValueError: pos_label=1 is not a valid label: array(['buffer', 'play'], dtype='<U6')

进程已结束,退出代码 1
请问这是为什么?
@renmu 解决了,多谢
@Loner233 多谢,还真是,有几个多了一列。文件太多了,之前没注意看,看了前几个是一样的以为都是一样的。
@renmu @zhucegeqiu 打扰一下
listaddress=[]
for info in os.listdir('F:/bigdata/data/all'):
domain = os.path.abspath(r'F:/bigdata/data/all') # 获取文件夹的路径
info = os.path.join(domain, info) # 将路径与文件名结合起来就是每个文件的完整路径
listaddress.append(info)
dfs =[pd.read_csv(f) for f in listaddress]
#print(dfs[1])
df = pd.concat(dfs) # 将文件合并
请问运行报错是是为什么啊?
FutureWarning: Sorting because non-concatenation axis is not aligned. A future version
of pandas will change to not sort by default.

To accept the future behavior, pass 'sort=False'.

To retain the current behavior and silence the warning, pass 'sort=True'.
@renmu 这个不是一次只能读取一 csv 个文件么?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1011 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 22:26 · PVG 06:26 · LAX 15:26 · JFK 18:26
♥ Do have faith in what you're doing.