h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
http://h2o.ai
Apache License 2.0
6.92k stars 2k forks source link

CityBike python demo fails with not implement == operator #13817

Closed exalate-issue-sync[bot] closed 1 year ago

exalate-issue-sync[bot] commented 1 year ago

This is with top-of-tree as of today.

h2o-dev/h2o-py/demos/CitiBike_Demo.ipynb

Also, most rain numbers are missing - lets assume those are zero rain days

rain = wthr4["Rain (mm)"] rain[rain == None ] = 0 ​

NotImplementedError Traceback (most recent call last)

in () 1 # Also, most rain numbers are missing - lets assume those are zero rain days 2 rain = wthr4["Rain (mm)"] ----> 3 rain[rain == None ] = 0 /Library/Python/2.7/site-packages/h2o/frame.pyc in __eq__(self, i) 891 def __div__(self, i): return self._simple_vec_bin_op(i,"/" ) 892 def __mul__(self, i): return self._simple_vec_bin_op(i,"*" ) --> 893 def __eq__ (self, i): return self._simple_vec_bin_op(i,"n") 894 def __ne__ (self, i): return self._simple_vec_bin_op(i,"N") 895 def __pow__(self, i): return self._simple_vec_bin_op(i,"^" ) /Library/Python/2.7/site-packages/h2o/frame.pyc in _simple_vec_bin_op(self, i, op) 878 if isinstance(i, str) : return H2OVec(self._name, Expr(op, self, Expr(None,i))) 879 if op == "==" and i is None : return H2OVec(self._name, Expr("is.na", self._expr, None)) --> 880 raise NotImplementedError 881 882 def _simple_vec_bin_rop(self, i, op): NotImplementedError:
exalate-issue-sync[bot] commented 1 year ago

Cliff Click commented: over to Eric who's been hacking the python wrapper layer and changed this. Also, need to get the CityBike demo into gradle to catch future breakage Cliff

exalate-issue-sync[bot] commented 1 year ago

Eric Eckstrand commented: The python interface now supports "rain[rain == None ] = 0" functionality and the citibike demo gets past this point. However, the demo fails on:

bpd_with_weather = bpd.merge(wthr4,allLeft=True,allRite=False) bpd_with_weather.describe() bpd_with_weather.show()

with: {ast=(, (= !py1c809b1c-7b72-4654-b482-411aed059f00 (merge %pycd962e15-6911-433a-814b-d35d2c1d ae22 %py39263531-cd66-4f6a-8c38-c6f09abcdd53 %TRUE %FALSE)) (del %pycd962e15-6911-433a-814b-d35d2c1dae22 #0) (del %py39263531-cd66-4f6a-8c38-c6f09abcdd53 #0) )} java.lang.IllegalArgumentException: Note that only a single statement can be processed at a time. Junk at the end of the statement: (, (= !py1c809b1c-7b72-4654-b482-411aed059f00 (merge %pycd962e15-6911-433a-814b-d35d2c1dae22 %py39263531-cd66-4f6a-8c38-c6f09abcdd53 %TRUE %FALSE)) (del %pycd962e15-6911-433a-814b-d35d2c1dae22 #0) (del %py39263531- cd66-4f6a-8c38-c6f09abcdd53 #0) ) ^----------------------------------------------------------------- --------------------------------^

    at water.rapids.Exec.throwErr(Exec.java:208)
    at water.rapids.Exec.exec(Exec.java:65)
    at water.api.RapidsHandler.exec(RapidsHandler.java:34)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at water.api.Handler.handle(Handler.java:57)
    at water.api.RequestServer.handle(RequestServer.java:662)
    at water.api.RequestServer.serve(RequestServer.java:598)
    at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:433)
    at java.lang.Thread.run(Thread.java:745)

Tracked under PUBDEV-834

exalate-issue-sync[bot] commented 1 year ago

Cliff Click commented: Break it down, it's lisp-y (, // series of statements in a row, value returned is the last one (= !py1c809b1c-7b72-4654-b482-411aed059f00 // assign to this temp, the following value (merge %pycd962e15-6911-433a-814b-d35d2c1dae22 %py39263531-cd66-4f6a-8c38-c6f09abcdd53 %TRUE %FALSE) // merge bpd and wthr4, left & right booleans past ) (del %pycd962e15-6911-433a-814b-d35d2c1dae22 #0) // del bpd now, last use (del %py39263531-cd66-4f6a-8c38-c6f09abcdd53 #0) // del wthr4 now, last use ) // end of series

exalate-issue-sync[bot] commented 1 year ago

Cliff Click commented: Please fix whole demo; work w/Spencer as needed

DinukaH2O commented 1 year ago

JIRA Issue Migration Info

Jira Issue: PUBDEV-829 Assignee: Eric Eckstrand Reporter: Tom Kraljevic State: Resolved Fix Version: N/A Attachments: N/A Development PRs: N/A