예제 #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