This is a traditional linear regression problem.
Your goal here is to find the hidden relationship between input (i1,2,3) and output (o).
For example o = i1 x a1 + i2 x a2 + i3 x a3 find out what a1,2,3 is?
Provide a POST endpoint /machine-learning/question-1 that given existing input, guess the expected output.
The HTTP POST request will come with a body of Content-Type: application/json containing:
{
"input": [
[i11, i12, i13],
[i21, i22, i23],
...
],
"output": [
o1,
o2,
...
],
"question": [q1, q2, q3]
}
Your endpoint should then return with body of Content-Type: application/json contains:
{
"answer": a
}
For example, in this case the a1 = 1, a2 = 1, a3 = 1:
Input:
{
"input": [
[1, 2, 3],
[2, 3, 4],
[2, 1, 4],
[5, 3, 2],
[2, 1, 2]
],
"output": [
6,
9,
7,
10,
5
],
"question": [3, 4, 5]
}
Output:
{
"answer": 12
}
Moving on, we goes into the area of a classic deep learning question.
Given 30 hand-written image (represented by pixel value), find what they represent.
The hand-written images will be send to you as JSON, each image is of dimension of 28 x 28. the payload will have the pixel value in gray scale (0 to 255), and flatten into array of size 784
Example (a hand-written 2): data (as png)
You can use whatever library or famework you can found online. Sample training data can be found from: http://yann.lecun.com/exdb/mnist
Provide a POST endpoint /machine-learning/question-2 that given a hand-written number image represented by pixel values, return the value of the number.
The HTTP POST request will come with a body of Content-Type: application/json containing:
{
"question": [
[p1, p2, p3, p4 ..., p784],
[q1, q2, q3, q4 ..., q784],
...
]
}
That contains 30 set of numeric representation of the image
Your endpoint should then return with body of Content-Type: application/json contains:
{
"answer": [
a1,
a2,
...
]
}
Input:
{
"question": [
[0, 0, 0 , 123, 34, 0 ... ,0],
[0, 0, 0 , 0, 134, 0 ... ,0],
...
]
}
Output:
{
"answer": [
2,
3,
...
]
}