diff --git a/keras/import/customer_messages.csv b/keras/import/customer_messages.csv
new file mode 100644
index 0000000..c7e6182
--- /dev/null
+++ b/keras/import/customer_messages.csv
@@ -0,0 +1,100 @@
+excuse me,hi
+Good evening,hi
+Good morning,hi
+good morning,hi
+Good morning can you help me upload a shapefile?,question
+Good night where to place my file to import it into notebook?,question
+Greetings :),hi
+hai how can i do analyze with csv file is there any tutorial on it,question
+Having issues setup WML service,problem
+Hello,hi
+Hello,hi
+Hello,hi
+hello,hi
+hello - Im trying to edit a notebook and the circie just keeps spinning. any idea to get around this?,problem
+hello how can i download a csv file from my notebook?,question
+Hello How can I use deployed models built with R studio in WML?,question
+hello how to start creating R notebook?,question
+Hello I am having trouble logging in,problem
+Hello I can connect to clodant from pyspark,problem
+hello I cannot create a Notebook,problem
+Hello I keep getting error when trying to create account. Can you help me with that?,problem
+Hello I need help,hi
+Hello im doing this tutorial Predict the best drug for heart treatment with IBM Watson Machine Learning (SPSS) and Im having some trouble to reproduce the example,problem
+Hello Im trying to upload one 1.5GB tar.gz file and unzip to Object Storage. Could you tell me how to do it?,question
+hello message keeps coming which says my services have exceeded limit,problem
+hello testing,hi
+hello yes,hi
+Hello! please can you help,hi
+Hello... i created a Cloudent NoSQL DB and loaded csv in it now how to access the data,question
+Hey mate hope your well.,hi
+hey there,hi
+hi,hi
+hi,hi
+hi,hi
+hi,hi
+hi,hi
+hi,hi
+hi,hi
+Hi,hi
+Hi Anyone there?,hi
+Hi can you help,hi
+Hi can you helpme,hi
+Hi cant login today with this err The owners accout is not active. This might be caused by expired membership.,problem
+Hi fine I was having difficulty uploading data but its working now,problem
+Hi how can I import a flow from spss modeler in watson studio?,question
+Hi how do you add a folder of files to a project?,question
+Hi I am trying to Import Github Code To Create NoteBook via Github link but the file format is not accepting,problem
+Hi I am trying to request a new API token but I dont know what the ID should be for me,problem
+Hi I created a csv in my notebook but how do I download it to my laptop?,question
+Hi I got the message failed to prepare Object-Storage. Would you please give me a suggestion. Thank you.,problem
+Hi I have some problems initiate my notebook in my project,problem
+Hi I need help establishing connection with my cloudant account. I get an error saying Failed to find data source,problem
+hi i need help writing my dataframe to Db2,question
+Hi i need some help when model training they are giving me error on training,problem
+Hi I want to know hoe to use APIs,question
+Hi I want to know how to make connection to database,question
+Hi I wanted to know how to export data from python notebooks?,question
+Hi I was trying to deploy a model from a notebook. When I run this line it gave me an erro: Invalid token format. Could u help me? Thanks.,problem
+Hi I would like to signup for a trail but I am getting an error,problem
+Hi im having some troubles with a shiny app,problem
+Hi Im having trouble calling the endpoint of my deployed model,problem
+Hi Im testing watson studio,hi
+Hi is any way to download my files in data assets back to my loacal machine?,question
+hi is there link on how to deploy a data analytic model using node-red?,question
+Hi l couldnt able to create a new project,problem
+Hi My problem is an error when I want to create a new notebook,problem
+hi my trial has expired can you help?,problem
+Hi not able to signup,problem
+Hi team how can i import data into a project?,question
+Hi team How can you change the name of a Notebook?,question
+Hi there,hi
+Hi there can i recover a deleted notebook?,question
+Hi there how can I upload a series of .zip files then unzip them?,question
+Hi there Im having trouble using my CSV data for my machine learning model,problem
+Hi trying to create a note book it is giving error,problem
+Hi when I tried to create a project am getting below error can you pls guide here,problem
+how can i extend my trial period,question
+How do I add collaborators to my project please?,question
+how do i save my data as a csv file,question
+How do I start using Watson Machine Learning,question
+How to acess the data in jupyter notebook using pandas?,question
+how to export to csv in notebook?,question
+How to start creating R notebook?,question
+How to upload a dataset from local to RStudio,question
+I am not able to register my account need your help,problem
+i am Student can i have free access,question
+I cant see my spark instance when i go to create a new project,problem
+I deployed my WatsonML model and have a Scoring End Point that Id like to use from an external app. I keep getting Authentication Failed when I try to invoke it.,problem
+I get error like Exceeded Services Limit,problem
+I got errors from SPSS modelerabout connecting to the server how I can solve this issue,problem
+I keep getting a Failed creating account error,problem
+Im following the example it says that I can upload to spark but when I try it says unable to create a new link what am I doing wrong?,problem
+Im trying to create a python notebook and keep getting an error,problem
+Is It possible to insert an external source to create Notebook?,question
+Is there any free plan for students?,question
+jupyter notebook is unable to connect to kernel,problem
+Uploading data from object storage to rstudio returns an error,problem
+What library do I use to run Sparks Machine Learning library on R in?,question
+When I insert connection to a file in R I get errors trying to run it,problem
+When I try to add a model to any project I get an Unauthorized error.,problem
\ No newline at end of file
diff --git a/keras/import/keras-import-python.ipynb b/keras/import/keras-import-python.ipynb
index db0104c..bec8b8c 100644
--- a/keras/import/keras-import-python.ipynb
+++ b/keras/import/keras-import-python.ipynb
@@ -52,106 +52,31 @@
},
{
"cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Requirement already satisfied: wget in /Users/jinsalex/anaconda3/lib/python3.6/site-packages\n",
- "\u001b[33mYou are using pip version 9.0.1, however version 19.1.1 is available.\n",
- "You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"!pip install wget # Needed to download sample training data"
]
},
{
"cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "sample-customer-messages (2).csv\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Download sample training data to the notebook working directory\n",
"import wget\n",
- "training_data_url = 'https://dataplatform.cloud.ibm.com/data/exchange-api/v1/entries/015ddef6a868441188268a123404f744/data?accessKey=c8d0403d844a82df9ecd264df02f2b07'\n",
+ "training_data_url = 'https://raw.githubusercontent.com/pmservice/wml-sample-models/master/keras/import/customer_messages.csv'\n",
"filename = wget.download( training_data_url )\n",
"print( filename )"
]
},
{
"cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " message | \n",
- " class_name | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 6 | \n",
- " Greetings :) | \n",
- " hi | \n",
- "
\n",
- " \n",
- " | 7 | \n",
- " hai how can i do analyze with csv file is ther... | \n",
- " question | \n",
- "
\n",
- " \n",
- " | 8 | \n",
- " Having issues setup WML service | \n",
- " problem | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " message class_name\n",
- "6 Greetings :) hi\n",
- "7 hai how can i do analyze with csv file is ther... question\n",
- "8 Having issues setup WML service problem"
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Read sample data into Pandas DataFrame\n",
"import pandas as pd\n",
@@ -161,108 +86,9 @@
},
{
"cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " message | \n",
- " class_name | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 4 | \n",
- " Good morning can you help me upload a shapefile? | \n",
- " question | \n",
- "
\n",
- " \n",
- " | 73 | \n",
- " Hi there Im having trouble using my CSV data f... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 58 | \n",
- " Hi I would like to signup for a trail but I am... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 99 | \n",
- " When I try to add a model to any project I get... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 47 | \n",
- " Hi I am trying to request a new API token but ... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 87 | \n",
- " I deployed my WatsonML model and have a Scorin... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 6 | \n",
- " Greetings :) | \n",
- " hi | \n",
- "
\n",
- " \n",
- " | 39 | \n",
- " Hi Anyone there? | \n",
- " hi | \n",
- "
\n",
- " \n",
- " | 68 | \n",
- " Hi team how can i import data into a project? | \n",
- " question | \n",
- "
\n",
- " \n",
- " | 67 | \n",
- " Hi not able to signup | \n",
- " problem | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " message class_name\n",
- "4 Good morning can you help me upload a shapefile? question\n",
- "73 Hi there Im having trouble using my CSV data f... problem\n",
- "58 Hi I would like to signup for a trail but I am... problem\n",
- "99 When I try to add a model to any project I get... problem\n",
- "47 Hi I am trying to request a new API token but ... problem\n",
- "87 I deployed my WatsonML model and have a Scorin... problem\n",
- "6 Greetings :) hi\n",
- "39 Hi Anyone there? hi\n",
- "68 Hi team how can i import data into a project? question\n",
- "67 Hi not able to signup problem"
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Split the data into training and test sets\n",
"# https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html\n",
@@ -273,32 +99,9 @@
},
{
"cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/jinsalex/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n",
- " from ._conv import register_converters as _register_converters\n",
- "Using TensorFlow backend.\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "[[38, 77, 9, 11, 17, 27, 45, 4],\n",
- " [3, 24, 18, 31, 70, 58, 7, 32, 19, 103, 7, 43, 61, 42],\n",
- " [3, 2, 261, 164, 1, 103, 4, 47, 2, 33, 40, 29, 15],\n",
- " [21, 2, 230, 1, 76, 4, 42, 1, 48, 28, 2, 39, 29, 15]]"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Convert words to numbers\n",
"# https://keras.io/preprocessing/text/#tokenizer\n",
@@ -312,21 +115,9 @@
},
{
"cell_type": "code",
- "execution_count": 6,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "array([38, 77, 9, 11, 17, 27, 45, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
- " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32)"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Pad the shorter entries\n",
"# https://keras.io/preprocessing/sequence/#pad_sequences\n",
@@ -339,29 +130,9 @@
},
{
"cell_type": "code",
- "execution_count": 7,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "array([[0, 1],\n",
- " [0, 1],\n",
- " [0, 1],\n",
- " [0, 1],\n",
- " [0, 1],\n",
- " [0, 1],\n",
- " [1, 0],\n",
- " [1, 0],\n",
- " [0, 1],\n",
- " [0, 1]])"
- ]
- },
- "execution_count": 7,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Convert the labels to binary labels\n",
"import scipy\n",
@@ -380,7 +151,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -417,7 +188,7 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -432,7 +203,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -450,125 +221,18 @@
},
{
"cell_type": "code",
- "execution_count": 11,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " message | \n",
- " class_name | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 4 | \n",
- " Good morning can you help me upload a shapefile? | \n",
- " question | \n",
- "
\n",
- " \n",
- " | 73 | \n",
- " Hi there Im having trouble using my CSV data f... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 58 | \n",
- " Hi I would like to signup for a trail but I am... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 99 | \n",
- " When I try to add a model to any project I get... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 47 | \n",
- " Hi I am trying to request a new API token but ... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 87 | \n",
- " I deployed my WatsonML model and have a Scorin... | \n",
- " problem | \n",
- "
\n",
- " \n",
- " | 6 | \n",
- " Greetings :) | \n",
- " hi | \n",
- "
\n",
- " \n",
- " | 39 | \n",
- " Hi Anyone there? | \n",
- " hi | \n",
- "
\n",
- " \n",
- " | 68 | \n",
- " Hi team how can i import data into a project? | \n",
- " question | \n",
- "
\n",
- " \n",
- " | 67 | \n",
- " Hi not able to signup | \n",
- " problem | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " message class_name\n",
- "4 Good morning can you help me upload a shapefile? question\n",
- "73 Hi there Im having trouble using my CSV data f... problem\n",
- "58 Hi I would like to signup for a trail but I am... problem\n",
- "99 When I try to add a model to any project I get... problem\n",
- "47 Hi I am trying to request a new API token but ... problem\n",
- "87 I deployed my WatsonML model and have a Scorin... problem\n",
- "6 Greetings :) hi\n",
- "39 Hi Anyone there? hi\n",
- "68 Hi team how can i import data into a project? question\n",
- "67 Hi not able to signup problem"
- ]
- },
- "execution_count": 11,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"test"
]
},
{
"cell_type": "code",
- "execution_count": 12,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[1 1 1 1 1 1 0 0 1 0]\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"test_results = model.predict_classes( X_test )\n",
"print( test_results )"
@@ -583,7 +247,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -593,40 +257,18 @@
},
{
"cell_type": "code",
- "execution_count": 14,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "a message-classification-model.h5\r\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"!tar -zcvf message-classification-model.tgz message-classification-model.h5"
]
},
{
"cell_type": "code",
- "execution_count": 15,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "total 1072\r\n",
- "-rw-r--r-- 1 jinsalex staff 51758 Jun 11 15:59 keras-import-python.ipynb\r\n",
- "-rw-r--r-- 1 jinsalex staff 227928 Jun 11 16:00 message-classification-model.h5\r\n",
- "-rw-r--r-- 1 jinsalex staff 189256 Jun 11 16:00 message-classification-model.tgz\r\n",
- "-rw-r--r-- 1 jinsalex staff 5781 Jun 11 15:56 sample-customer-messages (1).csv\r\n",
- "-rw-r--r-- 1 jinsalex staff 5781 Jun 11 16:00 sample-customer-messages (2).csv\r\n",
- "-rw-r--r-- 1 jinsalex staff 5781 Jun 11 15:52 sample-customer-messages.csv\r\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"!ls -l"
]
@@ -651,18 +293,9 @@
},
{
"cell_type": "code",
- "execution_count": 16,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/jinsalex/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.\n",
- " warnings.warn(msg, category=DeprecationWarning)\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Create a Watson Machine Learning client instance\n",
"from watson_machine_learning_client import WatsonMachineLearningAPIClient\n",
@@ -674,25 +307,17 @@
"client = WatsonMachineLearningAPIClient( wml_credentials )"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "!pip show keras\n",
- "!pip install keras==2.1.3"
- ]
- },
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"metadata = {\n",
" client.repository.ModelMetaNames.NAME: \"keras model\",\n",
" client.repository.ModelMetaNames.FRAMEWORK_NAME: \"tensorflow\",\n",
- " client.repository.ModelMetaNames.FRAMEWORK_VERSION: \"1.5\",\n",
- " client.repository.ModelMetaNames.FRAMEWORK_LIBRARIES: [{'name':'keras', 'version': '2.1.3'}]}\n",
+ " client.repository.ModelMetaNames.FRAMEWORK_VERSION: \"1.14\",\n",
+ " client.repository.ModelMetaNames.FRAMEWORK_LIBRARIES: [{'name':'keras', 'version': '2.2.4'}]}\n",
"model_details = client.repository.store_model( model=\"message-classification-model.tgz\", meta_props=metadata )"
]
},
@@ -707,34 +332,9 @@
},
{
"cell_type": "code",
- "execution_count": 18,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- "\n",
- "#######################################################################################\n",
- "\n",
- "Synchronous deployment creation for uid: 'd55734d6-5945-451f-874c-3b91324233df' started\n",
- "\n",
- "#######################################################################################\n",
- "\n",
- "\n",
- "INITIALIZING\n",
- "DEPLOY_SUCCESS\n",
- "\n",
- "\n",
- "------------------------------------------------------------------------------------------------\n",
- "Successfully finished deployment creation, deployment_uid='ffb027ba-bb19-4842-a527-95f274fa97d0'\n",
- "------------------------------------------------------------------------------------------------\n",
- "\n",
- "\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Deploy the stored model as an online web service deployment\n",
"model_id = model_details[\"metadata\"][\"guid\"]\n",
@@ -743,50 +343,9 @@
},
{
"cell_type": "code",
- "execution_count": 19,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "{'fields': ['prediction', 'prediction_classes', 'probability'],\n",
- " 'values': [[[0.3985484540462494, 0.6014516353607178],\n",
- " 1,\n",
- " [0.3985484540462494, 0.6014516353607178]],\n",
- " [[0.27617669105529785, 0.7238233685493469],\n",
- " 1,\n",
- " [0.27617669105529785, 0.7238233685493469]],\n",
- " [[0.274316668510437, 0.7256833910942078],\n",
- " 1,\n",
- " [0.274316668510437, 0.7256833910942078]],\n",
- " [[0.27395668625831604, 0.7260433435440063],\n",
- " 1,\n",
- " [0.27395668625831604, 0.7260433435440063]],\n",
- " [[0.27482694387435913, 0.7251730561256409],\n",
- " 1,\n",
- " [0.27482694387435913, 0.7251730561256409]],\n",
- " [[0.29424726963043213, 0.7057527303695679],\n",
- " 1,\n",
- " [0.29424726963043213, 0.7057527303695679]],\n",
- " [[0.7057399153709412, 0.2942601144313812],\n",
- " 0,\n",
- " [0.7057399153709412, 0.2942601144313812]],\n",
- " [[0.6847215890884399, 0.3152783513069153],\n",
- " 0,\n",
- " [0.6847215890884399, 0.3152783513069153]],\n",
- " [[0.281570702791214, 0.7184292674064636],\n",
- " 1,\n",
- " [0.281570702791214, 0.7184292674064636]],\n",
- " [[0.5620117783546448, 0.43798819184303284],\n",
- " 0,\n",
- " [0.5620117783546448, 0.43798819184303284]]]}"
- ]
- },
- "execution_count": 19,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
"source": [
"# Test the deployment\n",
"model_endpoint_url = client.deployments.get_scoring_url( deployment_details )\n",
@@ -842,7 +401,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3.6",
"language": "python",
"name": "python3"
},
@@ -856,7 +415,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.4"
+ "version": "3.6.8"
}
},
"nbformat": 4,