예제 #1
0
class LDA_all(object):
    def __init__(self,
                 makers,
                 date="2014-6-04 23:59:59",
                 filters=True,
                 show=False,
                 no_below=5,
                 no_above=0.75,
                 num_topics=300):
        self.categoryID = categoryIDtoMaker()
        self.makers = makers
        data = get_all_data(makers)
        data = FilterDate(data, date)
        print "data read"
        self.Auction = Auction(data,
                               "all",
                               filters=filters,
                               show=show,
                               no_below=no_below,
                               no_above=no_above)
        print "model read"

    def predict(self, ID, threhold=0.0, rate=2):
        testee = fetch_item(ID)
        if self.categoryID[int(testee['category_id'])] not in self.makers:
            raise NameError('No category_id found')
        else:
            return self.Auction.predict(testee['title'],
                                        testee['description'],
                                        threhold=threhold,
                                        rate=rate)
예제 #2
0
	def __init__(self,makers,date="2014-6-7 23:59:59",filters = True,show=False,no_below=5, no_above=0.75,num_topics=300):
		self.categoryID = categoryIDtoMaker()
		self.makers = makers
		data = get_all_data(makers)
		data = FilterDate(data,date)
		print "data read"
		self.Auction = Auction(data,"all",filters = filters,show=show,no_below=no_below, no_above=no_above)
		print "model read"
예제 #3
0
 def __init__(self,
              makers,
              date="2014-6-04 23:59:59",
              filters=True,
              show=False,
              no_below=5,
              no_above=0.75,
              num_topics=300):
     self.categoryID = categoryIDtoMaker()
     self.makers = makers
     data = get_all_data(makers)
     data = FilterDate(data, date)
     print "data read"
     self.Auction = Auction(data,
                            "all",
                            filters=filters,
                            show=show,
                            no_below=no_below,
                            no_above=no_above)
     print "model read"
예제 #4
0
class LDA_all(object):
	def __init__(self,makers,date="2014-6-7 23:59:59",filters = True,show=False,no_below=5, no_above=0.75,num_topics=300):
		self.categoryID = categoryIDtoMaker()
		self.makers = makers
		data = get_all_data(makers)
		data = FilterDate(data,date)
		print "data read"
		self.Auction = Auction(data,"all",filters = filters,show=show,no_below=no_below, no_above=no_above)
		print "model read"

	def predict(self,ID,threhold = 0.0,rate=2):
		testee = fetch_item(ID)
		if self.categoryID[int(testee['category_id'])] not in self.makers:
			raise NameError('No category_id found')
		else:
			return self.Auction.predict(testee['title'],testee['description'],threhold = threhold,rate=rate)
예제 #5
0
    def __init__(self,
                 makers,
                 date="2014-6-7 23:59:59",
                 filters=True,
                 show=False,
                 no_below=5,
                 no_above=0.75,
                 num_topics=150):
        self.categoryID = categoryIDtoMaker()
        self.Auction_model = {}

        for maker in makers:
            data = get_maker_data(maker)
            data = FilterDate(data, date)
            self.Auction_model[maker] = Auction(data,
                                                maker,
                                                filters=filters,
                                                show=show,
                                                no_below=no_below,
                                                no_above=no_above)
            print "load model of ", maker