future-warning

How do I solve the future warning -> % (min_groups, self.n_splits)), Warning) in python?

≡放荡痞女 提交于 2019-12-05 03:26:01
When I run mean_acc() method in my program, there are % (min_groups, self.n_splits)), Warning) errors... def mean_acc(): models = [ RandomForestClassifier(n_estimators=200, max_depth=3, random_state=0), LinearSVC(), MultinomialNB(), LogisticRegression(random_state=0)] CV = 6 cv_df = pd.DataFrame(index=range(CV * len(models))) entries = [] for model in models: model_name = model.__class__.__name__ accuracies = cross_val_score(model, features, labels, scoring='accuracy', cv=CV) for fold_idx, accuracy in enumerate(accuracies): entries.append((model_name, fold_idx, accuracy)) cv_df = pd.DataFrame

How do I solve the future warning -> % (min_groups, self.n_splits)), Warning) in python?

最后都变了- 提交于 2019-11-30 03:08:02
问题 When I run mean_acc() method in my program, there are % (min_groups, self.n_splits)), Warning) errors... def mean_acc(): models = [ RandomForestClassifier(n_estimators=200, max_depth=3, random_state=0), LinearSVC(), MultinomialNB(), LogisticRegression(random_state=0)] CV = 6 cv_df = pd.DataFrame(index=range(CV * len(models))) entries = [] for model in models: model_name = model.__class__.__name__ accuracies = cross_val_score(model, features, labels, scoring='accuracy', cv=CV) for fold_idx,