# Turing.jl or SciML?: training and testing on different datasets

**URL:** <https://discourse.julialang.org/t/turing-jl-or-sciml-training-and-testing-on-different-datasets/68330>\
**Category:** Probabilistic Programming\
**Tags:** question\
**Created:** [September 17, 2021, 12:23pm UTC](https://discourse.julialang.org/t/turing-jl-or-sciml-training-and-testing-on-different-datasets/68330 "2021-09-17T12:23:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Gorman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/james_gorman/32/16590_2.png) [@James\_Gorman](https://discourse.julialang.org/u/James_Gorman)\
**Post date:** [September 17, 2021, 12:23pm UTC](https://discourse.julialang.org/t/turing-jl-or-sciml-training-and-testing-on-different-datasets/68330/1 "2021-09-17T12:23:04Z")

</div>

I am new to doing Bayesian inference, so I wanted to start off with doing a simple regression (here, assumed to be a linear regression). I decided to use Turing.jl, and through the tutorials and previous questions I was able to get the linear regression working.

Working with one dataset appeared to be fine (training and testing on the same dataset). However, I am actually interested in training and testing on different datasets: that is, training on data that is of the form y = a\*x + b, and then testing on data of the form y = c\*x + d. I assumed this is what could readily be done with a simple model (as done in the examples), but when I tried implementing this the final resulting coefficients were a mix of the two forms (y = a\*x + b and y = c\*x + d) instead of just the test data (y = c\*x + d).

Should this mixing of coefficients be happening, or am I implementing the training and testing incorrectly? Or, is Bayesian inference only able to perform analysis on a single dataset (although the set may be multi-dimensional), and the only way to train on one dataset and test on another is to use machine learning (e.g. perhaps a BNN implemented in Turing,jl)? Thank you for your help.

James
