Hi,
I am using rpy2
here is my code for running a LM
model = "kw ~ S1+S2+S3+S4+S5+S6+DR+RH+FH+d6h9q45"
robjects.globalenv['d6h9q45'] = robjects.FloatVector(df['d6h9q45'])
#d6h9q45
robjects.globalenv['kw'] = robjects.FloatVector(df['KW'])
robjects.globalenv['S1'] = robjects.FloatVector(df['S1'])
robjects.globalenv['S2'] = robjects.FloatVector(df['S2'])
robjects.globalenv['S3'] = robjects.FloatVector(df['S3'])
robjects.globalenv['S4'] = robjects.FloatVector(df['S4'])
robjects.globalenv['S5'] = robjects.FloatVector(df['S5'])
robjects.globalenv['S6'] = robjects.FloatVector(df['S6'])
robjects.globalenv['DR'] = robjects.FloatVector(df['DR'])
robjects.globalenv['RH'] = robjects.FloatVector(df['RH'])
robjects.globalenv['FH'] = robjects.FloatVector(df['FH'])
for i in ind_map.keys():
robjects.globalenv[i] = robjects.FloatVector(df[i])
print 'Running OLS....'
eos = robjects.r.lm(model)
print robjects.r.summary(eos) # show results
print eos.names
How do I use predict with a dataframe of X values to predict Y. WHat
is the python code?
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list