Delete iris-feature-pipeline.py
Browse files- iris-feature-pipeline.py +0 -33
iris-feature-pipeline.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import modal
|
| 3 |
-
|
| 4 |
-
LOCAL=False
|
| 5 |
-
|
| 6 |
-
if LOCAL == False:
|
| 7 |
-
stub = modal.Stub()
|
| 8 |
-
image = modal.Image.debian_slim().pip_install(["hopsworks","joblib","seaborn","sklearn","dataframe-image"])
|
| 9 |
-
|
| 10 |
-
@stub.function(image=image, schedule=modal.Period(days=1), secret=modal.Secret.from_name("jim-hopsworks-ai"))
|
| 11 |
-
def f():
|
| 12 |
-
g()
|
| 13 |
-
|
| 14 |
-
def g():
|
| 15 |
-
import hopsworks
|
| 16 |
-
import pandas as pd
|
| 17 |
-
|
| 18 |
-
project = hopsworks.login()
|
| 19 |
-
fs = project.get_feature_store()
|
| 20 |
-
iris_df = pd.read_csv("https://repo.hops.works/master/hopsworks-tutorials/data/iris.csv")
|
| 21 |
-
iris_fg = fs.get_or_create_feature_group(
|
| 22 |
-
name="iris_modal",
|
| 23 |
-
version=1,
|
| 24 |
-
primary_key=["sepal_length","sepal_width","petal_length","petal_width"],
|
| 25 |
-
description="Iris flower dataset")
|
| 26 |
-
iris_fg.insert(iris_df, write_options={"wait_for_job" : False})
|
| 27 |
-
|
| 28 |
-
if __name__ == "__main__":
|
| 29 |
-
if LOCAL == True :
|
| 30 |
-
g()
|
| 31 |
-
else:
|
| 32 |
-
with stub.run():
|
| 33 |
-
f()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|