Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
5565dcdd
Commit
5565dcdd
authored
Dec 23, 2019
by
Aymeric Augustin
Browse files
Remove warning when scikit-learn isn't available.
Most users don't need it.
parent
23dad844
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
src/transformers/data/metrics/__init__.py
src/transformers/data/metrics/__init__.py
+0
-6
No files found.
src/transformers/data/metrics/__init__.py
View file @
5565dcdd
...
...
@@ -14,18 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
logging
logger
=
logging
.
getLogger
(
__name__
)
try
:
from
scipy.stats
import
pearsonr
,
spearmanr
from
sklearn.metrics
import
matthews_corrcoef
,
f1_score
_has_sklearn
=
True
except
(
AttributeError
,
ImportError
)
as
e
:
logger
.
warning
(
"To use data.metrics please install scikit-learn. See https://scikit-learn.org/stable/index.html"
)
_has_sklearn
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment