def test_vDF_density(self, iris_vd):
     # testing vDataFrame[].density
     try:
         create_verticapy_schema(iris_vd._VERTICAPY_VARIABLES_["cursor"])
     except:
         pass
     for kernel in ["gaussian", "logistic", "sigmoid", "silverman"]:
         result = iris_vd["PetalLengthCm"].density(
             kernel=kernel,
             nbins=20,
             color="b",
         )
         assert max(result.get_default_bbox_extra_artists()[1].get_data()
                    [1]) < 0.25
         plt.close("all")
     for kernel in ["gaussian", "logistic", "sigmoid", "silverman"]:
         result = iris_vd["PetalLengthCm"].density(
             kernel=kernel,
             nbins=20,
             by="Species",
             color="b",
         )
         assert len(result.get_default_bbox_extra_artists()) < 20
         plt.close("all")
     # testing vDataFrame.density
     for kernel in ["gaussian", "logistic", "sigmoid", "silverman"]:
         result = iris_vd.density(
             kernel=kernel,
             nbins=20,
             color="b",
         )
         assert max(result.get_default_bbox_extra_artists()[5].get_data()
                    [1]) < 0.37
         plt.close("all")
Esempio n. 2
0
def model(titanic_vd):
    create_verticapy_schema()
    model_class = DBSCAN("DBSCAN_model_test", )
    model_class.drop()
    model_class.fit("public.titanic", ["age", "fare"])
    yield model_class
    model_class.drop()
Esempio n. 3
0
def model(titanic_vd):
    create_verticapy_schema()
    model_class = KNeighborsClassifier("knn_model_test", )
    model_class.drop()
    model_class.fit("public.titanic", ["age", "fare"], "survived")
    yield model_class
    model_class.drop()
Esempio n. 4
0
def model(commodities_vd):
    create_verticapy_schema()
    model_class = VAR("var_model_test", p=1)
    model_class.drop()
    model_class.fit("public.commodities", ["gold", "oil"], "date")
    yield model_class
    model_class.drop()
Esempio n. 5
0
def model(titanic_vd):
    create_verticapy_schema()
    model_class = KernelDensity("KernelDensity_model_test",)
    model_class.drop()
    model_class.fit("public.titanic", ["age", "fare"])
    yield model_class
    model_class.drop()
Esempio n. 6
0
def model(titanic_vd):
    create_verticapy_schema()
    model_class = LocalOutlierFactor("lof_model_test",)
    model_class.drop()
    model_class.fit("public.titanic", ["age", "fare"])
    yield model_class
    model_class.drop()
Esempio n. 7
0
def model(titanic_vd):
    create_verticapy_schema()
    model_class = CountVectorizer("model_test_countvectorizer", )
    model_class.drop()
    model_class.fit("public.titanic", ["name"])
    yield model_class
    model_class.drop()
Esempio n. 8
0
def model(titanic_vd):
    create_verticapy_schema()
    model_class = NearestCentroid("nc_model_test", )
    model_class.drop()
    model_class.fit("public.titanic", ["age", "fare"], "survived")
    yield model_class
    model_class.drop()
Esempio n. 9
0
def model(base, amazon_vd):
    try:
        create_verticapy_schema(base.cursor)
    except:
        pass
    model_class = SARIMAX("sarimax_model_test", cursor=base.cursor, p=1, d=1, q=1, s=12, P=1, D=1, Q=1, max_pik=20)
    model_class.drop()
    model_class.fit("public.amazon", "number", "date",)
    yield model_class
    model_class.drop()
def model(base, titanic_vd):
    try:
        create_verticapy_schema(base.cursor)
    except:
        pass
    model_class = KNeighborsClassifier("knn_model_test", cursor=base.cursor)
    model_class.drop()
    model_class.fit("public.titanic", [
        "age",
        "fare",
    ], "survived")
    yield model_class
    model_class.drop()
def model(base, titanic_vd):
    try:
        create_verticapy_schema(base.cursor)
    except:
        pass
    model_class = NearestCentroid("nc_model_test", cursor=base.cursor)
    model_class.drop()
    model_class.fit("public.titanic", [
        "age",
        "fare",
    ], "survived")
    yield model_class
    model_class.drop()
Esempio n. 12
0
def model(amazon_vd):
    create_verticapy_schema()
    model_class = SARIMAX("sarimax_model_test",
                          p=1,
                          d=1,
                          q=1,
                          s=12,
                          P=1,
                          D=1,
                          Q=1,
                          max_pik=20)
    model_class.drop()
    model_class.fit("public.amazon", "number", "date")
    yield model_class
    model_class.drop()
Esempio n. 13
0
def model(base, titanic_vd):
    try:
        create_verticapy_schema(base.cursor)
    except:
        pass
    model_class = LocalOutlierFactor("lof_model_test", cursor=base.cursor)
    model_class.drop()
    model_class.fit(
        "public.titanic",
        [
            "age",
            "fare",
        ],
    )
    yield model_class
    model_class.drop()
Esempio n. 14
0
def model(base, titanic_vd):
    try:
        create_verticapy_schema(base.cursor)
    except:
        pass
    model_class = KernelDensity("KernelDensity_model_test", cursor=base.cursor)
    model_class.drop()
    model_class.fit(
        "public.titanic",
        [
            "age",
            "fare",
        ],
    )
    yield model_class
    model_class.drop()
Esempio n. 15
0
def model(base, commodities_vd):
    try:
        create_verticapy_schema(base.cursor)
    except:
        pass
    model_class = VAR(
        "var_model_test",
        cursor=base.cursor,
        p=1,
    )
    model_class.drop()
    model_class.fit(
        "public.commodities",
        ["gold", "oil"],
        "date",
    )
    yield model_class
    model_class.drop()