5. Use computation
– to find things to count
Example: Text
Out[ ]=
Word frequency in Lord of the Flies
In[ ]:= MaximalBy[TextSentences[lotf], Classify["Sentiment", #, {"Probability", "Positive"}] &]
Out[ ]= {We are going to have fun on this island!}
MoreThanJustStats.nb 5
23. The role of automation
– automating insights
Example: Image identification
Example: Supervising the computer
Data = 0
Reset
Capture: Rock Paper Scissors Watch Stop
Train
MoreThanJustStats.nb 23
24. Example: No supervision - “Hands off the wheel”
Dogs
In[ ]:= Dataset[dogs]
Out[ ]=
24 MoreThanJustStats.nb
25. In[ ]:= FeatureSpacePlot[Take[dogs, 60], LabelingSize → 70]
Out[ ]=
In[ ]:= nearestDog = FeatureNearest[dogs]
Out[ ]= NearestFunction
Input type: Image
Output property: Element
Unable to store data in notebook.
In[ ]:= Grid[{testDogs, First /@ nearestDog[testDogs]}]
Out[ ]=
MoreThanJustStats.nb 25
29. API deployment
In[ ]:= CloudDeploy[
APIFunction[{"class" → "String", "age" → "Number", "sex" → "String"},
Function[titanicSurvival[{#class, #age, #sex}]],
AllowedCloudExtraParameters → All],
"TitanicPredictor",
Permissions → "Public"
]
Out[ ]= CloudObjecthttps://www.wolframcloud.com/objects/jonm/TitanicPredictor
In[ ]:= EmbedCode[%, "Java"]
Out[ ]=
Embeddable Code
Use the code below to call the Wolfram Cloud function from Java:
Code
Copy to Clipboard
if (_conn.getResponseCode() != 200) {
throw new IOException(_conn.getResponseMessage());
}
BufferedReader _rdr = new BufferedReader(new
InputStreamReader(_conn.getInputStream()));
StringBuilder _sb = new StringBuilder();
String _line;
while ((_line = _rdr.readLine()) != null) {
_sb.append(_line);
}
_rdr.close();
_conn.disconnect();
return _sb.toString();
}
}
MoreThanJustStats.nb 29
30. Breaking the Boundaries of
Traditional Data Science
The toolset is HUGE - use more of it
Automation makes the toolset accessible
The human’s role is to ask deeper questions of the data
30 MoreThanJustStats.nb