This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Added compute_correlation_coeff method to utils and separated it from the predict method to ensure single responsbility. 2. Added tests accordingly. 3. In the notebook added a scrap to track preditions and assert it in tests. 4. Also added extra documentation to explain what the predict method is doing. 5. Minor fix to stop train at max_epoch.
- Loading branch information
Showing
6 changed files
with
142 additions
and
49 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
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
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,16 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import numpy as np | ||
|
||
from utils_nlp.eval.classification import compute_correlation_coefficients | ||
|
||
|
||
def test_compute(): | ||
x = np.random.rand(2, 100) | ||
df = compute_correlation_coefficients(x) | ||
assert df.shape == (2, 2) | ||
|
||
y = np.random.rand(2, 100) | ||
df = compute_correlation_coefficients(x, y) | ||
assert df.shape == (4, 4) |
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