Regression: How can I approximate a multi-dimensional function?
I want to approximate a sinc function using neural networks. This is my code:
import tensorflow as tf
from keras.layers import Dense
from keras.models import Sequential
N = 10000
x1 = numpy.empty((N,))
x2 = numpy.empty((N,))
x3 = numpy.empty((N,))
z1 = numpy.empty((N,))
z2 = numpy.empty((N,))
y = numpy.empty((N,))
for i in range(N):
x1[i] = random.uniform(-10, 10)
x2[i] = random.uniform(-10, 10)
x3[i] = random.uniform(-10, 10)
z1 = x1 + x2 - x3
z2 = -x1 + x2 + x3
for i in range(N):
y[i] = (numpy.sin(z1[i])/z1[i])*(numpy.sin(z2[i])/z2[i])
y = y.reshape(-1, 1)
scaler = MinMaxScaler()
x1 = scalar.fit_transform(x1)
x2 = scalar.fit_transform(x2)
x3 = scalar.fit_transform(x3)
y = scalar.fit_transform(y)
model = Sequential()
model.add(Dense(50, activation='relu', input_shape=(3,)))
model.add(Dense(1, activation='relu'))
model.fit(X, y, epochs=50, verbose=1, batch_size=2)
I have seen similar codes where X and Y are two one-dimensional matrixes, but in my case, I should calculate y using three input values. What is X in the code above for my case? In other words, how should I create X using x1, x2 and x3?
python neural-network regression
add a comment |
I want to approximate a sinc function using neural networks. This is my code:
import tensorflow as tf
from keras.layers import Dense
from keras.models import Sequential
N = 10000
x1 = numpy.empty((N,))
x2 = numpy.empty((N,))
x3 = numpy.empty((N,))
z1 = numpy.empty((N,))
z2 = numpy.empty((N,))
y = numpy.empty((N,))
for i in range(N):
x1[i] = random.uniform(-10, 10)
x2[i] = random.uniform(-10, 10)
x3[i] = random.uniform(-10, 10)
z1 = x1 + x2 - x3
z2 = -x1 + x2 + x3
for i in range(N):
y[i] = (numpy.sin(z1[i])/z1[i])*(numpy.sin(z2[i])/z2[i])
y = y.reshape(-1, 1)
scaler = MinMaxScaler()
x1 = scalar.fit_transform(x1)
x2 = scalar.fit_transform(x2)
x3 = scalar.fit_transform(x3)
y = scalar.fit_transform(y)
model = Sequential()
model.add(Dense(50, activation='relu', input_shape=(3,)))
model.add(Dense(1, activation='relu'))
model.fit(X, y, epochs=50, verbose=1, batch_size=2)
I have seen similar codes where X and Y are two one-dimensional matrixes, but in my case, I should calculate y using three input values. What is X in the code above for my case? In other words, how should I create X using x1, x2 and x3?
python neural-network regression
1
normallyXwill be a Nx3 matrix, but it depends on howfit()works. What iscreate_modelin your case? Something from a package?
– Simon
Nov 23 '18 at 23:52
@Simon I added the model in my code
– Ahmad
Nov 24 '18 at 3:04
add a comment |
I want to approximate a sinc function using neural networks. This is my code:
import tensorflow as tf
from keras.layers import Dense
from keras.models import Sequential
N = 10000
x1 = numpy.empty((N,))
x2 = numpy.empty((N,))
x3 = numpy.empty((N,))
z1 = numpy.empty((N,))
z2 = numpy.empty((N,))
y = numpy.empty((N,))
for i in range(N):
x1[i] = random.uniform(-10, 10)
x2[i] = random.uniform(-10, 10)
x3[i] = random.uniform(-10, 10)
z1 = x1 + x2 - x3
z2 = -x1 + x2 + x3
for i in range(N):
y[i] = (numpy.sin(z1[i])/z1[i])*(numpy.sin(z2[i])/z2[i])
y = y.reshape(-1, 1)
scaler = MinMaxScaler()
x1 = scalar.fit_transform(x1)
x2 = scalar.fit_transform(x2)
x3 = scalar.fit_transform(x3)
y = scalar.fit_transform(y)
model = Sequential()
model.add(Dense(50, activation='relu', input_shape=(3,)))
model.add(Dense(1, activation='relu'))
model.fit(X, y, epochs=50, verbose=1, batch_size=2)
I have seen similar codes where X and Y are two one-dimensional matrixes, but in my case, I should calculate y using three input values. What is X in the code above for my case? In other words, how should I create X using x1, x2 and x3?
python neural-network regression
I want to approximate a sinc function using neural networks. This is my code:
import tensorflow as tf
from keras.layers import Dense
from keras.models import Sequential
N = 10000
x1 = numpy.empty((N,))
x2 = numpy.empty((N,))
x3 = numpy.empty((N,))
z1 = numpy.empty((N,))
z2 = numpy.empty((N,))
y = numpy.empty((N,))
for i in range(N):
x1[i] = random.uniform(-10, 10)
x2[i] = random.uniform(-10, 10)
x3[i] = random.uniform(-10, 10)
z1 = x1 + x2 - x3
z2 = -x1 + x2 + x3
for i in range(N):
y[i] = (numpy.sin(z1[i])/z1[i])*(numpy.sin(z2[i])/z2[i])
y = y.reshape(-1, 1)
scaler = MinMaxScaler()
x1 = scalar.fit_transform(x1)
x2 = scalar.fit_transform(x2)
x3 = scalar.fit_transform(x3)
y = scalar.fit_transform(y)
model = Sequential()
model.add(Dense(50, activation='relu', input_shape=(3,)))
model.add(Dense(1, activation='relu'))
model.fit(X, y, epochs=50, verbose=1, batch_size=2)
I have seen similar codes where X and Y are two one-dimensional matrixes, but in my case, I should calculate y using three input values. What is X in the code above for my case? In other words, how should I create X using x1, x2 and x3?
python neural-network regression
python neural-network regression
edited Nov 24 '18 at 3:03
Ahmad
asked Nov 23 '18 at 20:43
AhmadAhmad
2,76833058
2,76833058
1
normallyXwill be a Nx3 matrix, but it depends on howfit()works. What iscreate_modelin your case? Something from a package?
– Simon
Nov 23 '18 at 23:52
@Simon I added the model in my code
– Ahmad
Nov 24 '18 at 3:04
add a comment |
1
normallyXwill be a Nx3 matrix, but it depends on howfit()works. What iscreate_modelin your case? Something from a package?
– Simon
Nov 23 '18 at 23:52
@Simon I added the model in my code
– Ahmad
Nov 24 '18 at 3:04
1
1
normally
X will be a Nx3 matrix, but it depends on how fit() works. What is create_model in your case? Something from a package?– Simon
Nov 23 '18 at 23:52
normally
X will be a Nx3 matrix, but it depends on how fit() works. What is create_model in your case? Something from a package?– Simon
Nov 23 '18 at 23:52
@Simon I added the model in my code
– Ahmad
Nov 24 '18 at 3:04
@Simon I added the model in my code
– Ahmad
Nov 24 '18 at 3:04
add a comment |
1 Answer
1
active
oldest
votes
Here is a little solution with tensorflow:
#-*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt
batch_size = 16
def generate_input(N=10000):
x = rd.uniform(low=-10, high=10, size=(3, N))
z1 = x[0] + x[1] - x[2]
z2 = -x[0] + x[1] + x[2]
return [np.expand_dims(np.stack((z1, z2), axis=0), axis=2) for _ in range(batch_size)]
def target_func(data):
return [(np.sin(x[0, :]) / x[0, :]) * (np.sin(x[1, :]) / x[1, :]) for x in data]
def main():
x = tf.placeholder(tf.float32, shape=(batch_size, 2, None, 1), name='inputs')
y = tf.placeholder(tf.float32, shape=(batch_size, None, 1), name='target')
x_sum = tf.reduce_sum(x, axis=1)
fc1 = tf.layers.dense(inputs=x_sum, units=32, activation=tf.nn.relu, name="fc1")
fc2 = tf.layers.dense(inputs=fc1, units=16, activation=tf.nn.relu, name="fc2")
output = tf.layers.dense(inputs=fc2, units=1, activation=None, name="output")
predict = output
losses = tf.reduce_sum(tf.square(y - predict, name="loss"))
train_step = tf.train.AdamOptimizer().minimize(losses)
saver = tf.train.Saver()
max_train_iter = 500
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(max_train_iter):
inp = generate_input()
target = target_func(inp)
sess.run(train_step, feed_dict={x: inp, y: target})
if i % (max_train_iter // 10) == 0:
val_inp = generate_input()
loss_val = sess.run(losses, feed_dict={x: val_inp, y: target_func(val_inp)})
print ('Step:%d, Loss:%f' % (i, loss_val))
saver.save(sess, 'sin/model', global_step=i)
test_inp = generate_input(50)
truth = target_func(test_inp)
pred = sess.run(predict, feed_dict={x: test_inp})
plt.figure()
rang = np.linspace(-10, 10, num=50)
plt.plot(rang, truth[0], label='target')
plt.plot(rang, pred[0], label='prediction')
plt.legend()
plt.savefig('sin/'+'graph_'+str(i)+'.png')
if __name__ == '__main__':
main()
It doesn't produce a great prediction. You would have to play with architecture and parameters to improve on that. But it works. The test example after training is shown below.

Thank you, couldn't you write the program usingkeras.layersand scaling data, the way I write in my origina l code?
– Ahmad
Nov 24 '18 at 7:04
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452745%2fregression-how-can-i-approximate-a-multi-dimensional-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is a little solution with tensorflow:
#-*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt
batch_size = 16
def generate_input(N=10000):
x = rd.uniform(low=-10, high=10, size=(3, N))
z1 = x[0] + x[1] - x[2]
z2 = -x[0] + x[1] + x[2]
return [np.expand_dims(np.stack((z1, z2), axis=0), axis=2) for _ in range(batch_size)]
def target_func(data):
return [(np.sin(x[0, :]) / x[0, :]) * (np.sin(x[1, :]) / x[1, :]) for x in data]
def main():
x = tf.placeholder(tf.float32, shape=(batch_size, 2, None, 1), name='inputs')
y = tf.placeholder(tf.float32, shape=(batch_size, None, 1), name='target')
x_sum = tf.reduce_sum(x, axis=1)
fc1 = tf.layers.dense(inputs=x_sum, units=32, activation=tf.nn.relu, name="fc1")
fc2 = tf.layers.dense(inputs=fc1, units=16, activation=tf.nn.relu, name="fc2")
output = tf.layers.dense(inputs=fc2, units=1, activation=None, name="output")
predict = output
losses = tf.reduce_sum(tf.square(y - predict, name="loss"))
train_step = tf.train.AdamOptimizer().minimize(losses)
saver = tf.train.Saver()
max_train_iter = 500
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(max_train_iter):
inp = generate_input()
target = target_func(inp)
sess.run(train_step, feed_dict={x: inp, y: target})
if i % (max_train_iter // 10) == 0:
val_inp = generate_input()
loss_val = sess.run(losses, feed_dict={x: val_inp, y: target_func(val_inp)})
print ('Step:%d, Loss:%f' % (i, loss_val))
saver.save(sess, 'sin/model', global_step=i)
test_inp = generate_input(50)
truth = target_func(test_inp)
pred = sess.run(predict, feed_dict={x: test_inp})
plt.figure()
rang = np.linspace(-10, 10, num=50)
plt.plot(rang, truth[0], label='target')
plt.plot(rang, pred[0], label='prediction')
plt.legend()
plt.savefig('sin/'+'graph_'+str(i)+'.png')
if __name__ == '__main__':
main()
It doesn't produce a great prediction. You would have to play with architecture and parameters to improve on that. But it works. The test example after training is shown below.

Thank you, couldn't you write the program usingkeras.layersand scaling data, the way I write in my origina l code?
– Ahmad
Nov 24 '18 at 7:04
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
add a comment |
Here is a little solution with tensorflow:
#-*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt
batch_size = 16
def generate_input(N=10000):
x = rd.uniform(low=-10, high=10, size=(3, N))
z1 = x[0] + x[1] - x[2]
z2 = -x[0] + x[1] + x[2]
return [np.expand_dims(np.stack((z1, z2), axis=0), axis=2) for _ in range(batch_size)]
def target_func(data):
return [(np.sin(x[0, :]) / x[0, :]) * (np.sin(x[1, :]) / x[1, :]) for x in data]
def main():
x = tf.placeholder(tf.float32, shape=(batch_size, 2, None, 1), name='inputs')
y = tf.placeholder(tf.float32, shape=(batch_size, None, 1), name='target')
x_sum = tf.reduce_sum(x, axis=1)
fc1 = tf.layers.dense(inputs=x_sum, units=32, activation=tf.nn.relu, name="fc1")
fc2 = tf.layers.dense(inputs=fc1, units=16, activation=tf.nn.relu, name="fc2")
output = tf.layers.dense(inputs=fc2, units=1, activation=None, name="output")
predict = output
losses = tf.reduce_sum(tf.square(y - predict, name="loss"))
train_step = tf.train.AdamOptimizer().minimize(losses)
saver = tf.train.Saver()
max_train_iter = 500
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(max_train_iter):
inp = generate_input()
target = target_func(inp)
sess.run(train_step, feed_dict={x: inp, y: target})
if i % (max_train_iter // 10) == 0:
val_inp = generate_input()
loss_val = sess.run(losses, feed_dict={x: val_inp, y: target_func(val_inp)})
print ('Step:%d, Loss:%f' % (i, loss_val))
saver.save(sess, 'sin/model', global_step=i)
test_inp = generate_input(50)
truth = target_func(test_inp)
pred = sess.run(predict, feed_dict={x: test_inp})
plt.figure()
rang = np.linspace(-10, 10, num=50)
plt.plot(rang, truth[0], label='target')
plt.plot(rang, pred[0], label='prediction')
plt.legend()
plt.savefig('sin/'+'graph_'+str(i)+'.png')
if __name__ == '__main__':
main()
It doesn't produce a great prediction. You would have to play with architecture and parameters to improve on that. But it works. The test example after training is shown below.

Thank you, couldn't you write the program usingkeras.layersand scaling data, the way I write in my origina l code?
– Ahmad
Nov 24 '18 at 7:04
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
add a comment |
Here is a little solution with tensorflow:
#-*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt
batch_size = 16
def generate_input(N=10000):
x = rd.uniform(low=-10, high=10, size=(3, N))
z1 = x[0] + x[1] - x[2]
z2 = -x[0] + x[1] + x[2]
return [np.expand_dims(np.stack((z1, z2), axis=0), axis=2) for _ in range(batch_size)]
def target_func(data):
return [(np.sin(x[0, :]) / x[0, :]) * (np.sin(x[1, :]) / x[1, :]) for x in data]
def main():
x = tf.placeholder(tf.float32, shape=(batch_size, 2, None, 1), name='inputs')
y = tf.placeholder(tf.float32, shape=(batch_size, None, 1), name='target')
x_sum = tf.reduce_sum(x, axis=1)
fc1 = tf.layers.dense(inputs=x_sum, units=32, activation=tf.nn.relu, name="fc1")
fc2 = tf.layers.dense(inputs=fc1, units=16, activation=tf.nn.relu, name="fc2")
output = tf.layers.dense(inputs=fc2, units=1, activation=None, name="output")
predict = output
losses = tf.reduce_sum(tf.square(y - predict, name="loss"))
train_step = tf.train.AdamOptimizer().minimize(losses)
saver = tf.train.Saver()
max_train_iter = 500
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(max_train_iter):
inp = generate_input()
target = target_func(inp)
sess.run(train_step, feed_dict={x: inp, y: target})
if i % (max_train_iter // 10) == 0:
val_inp = generate_input()
loss_val = sess.run(losses, feed_dict={x: val_inp, y: target_func(val_inp)})
print ('Step:%d, Loss:%f' % (i, loss_val))
saver.save(sess, 'sin/model', global_step=i)
test_inp = generate_input(50)
truth = target_func(test_inp)
pred = sess.run(predict, feed_dict={x: test_inp})
plt.figure()
rang = np.linspace(-10, 10, num=50)
plt.plot(rang, truth[0], label='target')
plt.plot(rang, pred[0], label='prediction')
plt.legend()
plt.savefig('sin/'+'graph_'+str(i)+'.png')
if __name__ == '__main__':
main()
It doesn't produce a great prediction. You would have to play with architecture and parameters to improve on that. But it works. The test example after training is shown below.

Here is a little solution with tensorflow:
#-*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt
batch_size = 16
def generate_input(N=10000):
x = rd.uniform(low=-10, high=10, size=(3, N))
z1 = x[0] + x[1] - x[2]
z2 = -x[0] + x[1] + x[2]
return [np.expand_dims(np.stack((z1, z2), axis=0), axis=2) for _ in range(batch_size)]
def target_func(data):
return [(np.sin(x[0, :]) / x[0, :]) * (np.sin(x[1, :]) / x[1, :]) for x in data]
def main():
x = tf.placeholder(tf.float32, shape=(batch_size, 2, None, 1), name='inputs')
y = tf.placeholder(tf.float32, shape=(batch_size, None, 1), name='target')
x_sum = tf.reduce_sum(x, axis=1)
fc1 = tf.layers.dense(inputs=x_sum, units=32, activation=tf.nn.relu, name="fc1")
fc2 = tf.layers.dense(inputs=fc1, units=16, activation=tf.nn.relu, name="fc2")
output = tf.layers.dense(inputs=fc2, units=1, activation=None, name="output")
predict = output
losses = tf.reduce_sum(tf.square(y - predict, name="loss"))
train_step = tf.train.AdamOptimizer().minimize(losses)
saver = tf.train.Saver()
max_train_iter = 500
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(max_train_iter):
inp = generate_input()
target = target_func(inp)
sess.run(train_step, feed_dict={x: inp, y: target})
if i % (max_train_iter // 10) == 0:
val_inp = generate_input()
loss_val = sess.run(losses, feed_dict={x: val_inp, y: target_func(val_inp)})
print ('Step:%d, Loss:%f' % (i, loss_val))
saver.save(sess, 'sin/model', global_step=i)
test_inp = generate_input(50)
truth = target_func(test_inp)
pred = sess.run(predict, feed_dict={x: test_inp})
plt.figure()
rang = np.linspace(-10, 10, num=50)
plt.plot(rang, truth[0], label='target')
plt.plot(rang, pred[0], label='prediction')
plt.legend()
plt.savefig('sin/'+'graph_'+str(i)+'.png')
if __name__ == '__main__':
main()
It doesn't produce a great prediction. You would have to play with architecture and parameters to improve on that. But it works. The test example after training is shown below.

answered Nov 23 '18 at 23:07
dsalajdsalaj
6441027
6441027
Thank you, couldn't you write the program usingkeras.layersand scaling data, the way I write in my origina l code?
– Ahmad
Nov 24 '18 at 7:04
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
add a comment |
Thank you, couldn't you write the program usingkeras.layersand scaling data, the way I write in my origina l code?
– Ahmad
Nov 24 '18 at 7:04
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
Thank you, couldn't you write the program using
keras.layers and scaling data, the way I write in my origina l code?– Ahmad
Nov 24 '18 at 7:04
Thank you, couldn't you write the program using
keras.layers and scaling data, the way I write in my origina l code?– Ahmad
Nov 24 '18 at 7:04
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
It seems it needs normalization! Moreover, it has three features, I wonder how did you plot it
– Ahmad
Nov 24 '18 at 10:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452745%2fregression-how-can-i-approximate-a-multi-dimensional-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
normally
Xwill be a Nx3 matrix, but it depends on howfit()works. What iscreate_modelin your case? Something from a package?– Simon
Nov 23 '18 at 23:52
@Simon I added the model in my code
– Ahmad
Nov 24 '18 at 3:04