featurehub.user package

Submodules

featurehub.user.session module

class featurehub.user.session.Session(problem, database='featurehub')[source]

Bases: object

Represents a user’s session within FeatureHub.

Includes commands for discovering, testing, and registering new features.

discover_features(code_fragment=None)[source]

Print features written by other users.

A code fragment can be used to filter search results. For each feature, prints feature id, feature description, metrics, and source code.

code_fragment : string, default=None
Source code fragment to filter for.
evaluate(feature)[source]

Evaluate feature on training dataset and return key performance metrics.

Runs the feature in an isolated environment to extract the feature values. Validates the feature values. Then, builds a model on that one feature and computes key cross-validated metrics. Prints results and returns a dictionary with (metric => value) entries. If the feature is invalid, prints reason and returns empty dictionary.

feature : function
Feature to evaluate
get_entity_features()[source]

Loads preprocessed entity-level features of problem training dataset.

The entity-level features are the same length as the entity DataFrame and the target DataFrame.

entity_features : pd.DataFrame or None

get_sample_dataset()[source]

Loads sample of problem training dataset.

Returns the dataset a dict mapping table names to pandas DataFrames.

dataset : dict (str => pd.DataFrame)
A dict mapping table names to pandas DataFrames.
target : pd.DataFrame
A DataFrame that holds a single column: the target variable (label).
>>> dataset = commands.get_sample_dataset()
>>> dataset["users"] # -> returns DataFrame
>>> dataset["stores"] # -> returns DataFrame
print_my_features(code_fragment=None)[source]

Print features written by me.

A code fragment can be used to filter search results. For each feature, prints feature id, feature description, metrics, and source code.

code_fragment : string, default=None
Source code fragment to filter for.
submit(feature, description='')[source]

Submit feature to server for evaluation on test data.

If successful, registers feature in feature database and returns key performance metrics.

Runs the feature in an isolated environment to extract the feature values. Validates the feature values. Then, builds a model on that one feature, performs cross validation, and returns key performance metrics.

feature : function
Feature to evaluate
description : str
Feature description. If left empty, will prompt for user imput.

Module contents