本文整理汇总了C++中DataBase::totalVotes方法的典型用法代码示例。如果您正苦于以下问题:C++ DataBase::totalVotes方法的具体用法?C++ DataBase::totalVotes怎么用?C++ DataBase::totalVotes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::totalVotes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dataBase
void Test::dataBase()
{
DataBase db;
QCOMPARE(db.rootPath(), QLatin1String("../"));
QCOMPARE(db.isLoaded(), false);
QVERIFY(db.totalVotes() == 0);
QCOMPARE(db.load(), true);
QCOMPARE(db.isLoaded(), true);
QVERIFY(db.totalMovies() > 0);
QVERIFY(db.totalVotes() > 0);
}
示例2: main
int main(int argc, char *argv[]){
script_timer("Total", false);
if(argv[1] && strstr(argv[1],"deb")!=NULL) debug = true; // Set debug to true if argv[1] contains "deb"
if(debug) fprintf(stderr, "Debug mode on.\n");
if(argv[1] && strstr(argv[1],"off")!=NULL) full_output = false; // Disable full RMSE output if argv[1] contains "off"
DataBase db;
db.load();
if(db.checkDB()) fprintf(stderr, "checkDB OK\n");
else fprintf(stderr, "DB Corrupt.\n");
db.setTitles();
Movie movies(&db);
User users(&db);
movies.setId(1);
users.setId(6);
fprintf(stderr, "db.totalUsers()=%d\n", db.totalUsers());
fprintf(stderr, "db.totalMovies()=%d\n", db.totalMovies());
fprintf(stderr, "db.totalVotes()=%d\n", db.totalVotes());
/*
db.loadPreProcessor("data/somemodel"); // Load a preprocessor built using Algorithm::buildPreProcessor("data/somemodel")
*/
Average avg(&db);
//avg.runProbe();
//avg.runQualifying("none", true);
avg.buildPreProcessor("data_average");
/*
Globals globals(&db);
globals.setAverages(10);
globals.setVariances();
globals.setThetas();
globals.runProbe();
//globals.runQualifying("none", true);
*/
#define TRAIN_SIMU true
Matrix_Factorization *mf = new Matrix_Factorization(&db);
mf->training();
// mf->cache("data_mf_simu");
//mf->runProbe();
//mf->runQualifying("none", true);
mf->buildPreProcessor("data_mf");
// User_KNN * uknn = new User_KNN(&db);
// uknn->setup();
// uknn->loadUserFeatures("data_mf_simu.users.cache");
//uknn->runProbe();
//uknn->runQualifying("none", true);
// uknn->buildPreProcessor("data_uknn");
Blend blend(&db);
// blend.setUp(3, "data_average", "data_mf_simu", "data_uknn");
blend.setUp(2, "data_average", "data_mf");
blend.runProbe();
//blend.runQualifying("none", true);
/*
Blend_Partial blendpartial(&db);
blendpartial.setUp(3, "data/average", "data/mf_simu", "data/uknn");
blendpartial.runProbe_partial();
blendpartial.runQualifying("none", true);
*/
/*
KNN knn(&db);
knn.setup();
knn.runProbe();
E
E
E
knn.runQualifying("none", true);
*/
script_timer("Total", true);
fprintf(stderr, "\n");
print_timer_summary_map();
}