Python中的多个非线性回归

问题描述 投票:0回答:1

我正在寻找可以帮助我找到回归方程的任何库或方法。等式采用以下格式:

Y = a1 * x ^ a + a2 * y ^ b + a3 * z ^ c + D;其中Y是因变量,x,y,z是自变量,D是常数。 a1,a2,a3是系数,a,b,c分别是自变量的指数。

我将Y和x,y,z的值存储在数据帧中。

python pandas statistics regression non-linear-regression
1个回答
0
投票

您可以使用scikit学习中的Random Forest Regressor实现。它非常易于使用,您只需执行以下操作:

Random Forest Regressor

确保训练数据和测试数据具有相同数量的自变量。

关于更多非线性回归,请检查:from sklearn.ensemble import RandomForestRegressor clf = RandomForestRegressor() # train the model clf.fit(df[['x','y','z']], df['Y']) # predict on test data predict = clf.predict(test_data[['x','y','z']])

© www.soinside.com 2019 - 2024. All rights reserved.