main.cpp of generate call undefined method loadCsv of GMatrix

Help
XiaoboGu
2014-06-14
2014-06-14
  • XiaoboGu
    XiaoboGu
    2014-06-14

    The work around is to ignorge "csv" and ".dat" data formats:

    GMatrix loadData(const char szFilename)
    {
    // Load the dataset by extension
    PathData pd;
    GFile::parsePath(szFilename, &pd);
    GMatrix* pData = new GMatrix();
    vector<size_t> ambiguousCols;
    if(_stricmp(szFilename + pd.extStart, ".arff") == 0)
    pData->loadArff(szFilename);
    // else if(_stricmp(szFilename + pd.extStart, ".csv") == 0)
    // pData->loadCsv(szFilename, ',', false, &ambiguousCols, false);
    //else if(_stricmp(szFilename + pd.extStart, ".dat") == 0)
    // pData->loadCsv(szFilename, '\0', false, &ambiguousCols, false);
    else
    throw Ex("Unsupported file format: ", szFilename + pd.extStart);
    if(ambiguousCols.size() > 0)
    {
    cerr << "WARNING: column";
    if(ambiguousCols.size() > 1)
    cerr << "s";
    cerr << " ";
    for(size_t i = 0; i < ambiguousCols.size(); i++)
    {
    if(i > 0)
    {
    cerr << ", ";
    if(i + 1 == ambiguousCols.size())
    cerr << "and ";
    }
    cerr << to_str(ambiguousCols);
    }
    cerr << " could reasonably be interpreted as either continuous or nominal. Assuming continuous was intended.\n";
    }
    return pData;
    }

     


Anonymous


Cancel   Add attachments