Wednesday, June 3, 2020

Update On My Oracle Blogging Activity

If you were following me, you probably noticed I stopped active blogging related to Oracle tech. I moved to Medium platform and writing Machine Learning related articles at Towards Data Science. I'm doing this already since late 2018. So, I didn't stop blogging, just the subject is changed. If you are interested in Machine Learning, I will be happy if you follow me on Medium.

Why I stopped blogging about Oracle? There are several reasons:

1. We are building our own product Katana ML
2. Machine Learning is a complex topic and requires lots of focus
3. I decided to dedicate my time to Machine Learning and Open Source

We still keep working in Red Samurai with Oracle technology, but probably you would not see Oracle related articles from me anymore. But then who knows, never say never.

Monday, March 9, 2020

Building Dynamic UI Form with Oracle JET

Dynamic form is a common requirement when building more advanced UIs. With Oracle JET you have all the tools available to build dynamic form. One of the examples of dynamic form requirements - report parameter capture screens. Building fixed forms to capture parameters for each report would be an overkill. A smarter approach is to build one dynamic form, which would handle a set of different UI components and render based on metadata received from the service.

Dynamic form example:


When values are changed, we can capture all changes while submitting the form - value printed in the log:


In the heart of dynamic form logic, we are using JET bind for each tag, it renders form elements from metadata:


Each element is checked and based on the type - UI field is rendered through JET if tag. Input field properties are fetched from metadata.

Example of metadata structure - array. It is important to use Knockout observable for value property. This will allow capturing user input. When we submit the form, we can iterate through the array and read value property:


Sample code available on GitHub.

Thursday, February 20, 2020

Handy TensorFlow.js API for Client-Side ML Development

Let’s look into TensorFlow.js API for training data handling, training execution, and inference. TensorFlow.js is awesome because it brings Machine Learning into the hands of Web developers, this provides mutual benefit. Machine Learning field gets more developers and supporters, while Web development becomes more powerful with the support of Machine Learning.


Read more - Handy TensorFlow.js API for Client-Side ML Development.

Thursday, January 23, 2020

Time-Series Prediction Beyond Test Data

I was working on the assignment to build a large scale time-series prediction solution. I end up using a combination of approaches in the single solution — Prophet, ARIMA and LSTM Neural Network (running on top of Keras/TensorFlow). With Prophet (Serving Prophet Model with Flask — Predicting Future) and ARIMA it is straightforward to calculate a prediction for future dates, both provide a function to return prediction for a given future horizon. The same is not obvious with LSTM, if you are new — this will require a significant amount of time to research how to forecast true future dates (most of the examples are showing how to predict against test dataset only).

I found one good example though which I was following and it helped me to solve my task — A Quick Example of Time-Series Prediction Using Long Short-Term Memory (LSTM) Networks. In this post, I will show how to predict shampoo sales monthly data, mainly based on the code from the above example.

Read more - Time-Series Prediction Beyond Test Data.


Tuesday, December 24, 2019

Publishing Keras Model API with TensorFlow Serving

Building a ML model is a crucial task. Running ML model in production is not a less complex and important task. I had a post in the past about serving ML model through Flask REST API — Publishing Machine Learning API with Python Flask. While this approach works, it certainly lacks some important points:

  • Model versioning 
  • Request batching 
  • Multithreading 

TensorFlow comes with a set of tools to help you run ML model in production. One of these tools — TensorFlow Serving. There is an excellent tutorial that describes how to configure and run it — TensorFlow Serving with Docker. I will follow the same steps in my example.

Read more in my Towards Data Science post.

Thursday, November 28, 2019

Multiple Node.js Applications on Oracle Always Free Cloud

What if you want to host multiple Oracle JET applications? You can do it easily on Oracle Always Free Cloud. The solution is described in the below diagram:


You should wrap Oracle JET application into Node.js and deploy it to Oracle Compute Instance through Docker container. This is described in my previous post - Running Oracle JET in Oracle Cloud Free Tier.

Make sure to create Docker container with a port different than 80. To host multiple Oracle JET apps, you will need to create multiple containers, each assigned with a unique port. For example, I'm using port 5000:

docker run -p 5000:3000 -d --name appname dockeruser/dockerimage

This will map standard Node port 3000 to port 5000, accessible internally within Oracle Compute Instance. We can direct external traffic from port 80 to port 5000 (or any other port, mapped with Docker container) through Nginx.

Install Nginx:

yum install nginx

Go to Nginx folder:

cd etc/nginx

Edit configuration file:

nano nginx.conf

Add context root configuration for Oracle JET application, to be directed to local port 5000:

location /invoicingdemoui/ {
     proxy_pass http://127.0.0.1:5000/;
}

To allow HTTP call from Nginx to port 5000 (or other port), run this command (more about it on Stackoverflow):

setsebool -P httpd_can_network_connect 1

Reload Nginx:

systemctl reload nginx

Check Nginx status:

systemctl status nginx

That's all. Your Oracle JET app (demo URL) now accessible from the outside:

Thursday, October 31, 2019

Getting Your Hands Dirty with TensorFlow 2.0 and Keras API

Diving into technical details of the regression model creation with TensorFlow 2.0 and Keras API. In TensorFlow 2.0, Keras comes out of the box with TensorFlow library. API is simplified and more convenient to use.


Read the complete article here.