Hi,
I had an issue running the machine learning example “Train random forests with uncertainty estimates”. See the following error.
lolopy installed is version 1.0.1.
Please let me know if you can help.
Thanks,
Zhi-Gang
Get the Residuals and RF Uncertainty
As described in the Ling paper, ideally-calibrated uncertainty estimaes should have a particular relationship with the errors of a machine learning model. Specifically, the distribution of r(x)/σ(x)r(x)/σ(x) where r(x)r(x) is the residual of the prediction and σ(x)σ(x) is the uncertainty of the prediction for x should have a Gaussian distribution with zero mean and unit standard deviation.
In [25]:
model = RandomForestRegressor()
<details class='elided'>
<summary title='Show trimmed content'>···</summary>
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-25-93628cc3c8c1> in <module>()
----> 1 model = RandomForestRegressor()
~/anaconda3/lib/python3.6/site-packages/lolopy/learners.py in __init__(self, num_trees, use_jackknife, bias_learner, leaf_learner, subset_strategy, min_leaf_instances, max_depth, uncertainty_calibration, randomize_pivot_location)
273 randomize_pivot_location (bool): whether to draw pivots randomly or always select the midpoint
274 """
--> 275 super(RandomForestMixin, self).__init__()
276
277 # Store the variables
~/anaconda3/lib/python3.6/site-packages/lolopy/learners.py in __init__(self)
31
32 def __init__(self):
---> 33 self.gateway = get_java_gateway()
34
35 # Create a placeholder for the model
~/anaconda3/lib/python3.6/site-packages/lolopy/loloserver.py in get_java_gateway(reuse, skip_devel_version)
72 classpath=os.path.pathsep.join([os.path.abspath(lolo_path)]),
73 javaopts=java_options,
---> 74 redirect_stdout=sys.stdout, die_on_exit=True)
75 return _lolopy_gateway
~/anaconda3/lib/python3.6/site-packages/py4j/java_gateway.py in launch_gateway(cls, port, jarpath, classpath, javaopts, die_on_exit, redirect_stdout, redirect_stderr, daemonize_redirect, java_path, create_new_process_group, enable_auth)
2111 daemonize_redirect=daemonize_redirect, java_path=java_path,
2112 create_new_process_group=create_new_process_group,
-> 2113 enable_auth=enable_auth)
2114 if enable_auth:
2115 _port, _auth_token = _ret
~/anaconda3/lib/python3.6/site-packages/py4j/java_gateway.py in launch_gateway(port, jarpath, classpath, javaopts, die_on_exit, redirect_stdout, redirect_stderr, daemonize_redirect, java_path, create_new_process_group, enable_auth)
325 # Determine which port the server started on (needed to support
326 # ephemeral ports)
--> 327 _port = int(proc.stdout.readline())
328
329 # Read the auth token from the server if enabled.
ValueError: invalid literal for int() with base 10: b''