Пример #1
0
    def test_model_from_vDF(self, titanic_vd):
        model_test = KernelDensity("KernelDensity_from_vDF_tmp",)
        model_test.drop()
        model_test.fit(titanic_vd, ["age", "fare"])
        titanic_copy = model_test.predict(titanic_vd.copy(), name="kde")

        assert titanic_copy["kde"].mean() == pytest.approx(
            1.82115211838814e-06, abs=1e-6
        )
        model_test.drop()
Пример #2
0
    def test_model_from_vDF(self, base, titanic_vd):
        model_test = KernelDensity("KernelDensity_from_vDF_tmp",
                                   cursor=base.cursor)
        model_test.drop()
        model_test.fit(
            titanic_vd,
            [
                "age",
                "fare",
            ],
        )
        titanic_copy = model_test.predict(titanic_vd.copy(), name="kde")

        assert titanic_copy["kde"].mean() == pytest.approx(
            6.52177350119195e-07, abs=1e-6)
        model_test.drop()