Python Forum
Find factor to match test curve to golden curve - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Find factor to match test curve to golden curve (/thread-33996.html)



Find factor to match test curve to golden curve - SriRajesh - Jun-17-2021

Hi,
I have a golden curve and test curve, I want to find a factor to multiply each value in test data such as to match (close to) golden curve slope & golden curve values. Actually golden curve values are much lower than golden values.

the time series data is as below:

Time	Golden	Test
90	2.2	1.4
100	1.77	1.2
102	1.9	1
105	1.6	0.7
107	1.39	0.4
111	1.45	0.1
119	1.4	0.2
120	1.2	0.05
121	1.1	0.02
I use linear regression, but the values are not close to golden.


data = pd.read_csv(r"D:\Pythoncodes\test.csv")



import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score

# Load the diabetes dataset
X_train = data['Time']
y_train = data['Golden']

X_test = data['Time']
y_test = data['Test']

regr = linear_model.LinearRegression()

regr.fit(X_train, y_train)

y_pred = regr.predict(X_test)
But the prediction is higher than expected.