def setUp(self, yelp_extractor=YelpExtractor()): # Usage: # Constructor for TestYelpExtractor. Used for setting the yelp extractor # Arguments: # yelp_extractor (object) : an object of our YelpExtractor class self.yelp_extractor = yelp_extractor
def setup_libraries(self): # Usage: # The request object is an HTTPResponse object in Django. It is able to be used # like an dictionary to get http parameters, such as ?num_samples=X&facebook_Group=Y. # We will try to get num_samples, facebook_group, and pusher_uuid. Otherwise # we will raise a SuspiciousOperation if it fails. Afterwards get data from the facebook # group, and then train our model, then use our model to determine sentiment of users. # Arguments: # yelp_extractor (YelpExtractor) : a yelp data extractor that can extract yelp data # facebook_extractor (FacebookExtractor) : a facebook extractor that can extract facebook data # logistic_classifier (LogisticRegression) : a logistic regression class that can compute sentiment of a user # Return: # None # Setup our Libraries self.yelp_extractor = YelpExtractor() self.facebook_extractor = FacebookExtractor() self.logistic_classifier = LogisticClassifier()