-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import csv for regression #257
Comments
The error means that the file can not be parsed using the options you supplied (e.g. you specify that entries are separate with space, not ','). Without seeing the actual file i have no way to tell you what is wrong.
…________________________________
From: axiqia [notifications@github.com]
Sent: Saturday, October 20, 2018 5:52 PM
To: Shark-ML/Shark
Cc: Subscribed
Subject: [Shark-ML/Shark] import csv for regression (#257)
I want to use Rand Forest algorithm to solve a regression problem, and there is only one classfication example tutorial<http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/algorithms/rf.html>. So I try the bellow code to test,
RegressionDataset data;
importCSV(data, "/data/C.csv", LAST_COLUMN, ' ');
and after I ran, I get some error
terminate called after throwing an instance of 'shark::Exception'
what(): [importCSVReaderSingleValues] problems parsing file (2)
[1] 19082 abort (core dumped) ./ExampleProject
I have read the other regression algorithm tutorial, and I fond that all of them use the bellow importCSV to load label and data ,respectively.
void importCSV(
Data<T>& data,
std::string fn,
char separator = ',',
char comment = '#',
std::size_t maximumBatchSize = Data<T>::DefaultBatchSize,
std::size_t titleLines = 0
)
How should I do to solve the problem? And is there someting I missed?
Shark version 3.1.0
Thank you.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#257>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AOWTBuuNVRT0UZ1ZLaJy_BrzsxT6XQrZks5um0awgaJpZM4Xx_i_>.
|
Thank you for your quick rely. And I am sorry for not giving the details. I read Sample data set C.csv for test. And bellow is the first few lines.
You see, the entries are separate with space, and my option param is |
Thank you for your hint. I found out where the mistake was. I step through each line of my code and step into the
I realizeed I had to specify the param |
Unified interface does not make sense. The first version does not have a label, so it is confusing to have to specify a label position. third version is for regression, there we can have vectorial labels. We are still working on making the tutorials better, I will try to include that in a future Data section |
Yeah, I have realized difference among the three version :). Maybe the comments should be as clear as you said.
really helpless for me. Is there a document for the user to look up possible reasons? |
Hi, there is no document, unfortunately. We base our parser on boost.spirit and it is a bit tough to get the exact reason out. We just check whether the parser could read everything (and that it succeeded with what it read). It is possible to add this, and we would be happy to take a pull request (based on the current 4.1 branch), but have no time to do it ourselves. |
I want to use Rand Forest algorithm to solve a regression problem, and there is only one classfication example tutorial. So I try the bellow code to test,
and after I ran, I get some error
I have read the other regression algorithm tutorial, and I fond that all of them use the bellow
importCSV
to load label and data ,respectively.How should I do to solve the problem? And is there someting I missed?
Shark version 3.1.0
Thank you.
The text was updated successfully, but these errors were encountered: