diff --git a/api_examples/feature_monitoring.ipynb b/api_examples/feature_monitoring.ipynb index 3586b081..37449e37 100644 --- a/api_examples/feature_monitoring.ipynb +++ b/api_examples/feature_monitoring.ipynb @@ -45,21 +45,10 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "78326a44", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Connected. Call `.close()` to terminate connection gracefully.\n", - "\n", - "Logged in to project, explore it here https://hopsworks0.logicalclocks.com/p/120\n", - "Connected. Call `.close()` to terminate connection gracefully.\n" - ] - } - ], + "outputs": [], "source": [ "import hopsworks\n", "import numpy as np\n", @@ -82,7 +71,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "42e1c8b0", "metadata": {}, "outputs": [], @@ -120,42 +109,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "a1ad04fa", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Feature Group created successfully, explore it at \n", - "https://hopsworks0.logicalclocks.com/p/120/fs/68/fg/14\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "719e5cea6dca47bdbfd8e87f5b145c45", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Uploading Dataframe: 0.00% | | Rows 0/106020 | Elapsed Time: 00:00 | Remaining Time: ?" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Launching job: trans_fg_1_offline_fg_materialization\n", - "Job started successfully, you can follow the progress at \n", - "https://hopsworks0.logicalclocks.com/p/120/jobs/named/trans_fg_1_offline_fg_materialization/executions\n" - ] - } - ], + "outputs": [], "source": [ "# Feature Group\n", "trans_fg = fs.get_or_create_feature_group(\n", @@ -174,32 +131,15 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "176ad761", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Feature view created successfully, explore it at \n", - "https://hopsworks0.logicalclocks.com/p/120/fs/68/fv/trans_fv/version/1\n", - "Training dataset job started successfully, you can follow the progress at \n", - "https://hopsworks0.logicalclocks.com/p/120/jobs/named/trans_fv_1_create_fv_td_16022024133852/executions\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "VersionWarning: Incremented version to `1`.\n" - ] - } - ], + "outputs": [], "source": [ "query = trans_fg.select([\"fraud_label\", \"amount\", \"cc_num\"])\n", "\n", - "min_max_scaler = fs.get_transformation_function(name=\"min_max_scaler\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import min_max_scaler\n", "\n", "transformation_functions = [\n", " min_max_scaler(\"amount\") \n", @@ -224,26 +164,10 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "29ae9922", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Training dataset job started successfully, you can follow the progress at \n", - "https://hopsworks0.logicalclocks.com/p/120/jobs/named/trans_fv_1_create_fv_td_16022024134233/executions\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "VersionWarning: Incremented version to `2`.\n" - ] - } - ], + "outputs": [], "source": [ "_, _ = trans_fv.create_train_validation_test_split(\n", " description = 'test extra filters',\n", @@ -275,7 +199,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "b82685fb", "metadata": {}, "outputs": [], @@ -303,7 +227,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "703da6cc", "metadata": {}, "outputs": [], @@ -325,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "28a891bf", "metadata": {}, "outputs": [], @@ -347,7 +271,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "fa5651be", "metadata": {}, "outputs": [], @@ -382,7 +306,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "dce248fb", "metadata": {}, "outputs": [], @@ -408,21 +332,10 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "7fcc0236", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "FeatureMonitoringConfig('fg_amount_monitoring_reference_value', STATISTICS_COMPARISON)" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "fg_amount_monitoring_reference_value.with_reference_value(\n", " value=100,\n", @@ -444,7 +357,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "b5ecd419", "metadata": {}, "outputs": [], @@ -477,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "2acd07e4", "metadata": {}, "outputs": [], @@ -530,7 +443,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "07c863f2", "metadata": {}, "outputs": [], @@ -554,25 +467,10 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "58483800", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[FeatureMonitoringConfig('fg_full_monitoring_sliding', STATISTICS_COMPUTATION),\n", - " FeatureMonitoringConfig('fg_full_monitoring', STATISTICS_COMPUTATION),\n", - " FeatureMonitoringConfig('fg_amount_monitoring_reference_value', STATISTICS_COMPARISON),\n", - " FeatureMonitoringConfig('fg_amount_monitoring_reference_sliding', STATISTICS_COMPARISON),\n", - " FeatureMonitoringConfig('fg_amount_feature_monitoring', STATISTICS_COMPUTATION)]" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "trans_fg.get_feature_monitoring_configs()" ] @@ -587,21 +485,10 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "3372c2d8", "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "FeatureMonitoringConfig('fg_full_monitoring', STATISTICS_COMPUTATION)" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "trans_fg.get_feature_monitoring_configs(name=\"fg_full_monitoring\")" ] @@ -624,7 +511,7 @@ "hash": "e1ddeae6eefc765c17da80d38ea59b893ab18c0c0904077a035ef84cfe367f83" }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -638,7 +525,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.5" } }, "nbformat": 4, diff --git a/batch-ai-systems/churn/2_churn_training_pipeline.ipynb b/batch-ai-systems/churn/2_churn_training_pipeline.ipynb index e28c9738..a922bd33 100644 --- a/batch-ai-systems/churn/2_churn_training_pipeline.ipynb +++ b/batch-ai-systems/churn/2_churn_training_pipeline.ipynb @@ -158,9 +158,9 @@ "metadata": {}, "outputs": [], "source": [ - "# Load transformation functions from the feature store\n", - "min_max_scaler = fs.get_transformation_function(name=\"min_max_scaler\")\n", - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder, min_max_scaler\n", + "\n", "\n", "# Define lists of numerical and categorical features\n", "numerical_features = [\"tenure\", \"monthlycharges\", \"totalcharges\"]\n", diff --git a/batch-ai-systems/credit_scores/3_credit_scores_training_pipeline.ipynb b/batch-ai-systems/credit_scores/3_credit_scores_training_pipeline.ipynb index 24c3f4be..b1ba4d5d 100644 --- a/batch-ai-systems/credit_scores/3_credit_scores_training_pipeline.ipynb +++ b/batch-ai-systems/credit_scores/3_credit_scores_training_pipeline.ipynb @@ -286,8 +286,8 @@ "# Extracting the names of categorical columns in the 'selected_features_show5query_show5' DataFrame\n", "cat_cols = selected_features_show5.dtypes[selected_features_show5.dtypes == 'object'].index\n", "\n", - "# Retrieving the Label Encoder transformation function from Featuretools\n", - "label_encoder = fs.get_transformation_function(name='label_encoder') \n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder\n", "\n", "# Creating a dictionary of transformation functions, where each categorical column is associated with the Label Encoder\n", "transformation_functions = [\n", diff --git a/batch-ai-systems/fraud_batch/2_fraud_batch_training_pipeline.ipynb b/batch-ai-systems/fraud_batch/2_fraud_batch_training_pipeline.ipynb index 993d300b..e131d0ab 100644 --- a/batch-ai-systems/fraud_batch/2_fraud_batch_training_pipeline.ipynb +++ b/batch-ai-systems/fraud_batch/2_fraud_batch_training_pipeline.ipynb @@ -155,8 +155,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load transformation functions.\n", - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder\n", "\n", "# Map features to transformations.\n", "transformation_functions = [\n", diff --git a/batch-ai-systems/hospital_wait_time/2_training_pipeline.ipynb b/batch-ai-systems/hospital_wait_time/2_training_pipeline.ipynb index 56b0f4ae..9c52242f 100644 --- a/batch-ai-systems/hospital_wait_time/2_training_pipeline.ipynb +++ b/batch-ai-systems/hospital_wait_time/2_training_pipeline.ipynb @@ -139,9 +139,8 @@ "metadata": {}, "outputs": [], "source": [ - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", - "\n", - "standard_scaler = fs.get_transformation_function(name=\"standard_scaler\")" + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder, standard_scaler" ] }, { diff --git a/integrations/mage_ai/mage_tutorial/custom/transactions_feature_view.py b/integrations/mage_ai/mage_tutorial/custom/transactions_feature_view.py index f5e9bfe0..8dfcf89a 100644 --- a/integrations/mage_ai/mage_tutorial/custom/transactions_feature_view.py +++ b/integrations/mage_ai/mage_tutorial/custom/transactions_feature_view.py @@ -39,8 +39,8 @@ def transform_custom(*args, **kwargs): query = trans_fg.select(["fraud_label", "category", "amount", "age_at_transaction", "days_until_card_expires", "loc_delta"])\ .join(window_aggs_fg.select_except(["cc_num"])) - # Load transformation functions. - label_encoder = fs.get_transformation_function(name="label_encoder") + # Import transformation functions from Hopsworks. + from hopsworks.hsfs.builtin_transformations import label_encoder # Map features to transformations. transformation_functions = [ diff --git a/integrations/mage_ai/mage_tutorial/data_exporters/transactions_feature_view.py b/integrations/mage_ai/mage_tutorial/data_exporters/transactions_feature_view.py index 00ab82d7..53480429 100644 --- a/integrations/mage_ai/mage_tutorial/data_exporters/transactions_feature_view.py +++ b/integrations/mage_ai/mage_tutorial/data_exporters/transactions_feature_view.py @@ -37,8 +37,8 @@ def create_feature_view(data, *args, **kwargs): query = trans_fg.select(["fraud_label", "category", "amount", "age_at_transaction", "days_until_card_expires", "loc_delta"])\ .join(window_aggs_fg.select_except(["cc_num"])) - # Load transformation functions. - label_encoder = fs.get_transformation_function(name="label_encoder") + # Import transformation functions from Hopsworks. + from hopsworks.hsfs.builtin_transformations import label_encoder # Map features to transformations. transformation_functions = [ diff --git a/integrations/neo4j/2_training_pipeline.ipynb b/integrations/neo4j/2_training_pipeline.ipynb index 55309c48..c0c95c66 100644 --- a/integrations/neo4j/2_training_pipeline.ipynb +++ b/integrations/neo4j/2_training_pipeline.ipynb @@ -145,8 +145,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load built in transformation functions.\n", - "min_max_scaler = fs.get_transformation_function(name=\"min_max_scaler\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import min_max_scaler\n", "\n", "# Map features to transformations.\n", "transformation_functions = [\n", diff --git a/integrations/polars/quickstart_polars.ipynb b/integrations/polars/quickstart_polars.ipynb index 17f66b06..2c5ff9e9 100644 --- a/integrations/polars/quickstart_polars.ipynb +++ b/integrations/polars/quickstart_polars.ipynb @@ -470,8 +470,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load transformation functions.\n", - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder\n", "\n", "# Map features to transformations.\n", "transformation_functions = [\n", diff --git a/integrations/pyspark_streaming/2_training_pipeline.ipynb b/integrations/pyspark_streaming/2_training_pipeline.ipynb index 7e93195f..134f98ed 100644 --- a/integrations/pyspark_streaming/2_training_pipeline.ipynb +++ b/integrations/pyspark_streaming/2_training_pipeline.ipynb @@ -157,8 +157,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load transformation functions.\n", - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder\n", "\n", "# Map features to transformations.\n", "transformation_functions = [\n", diff --git a/integrations/wandb/2_feature_view_creation.ipynb b/integrations/wandb/2_feature_view_creation.ipynb index 9bde6b6f..97e00e5b 100755 --- a/integrations/wandb/2_feature_view_creation.ipynb +++ b/integrations/wandb/2_feature_view_creation.ipynb @@ -105,9 +105,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load transformation functions.\n", - "min_max_scaler = fs.get_transformation_function(name=\"min_max_scaler\")\n", - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder, min_max_scaler\n", "\n", "# Map features to transformations.\n", "transformation_functions = {\n", diff --git a/quickstart.ipynb b/quickstart.ipynb index 69fbdb52..f8113b6b 100644 --- a/quickstart.ipynb +++ b/quickstart.ipynb @@ -521,8 +521,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load transformation functions.\n", - "label_encoder = fs.get_transformation_function(name=\"label_encoder\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import label_encoder\n", "\n", "# Map features to transformations.\n", "transformation_functions = [\n", @@ -1102,7 +1102,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1116,7 +1116,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.5" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/real-time-ai-systems/aml/2_aml_training_pipeline.ipynb b/real-time-ai-systems/aml/2_aml_training_pipeline.ipynb index d45af93f..c2589f4a 100644 --- a/real-time-ai-systems/aml/2_aml_training_pipeline.ipynb +++ b/real-time-ai-systems/aml/2_aml_training_pipeline.ipynb @@ -136,8 +136,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Load built in transformation functions.\n", - "min_max_scaler = fs.get_transformation_function(name=\"min_max_scaler\")\n", + "# Import transformation functions from Hopsworks.\n", + "from hopsworks.hsfs.builtin_transformations import min_max_scaler\n", "\n", "# Map features to transformations.\n", "transformation_functions = [\n",