ebonite.core.analyzer.model module

class ebonite.core.analyzer.model.ModelHook[source]

Bases: ebonite.core.analyzer.base.Hook

Base hook type for ModelAnalyzer. Analysis result is an instance of ModelWrapper

valid_types = None
process(obj, **kwargs) → ebonite.core.objects.wrapper.ModelWrapper[source]

Analyzes obj and returns result. Result type is determined by specific Hook class sub-hierarchy

Parameters:
  • obj – object to analyze
  • kwargs – additional information to be used for analysis
Returns:

analysis result

class ebonite.core.analyzer.model.BindingModelHook[source]

Bases: ebonite.core.analyzer.model.ModelHook

Binding model hook which process by first creating corresponding model wrapper (by means of a subclass) and then binding created wrapper to given model object

process(obj, **kwargs) → ebonite.core.objects.wrapper.ModelWrapper[source]

Analyzes obj and returns result. Result type is determined by specific Hook class sub-hierarchy

Parameters:
  • obj – object to analyze
  • kwargs – additional information to be used for analysis
Returns:

analysis result

class ebonite.core.analyzer.model.CallableMethodModelHook[source]

Bases: ebonite.core.analyzer.model.BindingModelHook

Hook for processing functions

can_process(obj) → bool[source]

Must return True if obj can be processed by this hook

Parameters:obj – object to analyze
Returns:True or False
must_process(obj) → bool[source]

Must return True if obj must be processed by this hook. “must” means you sure that no other hook should handle this object, for example this hook is for sklearn objects and obj is exactly that.

Parameters:obj – object to analyze
Returns:True or False