scikit-learn

SKLearn MinMaxScaler - scale specific columns only

泪湿孤枕 提交于 2020-11-27 04:46:49
问题 I'd like to scale some (but not all) of the columns in a Pandas dataFrame using a MinMaxScaler. How can I do it? 回答1: Since sklearn >= 0.20 you can do it using Column Transformer standard_transformer = Pipeline(steps=[ ('standard', StandardScaler())]) minmax_transformer = Pipeline(steps=[ ('minmax', MinMaxScaler())]) preprocessor = ColumnTransformer( remainder='passthrough', #passthough features not listed transformers=[ ('std', standard_transformer , ['z']), ('mm', minmax_transformer , ['x',

SKLearn MinMaxScaler - scale specific columns only

≯℡__Kan透↙ 提交于 2020-11-27 04:36:11
问题 I'd like to scale some (but not all) of the columns in a Pandas dataFrame using a MinMaxScaler. How can I do it? 回答1: Since sklearn >= 0.20 you can do it using Column Transformer standard_transformer = Pipeline(steps=[ ('standard', StandardScaler())]) minmax_transformer = Pipeline(steps=[ ('minmax', MinMaxScaler())]) preprocessor = ColumnTransformer( remainder='passthrough', #passthough features not listed transformers=[ ('std', standard_transformer , ['z']), ('mm', minmax_transformer , ['x',

SKLearn MinMaxScaler - scale specific columns only

会有一股神秘感。 提交于 2020-11-27 04:36:07
问题 I'd like to scale some (but not all) of the columns in a Pandas dataFrame using a MinMaxScaler. How can I do it? 回答1: Since sklearn >= 0.20 you can do it using Column Transformer standard_transformer = Pipeline(steps=[ ('standard', StandardScaler())]) minmax_transformer = Pipeline(steps=[ ('minmax', MinMaxScaler())]) preprocessor = ColumnTransformer( remainder='passthrough', #passthough features not listed transformers=[ ('std', standard_transformer , ['z']), ('mm', minmax_transformer , ['x',

SKLearn MinMaxScaler - scale specific columns only

早过忘川 提交于 2020-11-27 04:36:06
问题 I'd like to scale some (but not all) of the columns in a Pandas dataFrame using a MinMaxScaler. How can I do it? 回答1: Since sklearn >= 0.20 you can do it using Column Transformer standard_transformer = Pipeline(steps=[ ('standard', StandardScaler())]) minmax_transformer = Pipeline(steps=[ ('minmax', MinMaxScaler())]) preprocessor = ColumnTransformer( remainder='passthrough', #passthough features not listed transformers=[ ('std', standard_transformer , ['z']), ('mm', minmax_transformer , ['x',

The imp module is deprecated [duplicate]

混江龙づ霸主 提交于 2020-11-26 10:24:37
问题 This question already has answers here : How to ignore deprecation warnings in Python (16 answers) Closed 2 years ago . Whenever I try to use "sklearn" in pycharm, I get the following error on the console. DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp I am not sure if it should bother me, because program still working, but it's annoying. How can I get rid of it? I made every change, people recommended in

The imp module is deprecated [duplicate]

你离开我真会死。 提交于 2020-11-26 10:23:42
问题 This question already has answers here : How to ignore deprecation warnings in Python (16 answers) Closed 2 years ago . Whenever I try to use "sklearn" in pycharm, I get the following error on the console. DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp I am not sure if it should bother me, because program still working, but it's annoying. How can I get rid of it? I made every change, people recommended in

问题解决: Pandas and scikit-learn: KeyError: […] not in index

 ̄綄美尐妖づ 提交于 2020-11-22 14:52:02
问题解决: Pandas and scikit-learn: KeyError: […] not in index 参考文章: (1)问题解决: Pandas and scikit-learn: KeyError: […] not in index (2)https://www.cnblogs.com/Allen-rg/p/9453949.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4432649/blog/4733012

我的第一个 Kaggle 比赛学习

ぃ、小莉子 提交于 2020-11-18 04:58:32
背景 Titanic: Machine Learning from Disaster - Kaggle 2 年前就被推荐照着这个比赛做一下,结果我打开这个页面便蒙了,完全不知道该如何下手。 两年后,再次打开这个页面,看到清清楚楚的 Titanic Tutorial - Kaggle ,完全傻瓜式的照着做就能做下来。当年是什么蒙蔽了我的眼睛~ Target use machine learning to create a model that predicts which passengers survived the Titanic shipwreck Data Titanic: Machine Learning from Disaster - Kaggle train.csv Survived: 1=yes, 0=No test.csv gender_submission.csv: for prediction PassengerId: those from test.csv Survived: final result Guide to help start and follow Titanic Tutorial - Kaggle Join the Competition Here! Submit a initial result : NoteBook Learning