h2o hit_ratio_table AttributeError - h2o

I'm following a tutorial from https://github.com/h2oai/h2o-tutorials/blob/master/tutorials/gbm-randomforest/GBM_RandomForest_Example.py
I have been following the tutorial until I reached the line with hit_ratio_table. when I executed
"rf_v1.hit_ratio_table(valid=True)", I encounter the error below.
>>> rf_v1.hit_ratio_table(valid=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/h2oUser/sparkling-water-2.3.0/py/build/dist/h2o_pysparkling_2.3-2.3.0.zip/h2o/utils/backward_compatibility.py", line 74, in __getattr__
File "/home/h2oUser/sparkling-water-2.3.0/py/build/dist/h2o_pysparkling_2.3-2.3.0.zip/h2o/utils/backward_compatibility.py", line 49, in __getattribute__
AttributeError: type object 'H2ORandomForestEstimator' has no attribute 'hit_ratio_table'
I tried to search if hit_ratio_table is being deprecated or not, but I can't find any links. Does anyone know if this function has been changed?

The attribute is still there, it looks like the tutorial is missing a line of code right after the file import, which means the model is being considered as a regression problem instead of a classification problem. So if you add the following line after you import the covtype dataset:
covtype_df[54] = covtype_df[54].asfactor()
which converts the target to a factor, it should work.
If you want to play around with the hit_ratio_table() you can look at this code snippet in the H2O-3 user guide.

Related

Issue Importing Models to Diffusion Bee

When trying to import a Protogen model (.ckpt file type) to Diffusion Bee, I keep getting this error:
Error Traceback (most recent call last):
File "convert_model.py", line 28, in
KeyError: 'state_dict'
[83158] Failed to execute script 'convert_model' due to unhandled exception!
The model should import without issue.

Keep on getting error while trying to upload to esp32-cam

I just got my new esp32-cam and I keeps giving me the error below even though i did everything in the tutorial video I found on youtube correctly and even watched several others and it still gives the error
Traceback (most recent call last):
File "esptool.py", line 3682, in <module>
File "esptool.py", line 3675, in _main
File "esptool.py", line 3329, in main
File "esptool.py", line 263, in __init__
File "site-packages\serial\__init__.py", line 88, in serial_for_url
File "site-packages\serial\serialwin32.py", line 78, in open
File "site-packages\serial\serialwin32.py", line 222, in _reconfigure_port
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: WindowsError(31, 'A device attached to the system is not functioning.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
does not exist or your board is not connected

Getting error when running music bot, discord rewrite

I get an error in one of my cogs. I believe it is talking about the attributes guild not being in discord.client:
File "/Users/me/Desktop/Personal Coding/Music-bot-forward/bot.py", line 27, in <module>
bot.add_cog(Player(client))
File "/Users/me/Desktop/Personal Coding/Music-bot-forward/music.py", line 16, in __init__
self.setup()
File "/Users/me/Desktop/Personal Coding/Music-bot-forward/music.py", line 19, in setup
for guild in self.bot.guilds:
AttributeError: module 'discord.client' has no attribute 'guilds'
The tutorial:https://youtube.com/watch?v=46ZHJcNnPJ8&feature=share
The code:https://pastebin.com/abgvsD29
I am new to the Discord.py library and do not really understand the docs either
The reason being was in my code,await ctx.voice.channel.connect() You would need to replace that with await ctx.author.voice.channel.connect().

Does elastalert work with ElasticSearch 6

Have an elastalert docker image (https://hub.docker.com/r/ivankrizsan/elastalert/) that worked with elasticsearch 5.6, changed to a test environment with ElasticSearch 6.1 (no index) and now get
Creating Elastalert index in Elasticsearch...
Traceback (most recent call last):
File "/usr/bin/elastalert-create-index", line 11, in <module>
load_entry_point('elastalert', 'console_scripts', 'elastalert-create-index')()
File "/opt/elastalert/elastalert/create_index.py", line 153, in main
es.indices.put_mapping(index=index, doc_type='elastalert', body=es_mapping)
File "build/bdist.linux-x86_64/egg/elasticsearch/client/utils.py", line 73, in _wrapped
File "build/bdist.linux-x86_64/egg/elasticsearch/client/indices.py", line 282, in put_mapping
File "build/bdist.linux-x86_64/egg/elasticsearch/transport.py", line 312, in perform_request
File "build/bdist.linux-x86_64/egg/elasticsearch/connection/http_requests.py", line 90, in perform_request
File "build/bdist.linux-x86_64/egg/elasticsearch/connection/base.py", line 125, in _raise_error
elasticsearch.exceptions.RequestError: TransportError(400, u'mapper_parsing_exception', u'No handler for type [string] declared on field [aggregate_id]')
As of now, elastalert does not support for elasticsearch 6.0 out of the box. Here is the open issue on github: https://github.com/Yelp/elastalert/issues/1399 that tracks the issue. A walk-around is also mentioned in https://github.com/Yelp/elastalert/pull/1426.
Please upgrade to latest version of elastalert.
I am using Elasticsearch 6.2 with ElastAlert 0.1.29 and they work properly.

Ubuntu 10.04 - Python multiprocessing - 'module' object has no attribute 'local' error

The following code is from the python 2.6 manual.
from multiprocessing import Process
import os
def info(title):
print(title)
print('module name:', 'me')
print('parent process:', os.getppid())
print('process id:', os.getpid())
def f(name):
info('function f')
print('hello', name)
if __name__ == '__main__':
info('main line')
p = Process(target=f, args=('bob',))
p.start()
p.join()
This creates the following stack traces:
Traceback (most recent call last):
File "threading.py", line 1, in <module>
from multiprocessing import Process
File "/usr/lib/python2.6/multiprocessing/__init__.py", line 64, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "/usr/lib/python2.6/multiprocessing/util.py", line 287, in <module>
class ForkAwareLocal(threading.local):
AttributeError: 'module' object has no attribute 'local'
Exception AttributeError: '_shutdown' in <module 'threading' from '/home/v0idnull/tmp/pythreads/threading.pyc'> ignored
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.6/multiprocessing/util.py", line 258, in _exit_function
info('process shutting down')
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.6/multiprocessing/util.py", line 258, in _exit_function
info('process shutting down')
TypeError: 'NoneType' object is not callable
I'm completely clueless as to WHY this is happening, and google has given me very little to work with.
that code runs fine on my machine:
Ubuntu 10.10, Python 2.6.6 64-bit.
but your error is actually because you have a file named 'threading.py' that you are running this code from (see the stack-trace details). this is causing a namespace mismatch, since the multiprocessing module needs the 'real' threading module. try renaming your file to something other than 'threading.py' and running it again.
also... the example you posted is not from the Python 2.6 docs... it is from the Python 3.x docs. make sure you are reading the docs for the version that matches what you are running.

Resources