Я пытаюсь построить график с помощью ggplot и не понимаю, почему получаю эту ошибку. Вот код:
from ggplot import *
ggplot(counts, aes(x='pred_prob',y='true_prob',size='count')) + \
geom_point(color='blue') + \
stat_function(fun=lambda x: x, color='red') + \
xlim(-0.05, 1.05) + ylim(-0.05,1.05)
Вот ошибка, которую я получаю:
NameError Traceback (most recent call last)
<ipython-input-71-fdefd49237a1> in <module>()
2
3 baseline = np.mean(is_churn)
----> 4 ggplot(counts, aes(x='pred_prob',y='true_prob',size='count')) + geom_point(color='blue') + stat_function(fun=lambda x: x, color='red') + xlim(-0.05, 1.05) + ylim(-0.05,1.05)
NameError: name 'stat_function' is not defined
Я не уверен, почему у меня возникает эта ошибка. Любые идеи? Я использую python 3.5.2 и ggplot версии 0.11.5