Python Forum
Find factor to match test curve to golden curve
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find factor to match test curve to golden curve
#1
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.

Attached Files

.csv   test.csv (Size: 137 bytes / Downloads: 63)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to test and import a model form computer to test accuracy using Sklearn library Anldra12 6 693 Jul-03-2021, 10:07 AM
Last Post: Anldra12
  Fitting Gaussian curve to data file Laplace12 0 503 Jun-09-2021, 10:45 AM
Last Post: Laplace12
  search of a curve fitting function bluffy5 2 995 Dec-13-2020, 09:53 AM
Last Post: ndc85430
  Smooth curve in matplotlib medatib531 0 768 Apr-02-2020, 08:07 PM
Last Post: medatib531
  How to write test cases for a init function by Unit test in python? binhduonggttn 2 1,465 Feb-24-2020, 12:06 PM
Last Post: Larz60+
  How to write test cases by Unit test for database configuration file? binhduonggttn 0 990 Feb-18-2020, 08:03 AM
Last Post: binhduonggttn
  Import Text, output curve geometry Alyner 0 828 Feb-03-2020, 03:05 AM
Last Post: Alyner
  How do I code this equation in python (factor ceiling(2^127-1)) Pleiades 5 2,281 Apr-23-2018, 03:01 AM
Last Post: Skaperen
  Finding values to draw a line on a curve kesenthilkumar 2 2,112 Sep-19-2017, 09:50 AM
Last Post: kesenthilkumar
  Trying to find an approximate match in a Column ankur2207 4 2,310 Sep-02-2017, 02:04 PM
Last Post: hbknjr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020