- 博客(4)
- 收藏
- 关注
原创 Python将字符串类标签更改为int
在对数据集预处理时,需要将标签值替换为[0,1,2,...],可使用一下方法更改尤其使用XGBClassifier,必须将标签转换1. 手动使用map2. 自动
2022-06-01 22:28:16 242
原创 Latex中的花体格式
在\begin{document}之前引入\usepackage{mathrsfs}花体字母的表示方法为:$\mathscr{C}$
2022-05-10 12:39:01 3364
原创 错误:DeprecationWarning: The default dtype for empty Series will be ‘object‘ instead of ‘float64‘ in
在使用python时,直接使用a = pd.Series()创建series时会报错DeprecationWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning. after removing the cwd from sys.path.修
2022-04-24 16:46:38 3489
原创 python使用独热编码的两种情况
特征内容为数字时,采用以下代码df_Species = df_iris.iloc[:, -1:] iris_oh = pd.DataFrame(OneHotEncoder(handle_unknown='ignore').fit(df_Species).transform(df_Species).toarray())print(iris_oh)输出结果数据为具体内容时,可直接采用get_dummies函数,该函数可直接生成列名,更加便捷data = pd.DataFrame(
2022-04-14 22:10:15 1304
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人