fit_transform()函数
.fit_transform
是fit
和transform
的组合。是将fit
和transform
合并,一步到位的结果。
.fit_transform()
的作用就是先拟合数据,然后转化它将其转化为标准形式。
.tranform()
的作用是通过
Fit(): Method calculates the parameters μ and σ and saves them as internal objects.
解释:简单来说,就是求得训练集X的均值啊,方差啊,最大值啊,最小值,这些训练集X固有的属性。可以理解为一个训练过程
Transform(): Method using these calculated parameters apply the transformation to a particular dataset.
解释:在Fit的基础上,进行标准化,降维,归一化等操作(看具体用的是哪个工具,如PCA,StandardScaler等)。
Fit_transform(): joins the fit() and transform() method for transformation of dataset.
解释:fit_transform是fit和transform的组合,既包括了训练又包含了转换