All pastes #819675 Raw Edit

Miscellany

public python v1 · immutable
·published 2007-12-17 03:21 UTC
rendered paste body
from db_feature import FeatureDB# Put the names that you want each column in the feature table here , e.g.,features = ['age', 'length', 'templates', 'external', 'internal']# Get a list of all the features in the dbfeatures_in_db = dbConn.getFeatureNames()for feature in features:    if not feature in features_in_db:        print "Adding column", feature        dbConn.addFeature(feature, "double")# Get an iterator over all the rated pagespageList = dbConn.getRatedPages()# Here prafuls_feature_value is the svm feature valuefor page in pageList:        dbConn.updateFeature('age', page, prafuls_feature_value)