摘要: `KFold(n_splits=5, shuffle=True, random_state=3)` 阅读全文
posted @ 2020-11-25 15:27 hifalee 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 读取csv文件 data = pd.read_csv(f1,nrows =20) s = data.loc[:, :] s = s.loc[:, ['machine_id', 'question_id', 'answer_right']] s = s.values s = s.tolist() 读取 阅读全文
posted @ 2020-11-25 15:12 hifalee 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 预处理excel文件中的数据不平衡问题 data = pd.read_excel ("file) list_label = [] train_list, dev_list, test_list = [],[],[] data_value = data.value for i in range(len 阅读全文
posted @ 2020-11-25 15:06 hifalee 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 通过list写入excel list1 = [['张三','男','未婚',20],['李四','男','已婚',28],['小红','女','未婚',18],['小芳','女','已婚',25]] output = open('data.xls','w',encoding='gbk') outpu 阅读全文
posted @ 2020-11-25 15:03 hifalee 阅读(761) 评论(0) 推荐(0) 编辑
摘要: shutil.rmtree(params.save) #删除文件保存相关文件 os.mkdir(params.save) #创建相关文件 torch.save(model, params.save+'/model.pkl') #以torch为例子,然后保存 def delete_file(path) 阅读全文
posted @ 2020-11-25 09:02 hifalee 阅读(140) 评论(0) 推荐(0) 编辑
摘要: f1 = metrics.f1_score(all_target, all_pred) 阅读全文
posted @ 2020-11-25 08:59 hifalee 阅读(395) 评论(0) 推荐(0) 编辑
摘要: df.groupby(['opponent']).game_id.nunique()= for index,group in df.groupby(df['opponent'])['game_id']: print(index) print(len(set(list(group)))) 阅读全文
posted @ 2020-11-25 08:58 hifalee 阅读(75) 评论(0) 推荐(0) 编辑
摘要: nohup venv/bin/python bin/photo_data.py > ph_save.log 2>&1 & 或者 nohup python -u test.py > test.log 2>&1 & sh 文件nohup sh test.sh > test.log 2>&1 & 查看进程 阅读全文
posted @ 2020-11-25 08:51 hifalee 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1. git status 查看修改的文件1. 首先add: `git add file` 提交需要修改的文件2. 删除`master`分支: `git commit -m '' `3. 拉取分支: `git pull origin dev_lhh`4. diff: `git diff dev_lh 阅读全文
posted @ 2020-11-25 08:48 hifalee 阅读(76) 评论(0) 推荐(0) 编辑