Orange Forum • View topic - correlation coefficient

correlation coefficient

A place to ask questions about methods in Orange and how they are used and other general support.

correlation coefficient

Postby marko1234 » Tue Nov 17, 2009 15:57

I have made regression tree and regression tree graph. How can I see correlation coeff. for that model? How can I export calculated values in excel or txt?
Thanks.

Postby bgbg » Sun Nov 29, 2009 13:53

Try this:

Code: Select all

    import orngTree
    import orngStat, orngTest
   
    dataTraining = getTrainingData()
    dataValidation = getValidationData()
   
   
    tree1 = orngTree.TreeLearner(mForPruning = 2, measure = 'gini')
   
    results = orngTest.learnAndTestOnTestData([tree1], dataValidation)
    classifier = tree1(dataValidation)
    r2 = orngStat.R2(results)
    print r2
    #more examples: http://www.ailab.si/orange/doc/ofb/c_performance.htm
   
    ## export the predicted values to a csv file:
    for (i, e) in enumerate(dataValidation):
        observed = e.getclass().value
        predicted = classifier[e].value
        print '%d,%s,%s'%(i, str(observed), str(predicted)
       
       
       


Return to Questions & Support



cron