Bigml and R

107 views
Skip to first unread message

Narbeh Yousefian

unread,
Aug 10, 2013, 12:22:58 AM8/10/13
to bi...@googlegroups.com
Hi there, 

Just started using Bigml and discovered the R package. 
While I am familiar with R, connecting to Bigml using curl seems to be a stumbling block.

I get the following bad request, wondering where I am failing. My setCredentials("username", "api_key") is working fine.
and I used the following to get set up with curl.

# set the curl options
curl <- getCurlHandle()
options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem",
package = "RCurl"),
ssl.verifypeer = FALSE))
curlSetOpt(.opts = list(proxy = 'proxyserver:port'), curl = curl)


Source creation in progress...
Error in .check_for_code(result) : 
  Error: BigML returned code HTTP_BAD_REQUEST {
 "code":    400,
"status": {
 "code":  -1204,
"extra": {
 "dataset": {
 "fields": "The key of the objects in this field must be any of ['description', 'name', 'preferred', 'label']" 
},
"message": "Bad request" 
}

Francisco J Martin | BigML

unread,
Aug 10, 2013, 12:31:09 AM8/10/13
to Narbeh Yousefian, bi...@googlegroups.com
Narbeh,

Will you please send us the exact request the exact HTTP request that curl is sending?

It looks like you are trying to create a dataset but the request is not being sent in the appropriate format.

Best, francisco

--
You received this message because you are subscribed to the Google Groups "BigML" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigml+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Narbeh Yousefian

unread,
Aug 10, 2013, 12:42:04 AM8/10/13
to bi...@googlegroups.com, Narbeh Yousefian
Hi Francisco, thanks for the quick reply!!


I am using RStudio. I have copied out the entire command so let me know if this is over kill :) 
(the start of each line is a + or > which is from R, not the actual request I set)

> curl <- getCurlHandle()
> options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem",
+                                                  package = "RCurl"),
+                             ssl.verifypeer = FALSE))
> curlSetOpt(.opts = list(proxy = "proxyserver:port"), curl = curl)
An object of class "CURLHandle"
Slot "ref":
<pointer: 0x7fa5f74c1200>

> iris.model = quickModel(iris, objective_field = "Species")

Francisco J Martin | BigML

unread,
Aug 10, 2013, 12:50:22 AM8/10/13
to Narbeh Yousefian, bi...@googlegroups.com, sup...@bigml.com
Narbeh,

Yeah! I could reproduce it. The quickModel isn't working properly.  We'll have a look at it.
I tried the "manual" steps and they seem to work fine. 

write.csv(iris, "~/iris.csv", row.names=F)
iris.source = createSource("~/iris.csv", 'iris')
iris.dataset = createDataset(iris.source$resource)
iris.model = createModel(iris.dataset$resource)

Please give them a try and let me know if they work for you. We'll try to fix the quickModel asap. 

Best, francisco

Narbeh Yousefian

unread,
Aug 10, 2013, 4:32:37 AM8/10/13
to bi...@googlegroups.com, Narbeh Yousefian, sup...@bigml.com
Awesome thanks!

The manual steps also worked fine for me too. Thanks! now to use some real data ;)

Also, appreciate you getting back to me so quick Francisco, you help has made me want to use your product even more.

cheers, 
Narbeh Yousefian

Enric Garcia Torrents

unread,
Apr 25, 2015, 10:44:09 AM4/25/15
to bi...@googlegroups.com, narbeh.y...@winning.com.au
I have encountered the same issue when following the tutorial on the R API. Unlike Narbeh, though, the "manual" steps don't seem to sort out the issue for me. I am using R 3.2 in Debian, and R 3.1.2 in Windows 8; I get the same error with both. Any ideas on why this may be happening, and how to solve it?


> write.csv(iris, "~/iris.csv", row.names=F)
> iris.source = createSource("~/iris.csv", 'iris')
Source creation in progress...
> 
> iris.dataset = createDataset(iris.source$resource)
Dataset creation in progress...
> 
> iris.model = createModel(iris.dataset$resource)
Error in .check_for_code(result) : 
  Error: BigML returned code HTTP_BAD_REQUEST {
 "code":    400,
"status": {
 "code":  -1204,
"extra": {
 "model": {
 "holdout": "This field is not postable" 
} 
},
"message": "Bad request" 
} 
}


Many thanks for your support!
Reply all
Reply to author
Forward
0 new messages