How to visualize US States
Hi,
I am using the churn use case/ project which has one column "state" with type string and meaning US State. Unfortunately, it is not possible to visualize the states in a map as Dataiku does not recognize them as a geo column.
Is there anything I could do to get them on a map?
Answers
-
Hi @lisa811
,You can use our Geocoder plugin for this purpose.
After installing it, simply create a Geocoder -> Forward geocoding recipe, select the input and output datasets.
In the address field of the recipe settings select a column containing the state code, for the geocoding provider you can use Arcgis. After running the recipe you'll have latitude + longitude columns. You may then create a prepare recipe with "Create GeoPoint from lat/lon" step to generate a single geopoint column.
Regards,
-
lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner
Hello Andrey,
thanks for the response. I already tried it this way. The output looks like this:
One can observe that something goes wrong when the lat and lon are created. For example, the state LA gets some coordinates in Laos.
-
Sorry for a misleading solution, I did a brief testing with a few cases where it worked...
Since it's a limitation of the geocoding service you can give it more context to improve the result.
For example you can create an intermediate prepare recipe that would prepend a state code with a country name:
Then if you use the newly generated column for geocoding you'd get the result like:
-
lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner
Thanks, looks like a great idea. I created that column, but now unfortunately when running the forward recipe I get the following error:
-
Hi @lisa811
,Could you copy the whole stack trace of an error?
Could you also try with Arcgis provider?
Regards
-
lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner
Here are the logs. For Arcgis another error occurs.
-
May I ask you to also try to import a project attached to this message and see if you can "Forced recursive rebuild" the last dataset called "geocoded_geop" ?
-
lisa811 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Registered Posts: 14 Partner
Hello Andrey,
sorry for the late response, I was absent.
If I import and run the project you provided, I get the same error as I had before in my own project ("need more than 0 values..."). I don't know whats wrong here