Skip to content

AttributeError: type object 'ModelBase' has no attribute 'metalearner' #159

@THESHAMIK

Description

@THESHAMIK

Hi, I am trying this code ::
model_ids = list(aml.leaderboard['model_id'].as_data_frame().iloc[:,0])
model_ids
The o/p is 👍
['GBM_3_AutoML_2_20220607_145812',
'GBM_4_AutoML_2_20220607_145812',
'GBM_2_AutoML_2_20220607_145812',
'StackedEnsemble_AllModels_1_AutoML_2_20220607_145812',
'GBM_grid_1_AutoML_2_20220607_145812_model_1',
'StackedEnsemble_BestOfFamily_1_AutoML_2_20220607_145812',
'GBM_5_AutoML_2_20220607_145812',
'DRF_1_AutoML_2_20220607_145812',
'XRT_1_AutoML_2_20220607_145812',
'GLM_1_AutoML_2_20220607_145812',
'GBM_1_AutoML_2_20220607_145812',
'DeepLearning_1_AutoML_2_20220607_145812']

se = h2o.get_model([mid for mid in model_ids if "GBM" in mid][2])
#metalearner = h2o.get_model(se.metalearner()[0])
se

Upto here its ok & I can view se BUT ::
metalearner = h2o.get_model(aml.leader.metalearner()['GBM'])
OR I try this out::
metalearner = h2o.get_model(se.metalearner()['GBM'])

In both case, I get the same error ::::

AttributeError: type object 'ModelBase' has no attribute 'metalearner'

I also tried with other options like ==> "StackedEnsemble_AllModels" --> still same error msg.

The h2o.init() has this:

Checking whether there is an H2O instance running at http://localhost:54321 . connected.
H2O_cluster_uptime: 22 hours 13 mins
H2O_cluster_timezone: Asia/Kolkata
H2O_data_parsing_timezone: UTC
H2O_cluster_version: 3.36.1.1
H2O_cluster_version_age: 1 month and 24 days
H2O_cluster_name: H2O_from_python_shamik_bhattacharya_b6w07m
H2O_cluster_total_nodes: 1
H2O_cluster_free_memory: 3.764 Gb
H2O_cluster_total_cores: 6
H2O_cluster_allowed_cores: 6
H2O_cluster_status: locked, healthy
H2O_connection_url: http://localhost:54321
H2O_connection_proxy: {"http": null, "https": null}
H2O_internal_security: False
Python_version: 3.7.13 final

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions