所以我有两个1D数组,我需要绘制它们的线性回归模型,以了解它们的趋势,所以我有以下代码:
from brian2 import *
%matplotlib inline
from sklearn.linear_model import LinearRegression
start_scope()
reg = LinearRegression()
reg.fit(rates, R)
reg.coef_
#rates and R were issued beforehand
figure(figsize=(36,12))
subplot(121)
plot(rates,R,'o','b',reg,'r' )
xlabel('Time (ms)')
ylabel('V (mV)')
title("M.I. - firing rate evolution")
ylim((0,35))
然后我得到一个错误:
^{pr2}$有人能帮我理解吗?在
如错误中所述,您可以使用
另外,我猜你只有一个特性可以作为回归模型的预测因子。
相关问题 更多 >
编程相关推荐