知识卡片
单列目标和二维矩阵形状不同
示例X.shape为(53940,9),单列Series目标为(53940,),不是(53940,1)。不同估计器可能接受不同形状,转换前先核对接口及样本对应,不能为消除警告随意reshape改变含义。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 使用数据
原书出处 · 1 处
- · 查看原书依据
Print out the shape of variables X and Y. X.shape (53940, 9) Y. shape (53940,) Reading CSV File Into a Jupyter Notebook Using Pandas and Creating Feature and Target Matrices. import pandas as pd df=pd. read_csv (“C:\\Users\\asahay\\OneDrive \Documents\\Diamonds.csv”) df.head() Column_1 carat cut color clarity depth table
参考来源
- 位置:《Machine Learning Fundamentals: Concepts, Models, and Applications》第05章《使用数据》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Machine Learning Fundamentals: Concepts, Models, and Applications/_epub-src/OEBPS/xhtml/17_chapter05.xhtml)
- 结论依据:摘录中关于单列目标和二维矩阵形状不同的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Print out the shape of variables X and Y. X.shape (53940, 9) Y. shape (53940,) Reading CSV File Into a Jupyter Notebook Using Pandas and Creating Feature and Target Matrices. import pandas as pd df=pd. read_csv (“C:\\Users\\asahay\\OneDrive \Documents\\Diamonds.csv”) df.head() Column_1 carat cut color clarity depth table