molpred package

Subpackages

Submodules

molpred.decorators module

Decorators

molpred.decorators.caching_class(cls)[source]

Decorator for classes with caching methods decorated with @caching_method. This will add a “clear_caches” method that clears each caching methods private cache.

Parameters:

cls – A class containing methods decorated with @caching_method.

Returns:

The decorated class with a new “clear_caches” method for clearing the internal caches.

molpred.decorators.caching_method(method)[source]

Decorator for a caching instance method that will re-use previous results when invoked with the same arguments. The equivalency is checked with the “is” operator complex types with the same value will still be considered different by the decorated method.

Parameters:

method – The instance method to wrap.

Returns:

The decorated instance method.

molpred.experiment module

molpred.plot module

Visualize data.

class molpred.plot.CategoryCounter(data, target_name)[source]

Bases: object

Count occurences of categorical data across different dimensions.

__init__(data, target_name)[source]
property array[source]

A 3D numpy array containing the counts of each value per feature, value, and target.

property counts[source]

The dataframe of value counts for the scatterplot.

plot(ax)[source]

Plot the counts to the given axis.

molpred.plot.group_names_by_prefix(names)[source]

Group names by common prefixes when they follow the pattern “<prefix><integer>”. Such groups are expected to represent fingerprints.

Parameters:

names – An iterable of names to group.

Returns:

A generator over Pandas Series with the names of each group.

molpred.plot.group_numeric_and_categoric(calc, features_and_targets)[source]

Group feature names by type and category group.

Parameters:
  • calc – A feature calculator instance.

  • features_and_targets – A FeaturesAndTargets instance.

Returns:

A generator over 2-tuples of Pandas series with feature names and a boolean to indicate if the names are numeric.

molpred.plot.plot_features(path, calc, features_and_targets)[source]

Plot features generated by the given feature calculator.

Parameters:
  • path – The output image page.

  • calc – A feature calculator instance.

  • features_and_targets – A FeaturesAndTargets instance with the features to plot.

molpred.plot.plot_numeric_features(ax, data, target_name)[source]
Parameters:
  • ax – The Matplotlib axis on which to plot the features.

  • data – A dataframe with features and a single target column.

  • target_name – The name of the target column.

molpred.plot.plot_text(ax, text)[source]

Plot text in the center of an axis.

Parameters:
  • ax – The axis object.

  • test – The text to display.

Module contents

Package stub.