ML之RF&XGBoost:分别基于RF随机森林、XGBoost算法对Titanic(泰坦尼克号)数据集进行二分类预测(乘客是否生还)
输出结果 设计思路 核心代码rfc = RandomForestClassifier()rfc.fit(X_train, y_train)rfc.score(X_test, y_test)xgbc = XGBClassifier()xgbc.fit(X_train, y_train)xgbc.score(X_test, y_test)class RandomForestCla....
ML之DT:基于DT决策树算法(对比是否经特征筛选FS处理)对Titanic(泰坦尼克号)数据集进行二分类预测
输出结果初步处理后的 X_train: (984, 474) (0, 0) 31.19418104265403 (0, 78) 1.0 (0, 82) 1.0 (0, 366) 1.0 (0, 391) .....
ML之NB:利用朴素贝叶斯NB算法(TfidfVectorizer+不去除停用词)对20类新闻文本数据集进行分类预测、评估
输出结果设计思路核心代码class TfidfVectorizer Found at: sklearn.feature_extraction.textclass TfidfVectorizer(CountVectorizer): """Convert a collection of raw documents to a matrix of TF-IDF features....
ML之DT:基于DT算法对泰坦尼克号乘客数据集进行二分类(是否获救)预测
输出结果设计思路核心代码X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state = 33)vec = DictVectorizer(sparse=False) X_train = vec.fit_transform(X_train.to_dict(ori....
ML之NB:基于NB朴素贝叶斯算法训练20类新闻文本数据集进行多分类预测
输出结果设计思路核心代码vec = CountVectorizer()X_train = vec.fit_transform(X_train)X_test = vec.transform(X_test)mnb = MultinomialNB()mnb.fit(X_train, y_train) y_predict = mnb.predict....
ML之LoR&Bagging&RF:依次利用LoR、Bagging、RF算法对泰坦尼克号数据集 (Kaggle经典案例)获救人员进行二分类预测(最全)(二)
核心代码clf_LoR = linear_model.LogisticRegression(C=1.0, penalty='l1', tol=1e-6)clf_LoR.fit(X, y)#LoR算法class LogisticRegression Found at: sklearn.linear_model.logisticclass LogisticRegression(BaseEstimat....
本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。