diff --git a/polyssifier/poly_utils.py b/polyssifier/poly_utils.py index 938ec2e..8a15946 100644 --- a/polyssifier/poly_utils.py +++ b/polyssifier/poly_utils.py @@ -125,14 +125,14 @@ def build_classifiers(exclude, scale, feature_selection, nCols): if 'Decision Tree' not in exclude: classifiers['Decision Tree'] = { 'clf': DecisionTreeClassifier(max_depth=None, - max_features='auto'), + max_features='sqrt'), 'parameters': {}} if 'Random Forest' not in exclude: classifiers['Random Forest'] = { 'clf': RandomForestClassifier(max_depth=None, n_estimators=10, - max_features='auto'), + max_features='sqrt'), 'parameters': {'n_estimators': list(range(5, 20))}} if 'Logistic Regression' not in exclude: diff --git a/polyssifier/polyssifier.py b/polyssifier/polyssifier.py index 45f979e..4a6020e 100644 --- a/polyssifier/polyssifier.py +++ b/polyssifier/polyssifier.py @@ -55,7 +55,7 @@ def poly(data, label, n_folds=10, scale=True, exclude=[], _le.fit(label) label = _le.transform(label) n_class = len(np.unique(label)) - logger.info(f'Detected {n_class} classes in label') + logger.info('Detected ' + str(n_class) + ' classes in label') if save and not os.path.exists('poly_{}/models'.format(project_name)): os.makedirs('poly_{}/models'.format(project_name)) @@ -84,6 +84,7 @@ def poly(data, label, n_folds=10, scale=True, exclude=[], kf = list(skf.split(np.zeros(data.shape[0]), label)) # Parallel processing of tasks + manager = Manager() args = manager.list() args.append({}) # Store inputs diff --git a/polyssifier/report.py b/polyssifier/report.py index d3a0719..848fa27 100644 --- a/polyssifier/report.py +++ b/polyssifier/report.py @@ -143,7 +143,7 @@ def plot_scores(scores, scoring='auc', file_name='temp', min_val=None): break ax1.text(rect.get_x() - rect.get_width() / 2., ymin + (1 - ymin) * .01, data.index[n], ha='center', va='bottom', - rotation='90', color='black', fontsize=15) + rotation=90, color='black', fontsize=15) plt.tight_layout() plt.savefig(file_name + '.pdf') plt.savefig(file_name + '.svg', transparent=False) diff --git a/setup.py b/setup.py index 91fba5a..bb09218 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,12 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], # What does your project relate to? @@ -78,6 +84,6 @@ # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html - install_requires=['pandas', 'sklearn', 'numpy', 'matplotlib'], + install_requires=['pandas','scikit-learn', 'numpy', 'matplotlib','joblib'], zip_safe=False) # Override annoying default behavior of easy_install. diff --git a/tests/test_classification.py b/tests/test_classification.py index 89d9c65..42179da 100644 --- a/tests/test_classification.py +++ b/tests/test_classification.py @@ -36,7 +36,7 @@ def test_run(): report = poly(data, label, n_folds=2, verbose=1, feature_selection=False, save=False, project_name='test2') - for key, score in report.scores.mean().iteritems(): + for key, score in report.scores.mean().items(): assert score < 5, '{} score is too low'.format(key) @@ -45,7 +45,7 @@ def test_multiclass(): report = poly(data, label, n_folds=2, verbose=1, feature_selection=False, save=False, project_name='test3') - for key, score in report.scores.mean().iteritems(): + for key, score in report.scores.mean().items(): assert score < 5, '{} score is too low'.format(key) diff --git a/tests/test_multiclass.py b/tests/test_multiclass.py index a85c599..d830286 100644 --- a/tests/test_multiclass.py +++ b/tests/test_multiclass.py @@ -26,7 +26,7 @@ def test_run(): report = poly(data, label, n_folds=2, verbose=1, feature_selection=False, save=False, project_name='test2') - for key, score in report.scores.mean().iteritems(): + for key, score in report.scores.mean().items(): assert score < 5, '{} score is too low'.format(key) diff --git a/tests/test_regression.py b/tests/test_regression.py index b87da74..7bc5199 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -25,7 +25,7 @@ def test_feature_selection_regression(): assert (report_with_features.scores.mean()[:, 'train'] > 0.2).all(),\ 'train score below chance' - for key, ypred in report_with_features.predictions.iteritems(): + for key, ypred in report_with_features.predictions.items(): mse = np.linalg.norm(ypred - diabetes_target) / len(diabetes_target) assert mse < 5, '{} Prediction error is too high'.format(key)