Asymptotic regression in Python

0 votes

I have this portion of a data-set, where the y values eventually must reach an asymptotic limit. Here is a plot of the first 300 entries:

Asymptotic tendency of data-set

I have seen asymptotic regression (of the form y = b0 + b1*(1-exp(-exp(lrc) * x)) and I think it would be the best model to fit this data. R seemingly already has the function in its libraries, but I cannot find one in Python.

(1) Is there any library function for asymptotic regression or relevant saturation dynamics models as answered by Cleb below? If not, how to model it using scipy.optimize.curve_fit?

(2) Also how to predict the maximum integer value of the curve? Example, If y=2454.1234 is the value at X=10**20 and y=2545.5678 at X=10**50, for a certain model, I want to obtain 2454. Is there any one-shot way, other than linear search?

Mar 14 in Machine Learning by Nandini
• 5,480 points

1 answer to this question.

0 votes

If the problem persists, try using a checkpoints file that has been updated with the newest code.

The output will be like this:

enter image description here

The Code is given below:

import numpy as np
Import pandas as pd
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt 

def fun(x, a, b, n):    
   return a * x ** n / (x ** n + b) 
df = pd.read_csv('data.txt.txt', sep='\t') 
y = df['y'].astype(float) 
x = df['X'].astype(float) 
popt, pcov = curve_fit(f, x, y, p0=[1800., 20., 1.]) 
plt.scatter(x, y) 
plt.plot(x, f(x, *popt), 'r-')

answered Mar 15 by Dev
• 6,000 points

Related Questions In Machine Learning

0 votes
1 answer

Difference between classification and regression score in Python scikit learn

Classification Score is used for discrete values ...READ MORE

answered Feb 24 in Machine Learning by Nandini
• 5,480 points
0 votes
1 answer
0 votes
0 answers

Controlled Variables in Logistic Regression in Python

I just learned what controlled variables mean ...READ MORE

Apr 11 in Machine Learning by Dev
• 6,000 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,762 views
0 votes
1 answer
0 votes
1 answer

different results for Random Forest Regression in R and Python

Random Forests, as others have mentioned, have ...READ MORE

answered Apr 12 in Machine Learning by Dev
• 6,000 points
Send OTP
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP