Skip to content

Instantly share code, notes, and snippets.

@joshreini1
Last active September 6, 2022 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshreini1/468711c75a89ae8e85cd7ab17651b7af to your computer and use it in GitHub Desktop.
Save joshreini1/468711c75a89ae8e85cd7ab17651b7af to your computer and use it in GitHub Desktop.
Set up TruEra workspace, split data and add data collection
import truera
#set up TruEra workspace
from truera.client.truera_workspace import TrueraWorkspace
from truera.client.truera_authentication import BasicAuthentication
auth = BasicAuthentication(USERNAME, PASSWORD)
tru = TrueraWorkspace(CONNECTION_STRING, auth, verify_cert = False)
tru.set_environment("remote")
tru.set_project("airbnb_sf_price", score_type="regression")
#create data collection or schema
tru.add_data_collection(data_collection_name = "sf_data_collection_v1",
pre_to_post_feature_map = feature_map_data,
provide_transform_with_model=True)
#add data splits to collection
tru.add_data_split("train", pre_data = X_train, label_data=y_train, split_type="train")
tru.add_data_split("test", pre_data = X_test, label_data=y_test, split_type="test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment