Remove warning when scikit-learn isn't available.

Most users don't need it.
This commit is contained in:
Aymeric Augustin 2019-12-23 21:16:26 +01:00
parent 23dad8447c
commit 5565dcdd35

View File

@ -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