mlm_insights.builder package

Subpackages

Submodules

mlm_insights.builder.builder_component module

class mlm_insights.builder.builder_component.EngineDetail(engine_name: str | mlm_insights.constants.types.ExecutionEngineType, engine_client: Any = None)

Bases: object

engine_client: Any = None
engine_name: str | ExecutionEngineType

Execution engine client created and passed by application. Insights uses this client, if passed.

class mlm_insights.builder.builder_component.MetricDetail(univariate_metric: Dict[str, List[mlm_insights.core.metrics.metric_metadata.MetricMetadata]], dataset_metrics: List[mlm_insights.core.metrics.metric_metadata.MetricMetadata] | NoneType)

Bases: object

dataset_metrics: List[MetricMetadata] | None
univariate_metric: Dict[str, List[MetricMetadata]]
class mlm_insights.builder.builder_component.RunResult(profile: mlm_insights.core.profiles.profile.Profile, test_results: Union[mlm_insights.tests.test_results.TestResults, NoneType], post_processor_run_result: Dict[str, mlm_insights.core.post_processors.post_processor_result.PostProcessorResult] = <factory>)

Bases: object

post_processor_run_result: Dict[str, PostProcessorResult]
profile: Profile
test_results: TestResults | None
class mlm_insights.builder.builder_component.TestConfig(tests: List[mlm_insights.tests.test_types.interfaces.test_base.TestBase] = <factory>, user_defined_tags: Dict[str, str] = <factory>)

Bases: object

tests: List[TestBase]
user_defined_tags: Dict[str, str]

mlm_insights.builder.insights_builder module

class mlm_insights.builder.insights_builder.InsightsBuilder

Bases: object

Builder class for MLInsights Library. This will be used to build a Runner class instance using the builder components.

build() Runner

Method to build and return the Runner object and validate if required parameters are provided to create a Runner object.

Returns

Runner

An Instance of Runner.

with_data_frame(data_frame: Any) InsightsBuilder

Method to set the data frame in the builder object.

Parameters

data_frameAny

Data Frame object.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_engine(engine: EngineDetail) InsightsBuilder

Method to set the engine detail in the builder object.

Parameters

engineEngineDetail

EngineDetail object type.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_input_schema(input_schema: Dict[str, FeatureType]) InsightsBuilder

Method to set the schema of the input data in the builder object.

Parameters

input_schemaDict[str, FeatureType]

Dictionary of feature name string as key and feature type object as value.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_input_schema_using_dataset(dataset_location: str, target_features: List[str] = [], prediction_features: List[str] = [], prediction_score_features: List[str] = []) InsightsBuilder

Method to set the approximated input_schema based on the dataset in the builder object.

Parameters

dataset_locationstr

The location of sample dataset. It supports local file storage url only.

target_featuresList[str]

List of target_features names

prediction_featuresList[str]

List of prediction_features names

prediction_score_featuresList[str]

List of prediction_score_features names

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_metrics(metrics: MetricDetail) InsightsBuilder

Method to set the MetricDetail for the feature in the builder object.

Parameters

metricsMetricDetail

MetricDetail object type.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_post_processors(post_processors: List[PostProcessor]) InsightsBuilder

Method to set the list of post processors in the builder object.

Parameters

post_processorsList[PostProcessor]

List of post processors.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_reader(reader: DataReader) InsightsBuilder

Method to set the reader in the builder object.

Parameters

readerDataReader

Reader object instance.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_reference_profile(profile: Profile | ProfileReader | None) InsightsBuilder

Method to set the reference profile in the builder object, either by passing the profile directly or by specifying a Profile reader. Profile reader is used to read the reference profile for the run.

Parameters

profile : Profile or ProfileReader

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_tags(tags: Tags) InsightsBuilder

Method to set the tags of a Profile.

Parameters

tags : Tags

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_test_config(test_config: TestConfig) InsightsBuilder

Method to set the tests config in the builder object. Test config contains a list of test and user defined tags.

Parameters

test_config : TestConfig

Returns

InsightsBuilder

An Instance of InsightsBuilder.

with_transformers(transformers: List[Transformer]) InsightsBuilder

Method to set the list of transformers in the builder object.

Parameters

transformersList[Transformer]

List of transformers.

Returns

InsightsBuilder

An Instance of InsightsBuilder.

mlm_insights.builder.schema_helper module

class mlm_insights.builder.schema_helper.SchemaHelper(input_schema: Schema, quantitative_features: List[Field] | None, categorical_features: List[Field] | None)

Bases: object

Class to provide Insights schema related APIs

are_prediction_target_types_same() bool
get_categorical_features(max_features_count: int) List[str]
get_prediction_features() List[Field]
get_prediction_score_feature() List[Field]
get_prediction_types() Dict[Any, Any] | None
get_quantitative_features(max_features_count: int) List[str]
get_target_features() List[Field]
get_target_types() Dict[Any, Any] | None
has_prediction_score_column() bool
is_not_binary_or_multiclass() bool
is_valid_classification_types() bool
is_valid_regression_types() bool
static to_insights_schema(pa_schema: Schema) Dict[str, FeatureType]
mlm_insights.builder.schema_helper.map_to_name(field: Field) str

Module contents