Skip to content

Commit

Permalink
Adding Python UDF Demo Resources (IBM#28)
Browse files Browse the repository at this point in the history
* Update README with new demo content

* Added Python UDF Demo

* Fixes to typos

* Updates to README

* Updates to readme
  • Loading branch information
adrianmahjour authored Aug 25, 2020
1 parent c2cd4d5 commit 410dd49
Show file tree
Hide file tree
Showing 8 changed files with 74,647 additions and 10 deletions.
18 changes: 9 additions & 9 deletions In_Db2_Machine_Learning/Building ML Models with Db2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Download the file [Titanic.csv](Datasets/Titanic.csv) from the `Datasets` direct
To load the TITANIC dataset into your Db2 table:

```
db2 start
db2start
db2 connect to <database_name>
CREATE TABLE <table_schema>.<table_name> (
db2 "CREATE TABLE <table_schema>.<table_name> (
PASSENGERID INTEGER NOT NULL,
SURVIVED INTEGER,
PCLASS INTEGER,
Expand All @@ -57,10 +57,10 @@ FARE DECIMAL(30,5),
CABIN VARCHAR(255),
EMBARKED VARCHAR(3),
PRIMARY KEY (PASSENGERID))
ORGANIZE BY ROW;
ORGANIZE BY ROW;"
db2 IMPORT FROM "<full_path_to_csv>" OF DEL skipcount 1 INSERT INTO
<table_schema>.<table_name>(PASSENGERID, SURVIVED, PCLASS, NAME, SEX, AGE, SIBSP, PARCH, TICKET, FARE, CABIN, EMBARKED)
db2 "IMPORT FROM "<full_path_to_csv>" OF DEL skipcount 1 INSERT INTO
<table_schema>.<table_name>(PASSENGERID, SURVIVED, PCLASS, NAME, SEX, AGE, SIBSP, PARCH, TICKET, FARE, CABIN, EMBARKED)"
```

For loading the GO_SALES data you can take the following steps:
Expand All @@ -69,7 +69,7 @@ For loading the GO_SALES data you can take the following steps:
db2start
connect to <database_name>
CREATE TABLE <table_schema>.<table_name> (
db2 "CREATE TABLE <table_schema>.<table_name> (
ID INTEGER NOT NULL,
GENDER VARCHAR(3),
AGE INTEGER,
Expand All @@ -79,10 +79,10 @@ IS_TENT INTEGER,
PRODUCT_LINE VARCHAR(30),
PURCHASE_AMOUNT DECIMAL(30, 5),
PRIMARY KEY (ID))
ORGANIZE BY ROW;
ORGANIZE BY ROW;"
IMPORT FROM "<full_path_to_csv>" OF DEL skipcount 1 INSERT INTO
<table_schema>.<table_name>(ID, GENDER, AGE, MARITAL_STATUS, PROFESSION, IS_TENT, PRODUCT_LINE, PURCHASE_AMOUNT)
db2 "IMPORT FROM "<full_path_to_csv>" OF DEL skipcount 1 INSERT INTO
<table_schema>.<table_name>(ID, GENDER, AGE, MARITAL_STATUS, PROFESSION, IS_TENT, PRODUCT_LINE, PURCHASE_AMOUNT)"
```

## 4. Notebook-specific requirements <a name="Notebook-specific"></a>
Expand Down
Loading

0 comments on commit 410dd49

Please sign in to comment.