当前位置: 首页>>代码示例>>C++>>正文


C++ MatrixDouble::loadFromCSVFile方法代码示例

本文整理汇总了C++中MatrixDouble::loadFromCSVFile方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixDouble::loadFromCSVFile方法的具体用法?C++ MatrixDouble::loadFromCSVFile怎么用?C++ MatrixDouble::loadFromCSVFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MatrixDouble的用法示例。


在下文中一共展示了MatrixDouble::loadFromCSVFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main (int argc, const char * argv[])
{
    InfoLog log("ClusterTreeExample");
    
    //Load some training data to train the ClusterTree model
    MatrixDouble trainingData;
    if( !trainingData.loadFromCSVFile("ClusterTreeData.csv") ){
        log << "Failed to load training data!" << endl;
        return EXIT_FAILURE;
    }
    
    //Create a new ClusterTree instance
    ClusterTree ctree;
    
    //Set the number of steps that will be used to choose the best splitting values
    //More steps will give you a better model, but will take longer to train
    ctree.setNumSplittingSteps( 100 );
    
    //Set the maximum depth of the tree
    ctree.setMaxDepth( 10 );
    
    //Set the minimum number of samples allowed per node
    ctree.setMinNumSamplesPerNode( 10 );
    
    //Set the minimum RMS error allowed per node
    ctree.setMinRMSErrorPerNode( 0.1 );
	
    //Train a cluster tree model
    if( !ctree.train( trainingData ) ){
        log << "Failed to train model!" << endl;
        return EXIT_FAILURE;
    }
    
    if( !ctree.saveModelToFile("Model.grt") ){
        log << "Failed to train model!" << endl;
        return EXIT_FAILURE;
    }
	
    if( !ctree.loadModelFromFile("Model.grt") ){
        log << "Failed to train model!" << endl;
        return EXIT_FAILURE;
    }
    
    //Print the tree
    ctree.print();
	
    return EXIT_SUCCESS;
}
开发者ID:AdriannaGmz,项目名称:gesture-recognition-toolkit,代码行数:48,代码来源:ClusterTreeExample.cpp


注:本文中的MatrixDouble::loadFromCSVFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。