I compiled and used with no problem the code from the Smile tutorial in the wiki. However, when doing this for the first Smilearn tutorial i get the following from make:
g++ -O3 -DNDEBUG -ffast-math -c smile.C -I../include_gcc_411
smile.C: In function ‘void PrintDataset(const DSL_dataset&)’:
smile.C:41: error: ‘const class DSL_dataset’ has no member named ‘NumVariables’
smile.C:42: error: ‘const class DSL_dataset’ has no member named ‘NumVariables’
smile.C:44: error: ‘DSL_variableInfo’ was not declared in this scope
smile.C:44: error: expected `;' before ‘vi’
smile.C:45: error: ‘vi’ was not declared in this scope
smile.C:68: error: ‘const class DSL_dataset’ has no member named ‘NumRecords’
smile.C:69: error: ‘const class DSL_dataset’ has no member named ‘NumRecords’
smile.C:71: error: ‘const class DSL_dataset’ has no member named ‘NumVariables’
smile.C:78: error: ‘const class DSL_dataset’ has no member named ‘At’
smile.C:80: error: ‘const class DSL_dataset’ has no member named ‘At’
smile.C: In function ‘void CreateDataset()’:
smile.C:111: error: invalid conversion from ‘std::vector<int, std::allocator<int> >*’ to ‘int’
smile.C:111: error: initialising argument 2 of ‘int DSL_dataset::AddIntVar(std::string, int)’
smile.C:112: error: no matching function for call to ‘DSL_dataset::AddFloatVar(const char [7], std::vector<float, std::allocator<float> >*)’
../include_gcc_411/dataset.h:65: note: candidates are: int DSL_dataset::AddFloatVar(std::string, float)
smile.C:120: error: ‘DSL_dataElement’ was not declared in this scope
smile.C:120: error: template argument 1 is invalid
smile.C:120: error: template argument 2 is invalid
smile.C:120: error: invalid type in declaration before ‘(’ token
smile.C:120: error: ‘class DSL_dataset’ has no member named ‘NumVariables’
smile.C:121: error: invalid types ‘int[int]’ for array subscript
smile.C:122: error: invalid types ‘int[int]’ for array subscript
smile.C:123: error: ‘class DSL_dataset’ has no member named ‘AddRecord’
make: *** [smile.o] Error 1
Searching with grep, for example, for NumVariables in the header files i actually didn't find it, but the similar GetNumberOfVariables(). This replacement actually spared me the errors for Numvariables, but the replacemente for the other errors dont appear to be so obvious.I'm thinking maybe there's been changes in the code that haven't been updated in the tutorial??
Thanks in advance for any help, and as this is my first post, i also would like to thank everyone behind Genie/Smile for providing the community with such an awesome tool!
ps: My Makefile:
CFLAGS = -O3 -DNDEBUG -ffast-math
CC = g++
SMILE = ../include_gcc_411
LFLAGS = -L$(SMILE) -lsmile -lsmilearn
default: smile
smile: smile.o
$(CC) $(CFLAGS) smile.o -o smile $(LFLAGS)
smile.o: smile.C
$(CC) $(CFLAGS) -c smile.C -I$(SMILE)
clean:
rm -rf *.o smile
Problem compiling code from Smilearn tutorial
There have been some changes in the public API of SMILE, but the tutorials have not been updated yet. NumVariables has been replaced with GetNumberOfVariables, NumRecords has been replaced with GetNumberOfRecords, and At has been replaced with GetInt/GetFloat. Please see dataset.h for more information.
Problems compiling Smilearn tutorial
Hi,
I'm having the same problems Mauro had.
It would be great if you could update the wiki and the tutorials.
In the meantime... how can I fix ‘struct DSL_datasetVarInfo’ has no member named ‘missingValue’?
Thanks for providing such a great tool!
Regards,
ermutarra
I'm having the same problems Mauro had.
It would be great if you could update the wiki and the tutorials.
In the meantime... how can I fix ‘struct DSL_datasetVarInfo’ has no member named ‘missingValue’?
Thanks for providing such a great tool!
Regards,
ermutarra
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Problems compiling Smilearn tutorial
DSL_datasetVarInfo::missingValue was replaced by missingInt and missingFloat.ermutarra wrote:In the meantime... how can I fix ‘struct DSL_datasetVarInfo’ has no member named ‘missingValue’?
-
- Posts: 1
- Joined: Thu Mar 25, 2010 7:53 pm
AddIntVar and AddFloatVar
Hi,
Could you also help out with the methods for adding a vector to a dataset.
AddIntVar and AddFloatVar don't seem to accept vectors anymore.
Thanks.
Could you also help out with the methods for adding a vector to a dataset.
AddIntVar and AddFloatVar don't seem to accept vectors anymore.
Thanks.
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: AddIntVar and AddFloatVar
You need to iterate over the vector and call SetInt/SetFloat with appropriate parameters. If the dataset row count is different from vector's size, use AddEmptyRecord or RemoveRecord.snhemanthm wrote:AddIntVar and AddFloatVar don't seem to accept vectors anymore.