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")
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()