コード例 #1
0
def train(train_data_dir, labels, sample_num):
    f_index, y, X = FeatureFactor.getFeatureSpace(train_data_dir, labels,
                                                  sample_num)
    saveTheFSpace(f_index)
    model = Libsvm.train(y, X)
    Libsvm.saveModel(model)
コード例 #2
0
def train( train_data_dir, labels, sample_num ):
    f_index, y, X = FeatureFactor.getFeatureSpace( train_data_dir, labels, sample_num )
    saveTheFSpace( f_index )
    model = Libsvm.train( y, X )
    Libsvm.saveModel( model )
コード例 #3
0
def recommend(allWeibos):
    model = Libsvm.loadModel()
    f_index = loadTheFSpace()
    f_vector = FeatureFactor.getFeature(allWeibos, f_index)
    label = Libsvm.predict(f_vector, model)
    return label
コード例 #4
0
def recommend( allWeibos ):
    model = Libsvm.loadModel()
    f_index = loadTheFSpace()
    f_vector = FeatureFactor.getFeature( allWeibos, f_index )
    label = Libsvm.predict( f_vector, model )
    return label