コード例 #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
ファイル: LDA_all.py プロジェクト: takeru-nitta/auction
	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
ファイル: LDA_all.py プロジェクト: takeru-nitta/auction
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
ファイル: LDA_one.py プロジェクト: takeru-nitta/auction
    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