-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from UBC-MDS/score_df_docstring
adding scoring_df docstring
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
def compare_f1(estimators, X, y): | ||
""" | ||
Show cross validation results, including fit time and f1 scores for each estimator. | ||
Parameters | ||
---------- | ||
estimators : list of tuples | ||
A list of (name, estimator) tuples, consisting of individual estimators to be processed through the voting or stacking classifying ensemble. Each tuple contains a string: name/label of estimator, and a model: the estimator, which implements | ||
the scikit-learn API (`fit`, `predict`, etc.). | ||
X_train : Pandas data frame | ||
Data frame containing training data along with n features. | ||
y_train : Pandas series | ||
Target class labels for data in X_train. | ||
Returns: | ||
-------- | ||
Pandas data frame | ||
A data frame showing cross validation results on training data, with 3 columns: fit_time, test_score, train_score and 1 rows for each estimator. | ||
Example: | ||
-------- | ||
>>> estimators = [ | ||
... ('rf', RandomForestClassifier(n_estimators=10, random_state=42)), | ||
... ('svm', make_pipeline(StandardScaler(), LinearSVC(random_state=42))) | ||
... ] | ||
>>> compare_f1(estimators, X, y) | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters