h2oai / wave-apps Goto Github PK
View Code? Open in Web Editor NEWSample AI Apps built with H2O Wave.
License: MIT License
Sample AI Apps built with H2O Wave.
License: MIT License
Native plotting api is faster, looks more professional, and supports themes.
The docker command specified in https://github.com/h2oai/wave-apps/blob/main/guess-the-number/dev_authentication_setup.md#1-run-keycloak-container not working in Mac M1
wave-apps/credit-risk/app.toml
Line 12 in cc76275
Check all app.toml for Memory Allocation in the HAHC which is not needed for these apps but rather was copy-pasted from elsewhere
Description:
At the moment all the apps use a bit of an old version of wave SDK. However, it would be good to update it to 1.0.2
Actual behavior
Instance logs attached, error during pip install trying to build wheel for numpy
41319fdb-8436-47e4-802a-aa8c9cf93404.txt
Steps to reproduce:
Import bundle and start new instance
Affected Versions:
Telco Churn Risk 1.1.0
OS, browser, other environment details and versions:
Tested on MC-24.02.1 https://7342184.dedicated.h2o.ai/apps/996a3028-49ef-4a9e-bc35-3ebd86a896c6
Current setup instructions require make
to be installed. However, this can be a showstopper for windows users which lacks make
installation by default.
We could either:
make
.cc @mtanco @geomodular for discussion
Some of the Makefiles
are dated and include items from when Wave
was Q
. It's worth cleaning them up so that they only have commands that are helpful and usable today to improve the developer experience.
Update the Windows install instructions in https://github.com/h2oai/wave-apps/tree/main/docker-development, based on the UNIX ones.
I used log4j detecor to check the vulnerable apps in my system and found out that wave-apps is using old version of log4j which is vulnerable.
Output- wave-apps/churn-risk/venv/lib/python3.7/site-packages/h2o/backend/bin/h2o.jar contains Log4J-1.x <= 1.2.17 _OLD_
Have an idea for a cool small Wave app? Do not hesitate to open a PR. Note that the app should be of a reasonable complexity (beyond hello world) or showing an interesting use case.
With the release verification Let's update all the applications to support the Path-based routing reported in this issue.
churn_predictor
class to be dataset agnostic. It should take any required, data-specific features as parameters so that it is easy for end users to use the class for their own datasets.Audio recording app
Graphql and httpx app
VSCode app
In case of any questions, feel free to comment on this issue.
While working on the managed cloud we noticed this warning while uploading the OSS Apps
11:37AM WRN Category field in bundle configuration has been deprecated and will be removed in future releases
11:37AM WRN Keywords field in bundle configuration has been deprecated and will be removed in future releases
Some Hybrid cloud customers will choose to only install apps which use path-based routing (for security and cost-savings reasons) - this feature will be availabe in App Store 0.14.0 and HAIC 22.01.3. To prepare, we recommend updating your app so that it can be used at these customer accounts.
Requirements:
app.toml
[Runtime]
section: RoutingMode = "BASE_URL"
Hello!
Thanks for you work, H2O Wave is really good.
I have this code for testing
from h2o_wave import main, app, data, Q, ui
import time
from random import randrange
values_1 = []
values_2 = []
# make some data
for i in range(0,25):
values_1.append(("CH1", i, randrange(100)))
values_2.append(("CH2", i, randrange(100)))
@app('/demo')
async def serve(q: Q):
q.page['meta'] = ui.meta_card(box='', layouts=[
ui.layout(
breakpoint='xl',
width='1200px',
zones=[
ui.zone('header'),
ui.zone('control'),
ui.zone('top', direction=ui.ZoneDirection.ROW, size='385px', zones=[
ui.zone('top_left', direction=ui.ZoneDirection.ROW, size='66%'),
ui.zone('top_right'),
]),
ui.zone('middle', direction=ui.ZoneDirection.ROW, size='400px'),
ui.zone('bottom', direction=ui.ZoneDirection.ROW, size='200px'),
ui.zone('footer'),
]
)
])
q.page['stats'] = ui.form_card(
box='middle',
title="Channel Power",
items=[
ui.stats(items=[
ui.stat(label=("Man"), value=("Manuel")),
ui.stat(label=("1234"), value=("1234")),
], justify=ui.StatsJustify.BETWEEN, inset=True),
ui.visualization(
plot=ui.plot([
ui.mark(type='line', x_scale='linear', x='=date', y='=visitors', color='=site',
color_range='$orange $amber', curve=ui.MarkCurve.SMOOTH),
ui.mark(type='line', x_scale='linear', x='=date', y='=visitors', color='=site',
color_range='$orange $amber', curve=ui.MarkCurve.SMOOTH),
]),
data=data(
fields=['site', 'date', 'visitors'],
rows= values_1+ values_2,
pack=True
),
height='240px',
)
],
)
await q.page.save()
Now, i would update the stats.data, but it doesnt work and i cant find an example.
from h2o_wave import site, data
import time
from random import randrange
page = site['/demo']
quote = page['stats']
values_1 = []
values_2 = []
i = 0
while True:
if len(values_1) == 26:
values_1.pop(0)
values_2.pop(0)
values_1.append(("CH1", i, randrange(100)))
values_2.append(("CH2", i, randrange(100)))
time.sleep(0.25)
quote.data = values_1 + values_2
page.save()
i = i + 1
Thanks for your help.
#38 updates to 0.11, let's update to 0.12.1
The Twitter Sentiment app works - you search for a key word and very quickly it returns recent tweets and sentiment, this is the full functionality we need for this app. It could use some front and backend polishing:
wave run src.app
was how you ran this (and all) appsTrump
to AI or H2O or something like thatCurrently the twitter credentials are hardcoded for us for testing. Let's add a form element that asks for the user's Twitter API Key, too. The tool tip for this can link to https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens
Audio recording app is currently pretty barebone - just a single button.
It could use some UI love:
Other ideas for improvement are welcome as well.
I get the following warnings in the console when running the Churn application - it would be good to do a code check with these in mind and see if anything needs to be changed.
./src/plots.py:43: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
./src/plots.py:43: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
./src/plots.py:43: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
./src/plots.py:43: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
./src/plots.py:26: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
/Users/mtanco/h2o_wave/wave-apps/churn-risk/venv/lib/python3.8/site-packages/h2o/explanation/_explain.py:975: RuntimeWarning:
More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
The sales-forecasting app is using datasets that are packaged along with the app. Instead, download the data from S3 when the app launches.
The Credit Usage Kaggle data uses encodings which can be hard to read, using the Kaggle summary lookup table we can update the data as follows:
# Original Dataset: https://www.kaggle.com/uciml/default-of-credit-card-clients-dataset
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', None)
df = pd.read_csv('CreditCard-train.csv')
# Gender (1=male, 2=female)
df['SEX'] = np.select([df['SEX'] == 1, df['SEX'] == 2, ~df['SEX'].isin([1, 2])],
['Male', 'Female', None])
# (1=graduate school, 2=university, 3=high school, 4=others, 5=unknown, 6=unknown)
df['EDUCATION'] = np.select([df['EDUCATION'] == 1, df['EDUCATION'] == 2, df['EDUCATION'] == 3, df['EDUCATION'] == 4,
~df['EDUCATION'].isin([1, 2, 3, 4])],
['Graduate School', 'University', 'High School', 'Other', None])
# MARRIAGE: Marital status (1=married, 2=single, 3=others)
df['MARRIAGE'] = np.select([df['MARRIAGE'] == 1, df['MARRIAGE'] == 2, df['MARRIAGE'] == 3,
~df['MARRIAGE'].isin([1, 2, 3])],
['Married', 'Single', 'Other', None])
# TODO: Rename for consistency
df = df.rename(columns={'PAY_0': 'PAY_1'})
# TODO: change PAY_X to categoricals
# TODO: change target column for consistency
df = df.rename(columns={'default.payment.next.month': 'DEFAULT_PAYMENT'})
# Change target column to boolean for h2o-3 data typing
df['DEFAULT_PAYMENT'] = np.where(df['DEFAULT_PAYMENT'] == 1, True, False)
print(df.head())
Following the read me, check that apps run on OS X, Windows, and Linux - make any setup change as needed and note what versions of these were tested
I followed the instructions but it is throwing an error:
httpcore.ConnectError: [Errno 111] Connect call failed ('127.0.0.1', 55555)
Examples like churn-risk and shopping-cart-recommendations worked fine.
I'm using a linux server.
Is there anything else to configure?
Application dependencies for sample apps are outdated, most of the applications fail when deploying on appstore runtime newer than python 3.8.
Here's the list of problematic dependencies (might have false positives, created with https://github.com/h2oai/h2o-ai-integration-testing/pull/463):
./graphql-httpx-script/requirements.txt
black==22.8.0 (✓ py3 any)
h2o-wave==0.23.1 (✓ py3 any)
./explaining-ratings/requirements.txt
pandas==1.1.0 (✓ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
h2o-wave<1.0 (✗ ambiguos package version)
matplotlib (✗ ambiguos package version)
wordcloud (✗ ambiguos package version)
./insurance-churn-risk/requirements.txt
pandas==1.1.0 (✓ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
pygments==2.7.1 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
h2o-wave<1.0 (✗ ambiguos package version)
h2o-wave-ml>=0.6.0 (✗ ambiguos package version)
https://h2o-release.s3.amazonaws.com/h2o/rel-zizler/7/Python/h2o-3.34.0.7-py2.py3-none-any.whl (✗ ambiguos package version)
black==20.8b1 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
flake8-black==0.2.1 (✓ py3 any)
flake8-import-order==0.18.1 (✓ py3 any)
flake8-quotes==3.2.0 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
flake8==3.8.4 (✓ py3 any)
./vscode-editor/requirements.txt
black==22.8.0 (✓ py3 any)
h2o-wave==0.23.1 (✓ py3 any)
./audio-recording/requirements.txt
black==22.8.0 (✓ py3 any)
h2o-wave==0.23.1 (✓ py3 any)
./music-and-mental-health/requirements.txt
h2o-wave==0.24.2 (✓ py3 any)
pandas==1.5.2 (✓ 3.8, ✓ 3.9, ✓ 3.10, ✗ 3.12)
plotly==5.11.0 (✓ py3 any)
siuba==0.4.2 (✓ py3 any)
./docker-development/requirements.txt
h2o-wave (✗ ambiguos package version)
./shopping-cart-recommendations/requirements.txt
h2o-wave<1.0 (✗ ambiguos package version)
pandas==1.1.4 (✓ 3.8, ✓ 3.9, ✗ 3.10, ✗ 3.12)
./sales-forecasting/requirements.txt
boto3==1.16.23 (✓ py3 any)
botocore==1.19.23 (✓ py3 any)
certifi==2020.11.8 (✓ py3 any)
click==7.1.2 (✓ py3 any)
h11==0.11.0 (✓ py3 any)
h2o-wave<1.0 (✗ ambiguos package version)
httpcore==0.12.2 (✓ py3 any)
httpx==0.16.1 (✓ py3 any)
idna==2.10 (✓ py3 any)
jmespath==0.10.0 (✓ py3 any)
numpy==1.19.4 (✓ 3.8, ✓ 3.9, ✗ 3.10, ✗ 3.12)
pandas==1.1.4 (✓ 3.8, ✓ 3.9, ✗ 3.10, ✗ 3.12)
python-dateutil==2.8.1 (✓ py3 any)
pytz==2020.4 (✓ py3 any)
rfc3986==1.4.0 (✓ py3 any)
s3transfer==0.3.3 (✓ py3 any)
six==1.15.0 (✓ py3 any)
sniffio==1.2.0 (✓ py3 any)
starlette==0.13.8 (✓ py3 any)
typing-extensions==3.7.4.3 (✓ py3 any)
urllib3==1.26.2 (✓ py3 any)
uvicorn==0.12.2 (✓ py3 any)
./template-mlops-single-prediction/requirements.txt
h2o_wave==0.20.0 (✓ py3 any)
toml==0.10.2 (✓ py3 any)
loguru==0.6.0 (✓ py3 any)
httpx==0.16.1 (✓ py3 any)
./credit-risk/requirements.txt
numpy==1.19.1 (✓ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
pandas==1.1.0 (✓ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
plotly==4.10.0 (✓ py3 any)
pygments==2.7.1 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
h2o-wave<1.0 (✗ ambiguos package version)
h2o-wave-ml>=0.7.0 (✗ ambiguos package version)
requests (✗ ambiguos package version)
tabulate (✗ ambiguos package version)
colorama>=0.3.8 (✗ ambiguos package version)
future (✗ ambiguos package version)
https://h2o-release.s3.amazonaws.com/h2o/rel-zizler/7/Python/h2o-3.34.0.7-py2.py3-none-any.whl (✗ ambiguos package version)
./twitter-sentiment/requirements.txt
./h2o_wave-nightly-py3-none-any.whl (✗ ambiguos package version)
tweepy==3.9.0 (✓ py3 any)
vaderSentiment (✗ ambiguos package version)
./template-explore-binary-classification/requirements.txt
h2o_wave==0.20.0 (✓ py3 any)
toml==0.10.2 (✓ py3 any)
loguru==0.6.0 (✓ py3 any)
pandas==1.4.1 (✓ 3.8, ✓ 3.9, ✓ 3.10, ✗ 3.12)
matplotlib==3.5.1 (✓ 3.8, ✓ 3.9, ✓ 3.10, ✗ 3.12)
./jwt-auth/requirements.txt
h2o-wave==0.25.2 (✓ py3 any)
mongoengine (✗ ambiguos package version)
python-jose[cryptography] (✗ ambiguos package version)
passlib[bcrypt] (✗ ambiguos package version)
./emp-churn-step-by-step/requirements.txt
h2o-wave==0.24.0 (✓ py3 any)
./guess-the-number/requirements.txt
certifi==2020.12.5 (✓ py3 any)
click==7.1.2 (✓ py3 any)
h11==0.11.0 (✓ py3 any)
h2o-wave<1.0 (✗ ambiguos package version)
httpcore==0.12.2 (✓ py3 any)
httpx==0.16.1 (✓ py3 any)
idna==2.10 (✓ py3 any)
rfc3986==1.4.0 (✓ py3 any)
sniffio==1.2.0 (✓ py3 any)
starlette==0.13.8 (✓ py3 any)
typing-extensions==3.7.4.3 (✓ py3 any)
uvicorn==0.12.2 (✓ py3 any)
./churn-risk/requirements.txt
pandas==1.1.0 (✓ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
pygments==2.7.1 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
h2o-wave<1.0 (✗ ambiguos package version)
h2o-wave-ml>=0.7.0 (✗ ambiguos package version)
https://h2o-release.s3.amazonaws.com/h2o/rel-zizler/7/Python/h2o-3.34.0.7-py2.py3-none-any.whl (✗ ambiguos package version)
black==20.8b1 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
flake8-black==0.2.1 (✓ py3 any)
flake8-import-order==0.18.1 (✓ py3 any)
flake8-quotes==3.2.0 (✗ 3.8, ✗ 3.9, ✗ 3.10, ✗ 3.12)
flake8==3.8.4 (✓ py3 any)
and screenshots as appropriate
I like the Credit Risk Read Me format, would be nice if they were all similar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.