I am trying to generate a dataset which involves 1 feature variable(X) and 1 target variable(y).

The feature variable represents values on the X-axis on the graph and target variable represents values on Y-axis.

Datatype of X: integer

Datatype of y: floating point

I have N such graphs for same values of X, but a slight variation in y values.

One of the graph is as follows:

enter image description here

I want to fit the data into a regression.

Now, my question is how to generate the dataset for this use case. Should I include values from all graphs into a single dataset? But, in this case, for every unique value of X, I will have N rows with same value of X and a different value of y?

I am doubtful about this approach.

Any help is greatly appreciated!


1 Answer 1


I'm not sure what's the context of your question but there's no problem with the approach you've outlined. Different values of y for the same unique value of x (over different rows, such that for example you have: x = {1, 1}, y = {1, 2}) are a natural result of the noise usually assumed in the model you fit (e.g. $y = x + \epsilon$).

Hope this helps.

  • $\begingroup$ Hi Iyar, added the context. Can u judge it now. As, a slight variation in y values for same value of X cannot be considered noise in this case $\endgroup$ Apr 11, 2020 at 12:35
  • $\begingroup$ @DeepakTatyajiAhire why a slight variation in y values for same value of X cannot be considered noise in this case? $\endgroup$
    – Iyar Lin
    Apr 12, 2020 at 14:02
  • $\begingroup$ Hi Iyar Lin! It can't be considered as noise as the multiple entries got generated due to different genuine graphs as described in the use case $\endgroup$ Apr 16, 2020 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.