2021-05-08 09:01:02 -07:00
|
|
|
{ lib
|
|
|
|
, isPy27
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, scikitlearn
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-randomly
|
|
|
|
}:
|
2019-06-23 12:49:09 -07:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mlrose";
|
2019-12-19 11:31:15 -08:00
|
|
|
version = "1.3.0";
|
2019-10-03 08:24:25 -07:00
|
|
|
disabled = isPy27;
|
2019-06-23 12:49:09 -07:00
|
|
|
|
2021-05-08 09:01:02 -07:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gkhayes";
|
|
|
|
repo = "mlrose";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1dn43k3rcypj58ymcj849b37w66jz7fphw8842v6mlbij3x0rxfl";
|
2019-06-23 12:49:09 -07:00
|
|
|
};
|
|
|
|
|
2021-05-08 09:01:02 -07:00
|
|
|
patches = [
|
|
|
|
# Fixes compatibility with scikit-learn 0.24.1
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gkhayes/mlrose/pull/55/commits/19caf8616fc194402678aa67917db334ad02852a.patch";
|
|
|
|
sha256 = "1nivz3bn21nd21bxbcl16a6jmy7y5j8ilz90cjmd0xq4v7flsahf";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-06-23 12:49:09 -07:00
|
|
|
propagatedBuildInputs = [ scikitlearn ];
|
2021-05-08 09:01:02 -07:00
|
|
|
checkInputs = [ pytest-randomly pytestCheckHook ];
|
2019-06-23 12:49:09 -07:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-05-08 09:01:02 -07:00
|
|
|
substituteInPlace setup.py --replace sklearn scikit-learn
|
2019-06-23 12:49:09 -07:00
|
|
|
'';
|
|
|
|
|
2021-05-08 09:01:02 -07:00
|
|
|
pythonImportsCheck = [ "mlrose" ];
|
|
|
|
|
|
|
|
# Fix random seed during tests
|
|
|
|
pytestFlagsArray = [ "--randomly-seed 0" ];
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2019-06-23 12:49:09 -07:00
|
|
|
description = "Machine Learning, Randomized Optimization and SEarch";
|
|
|
|
homepage = "https://github.com/gkhayes/mlrose";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|