在使用随机森林和SVM时,使用DataPreparer对数据进行标准化后,为什么我的数据值会变为负面?
我正在研究预测建模,我需要在网站上预测在线客户是否最终在网站上购买产品,并且由于这是一个分类问题,我正在使用随机森林分类器和SVM。
在创建用于培训,测试和验证集的拟合拆分之后,我对数据进行伪造,标准化和标准化。但是,在我将集合归一化之后,它们的值都变为负面。有没有办法改变这一点,为什么会发生这种情况?
我用来将拟合集正常化的代码如下:
data_preparer = DataPreparer(one_hot_encoder, standard_scaler)
data_preparer.prepare_data(fitting_splits.train_set).head()
data_preparer.prepare_data(fitting_splits.validation_set).head()
I am working on predictive modeling where I need to predict whether an online customer ends up purchasing a product on a website or not, and I am using Random Forest Classifier and SVM since it's a classification problem.
After creating the fitting splits for training, testing, and validation sets, I dummify, standardize and normalize my data. However, after I normalize the sets, their values become all negative. Is there a way to change that and why does it happen?
The code that I am using to normalize my fitting sets is as below:
data_preparer = DataPreparer(one_hot_encoder, standard_scaler)
data_preparer.prepare_data(fitting_splits.train_set).head()
data_preparer.prepare_data(fitting_splits.validation_set).head()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为Sklearn.preprocessing.standardscaler的文档可以在这里提供帮助:
基于此方程,如果x(当前缩放的个体值)小于变量的均值,则您的缩放值将为负。
I think the documentation from sklearn.preprocessing.StandardScaler can help here:
Based on this equation, if x (the individual value currently being scaled) is less than the mean of the variable, then your scaled value will be negative.