摘要:
评分卡案例 数据预处理 %matplotlib inline # 导入库 import pandas as pd import numpy as np from sklearn.linear_model import LogisticRegression as LR # 加载数据 data = pd 阅读全文
摘要:
from sklearn.datasets import load_breast_cancer from sklearn.feature_selection import SelectFromModel from sklearn.linear_model import LogisticRegress 阅读全文
摘要:
from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.decomposition import PCA from sklearn.ensemble import RandomForestClassifier as 阅读全文
摘要:
import pandas as pd import numpy as np import matplotlib.pyplot as plt # 准备数据 data = pd.read_csv("./digit recognizor.csv") x = data.iloc[:,1:] # 特征矩阵 阅读全文
摘要:
import pandas as pd data = pd.read_csv("./digit recognizor.csv") x = data.iloc[:,1:] y = data.iloc[:,0] x.shape (42000, 784) 方差过滤 VarianceThreshold fr 阅读全文
摘要:
二值化与分段 sklearn.preprocessing.Binarizer from sklearn.preprocessing import Binarizer import pandas as pd data = pd.read_csv("./data_full", index_col=0) 阅读全文
摘要:
处理缺失值 import pandas as pd import numpy as np df = pd.read_csv("./Narrativedata.csv", index_col=0) df.info() <class 'pandas.core.frame.DataFrame'> Int6 阅读全文
摘要:
数据归一化 import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler data = np.arange(36) data = data.reshape(6,6) data = pd.Da 阅读全文
摘要:
随机森林在乳腺癌数据上的调参 导入需要的库 from sklearn.datasets import load_breast_cancer from sklearn.model_selection import GridSearchCV, cross_val_score from sklearn.e 阅读全文
摘要:
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor from sklearn.impute import S 阅读全文