You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tomas Fryda commented: [~accountid:5dc4f5bbb6e6b50c58af0624] The problem with python is easy to solve (currently it expects that a user always provides the {{server}} keyword which should be optional).
The R part seems to me that is correct, I didn’t find any mention in the documentation that {{varimp}} should be supported in R. You can use {{birds_pca@model$importance}} or {{summary(birds_pca)}} to display the “varimp”.
Maybe I am missing something, I looked just in [https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/pca.html#faq|https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/pca.html#faq|smart-link] and the {{varimp}} is there mentioned only for python to get the same result as in R’s {{@model$importance}}.
Python fails:
{code:python}from h2o.estimators import H2OPrincipalComponentAnalysisEstimator
Import the birds dataset into H2O:
birds = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/pca_test/birds.csv")
Split the dataset into a train and valid set:
train, valid = birds.split_frame(ratios = [.8], seed = 1234)
Build and train the model:
birds_pca = H2OPrincipalComponentAnalysisEstimator(k = 5,
use_all_factor_levels = True,
pca_method = "glrm",
transform = "standardize",
impute_missing = True)
birds_pca.train(training_frame = train)
birds_pca.screeplot()
{code}
KeyError Traceback (most recent call last)
in
----> 1 birds_pca.screeplot()
~/anaconda3/envs/py_36/lib/python3.6/site-packages/h2o/model/dim_reduction.py in screeplot(self, type, **kwargs)
104 """
105 # check for matplotlib. exit if absent.
--> 106 is_server = kwargs.pop("server")
107 if kwargs:
108 raise ValueError("Unknown arguments %s to screeplot()" % ", ".join(kwargs.keys()))
KeyError: 'server
R fails:
{code:r}h2o.varimp(birds_pca)
Warning message:
“This model doesn't have variable importances”{code}
The text was updated successfully, but these errors were encountered: