GithubHelp home page GithubHelp logo

ibm / icp4d-customer-churn-classifier Goto Github PK

View Code? Open in Web Editor NEW
17.0 18.0 22.0 28.74 MB

Infuse AI into your application. Create and deploy a customer churn prediction model with IBM Cloud Private for Data, Db2 Warehouse, Spark MLlib, and Jupyter notebooks.

Home Page: https://developer.ibm.com/patterns/infuse-ai-into-your-application/

License: Apache License 2.0

Jupyter Notebook 60.22% Python 10.03% JavaScript 7.50% CSS 4.56% HTML 17.68%
ibm-cloud-private db2-warehouse jupyter-notebook spark-mllib brunel data-science watson-machine-learning machine-learning python

icp4d-customer-churn-classifier's Issues

Cannot visualize the customer demographics and trading activity data with Db2 datasource

#############

Db2 Connection and Dataset data_df_1 then df_churn_pd = data_df_1

##############

use "Insert to code" and "pandas DataFrame"

to import the input data into the notebook.

Add asset from file system# @hidden_cell

from project_lib import Project
project = Project.access()

Db2Wh_5nodes_metadata = project.get_connection(name="Db2Wh-5nodes")

import os, jaydebeapi, pandas as pd

Db2Wh_5nodes_url = 'jdbc:db2://{}:{}/{}'.format(
Db2Wh_5nodes_metadata['host'],
Db2Wh_5nodes_metadata.get('port', 50000),
Db2Wh_5nodes_metadata['database']
)

Db2Wh_5nodes_connection = jaydebeapi.connect(
'com.ibm.db2.jcc.DB2Driver',
Db2Wh_5nodes_url,
[Db2Wh_5nodes_metadata['xxxxx'],Db2Wh_5nodes_metadata['yyyyy']]
)

query = 'SELECT * FROM "CHURN"."MERGED_CUSTOMERS"'
data_df_1 = pd.read_sql_query(query, con=Db2Wh_5nodes_connection)
data_df_1.head()

##########################
Error Step 3


TypeError Traceback (most recent call last)
in
----> 1 get_ipython().run_line_magic('brunel', "data('df_churn_pd') stack polar bar x(CHURNRISK) y(#count) color(CHURNRISK) bar tooltip(#all) :: width=300, height=300")

/opt/conda/envs/Python-3.7-main/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2315 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2316 with self.builtin_trap:
-> 2317 result = fn(*args, **kwargs)
2318 return result
2319

in brunel(self, line, cell)

/opt/conda/envs/Python-3.7-main/lib/python3.7/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

~/.local/lib/python3.7/site-packages/brunel/magics.py in brunel(self, line, cell)
43 parts = line.split('::')
44 action = parts[0].strip()
---> 45 datasets_in_brunel = brunel.get_dataset_names(action)
46 self.cache_data(datasets_in_brunel,datas)
47 if len(parts) > 2:

~/.local/lib/python3.7/site-packages/brunel/brunel.py in get_dataset_names(brunel_src)
92
93 def get_dataset_names(brunel_src):
---> 94 return brunel_util_java.D3Integration.getDatasetNames(brunel_src)
95
96 def cacheData(data_key, data):

~/.local/lib/python3.7/site-packages/jpype/_jpackage.py in call(self, *arg, **kwarg)
54
55 def call(self, *arg, **kwarg):
---> 56 raise TypeError("Package {0} is not Callable".format(self.__name))

TypeError: Package org.brunel.util.D3Integration.getDatasetNames is not Callable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.