[WSG20] New Machine Learning Basics Study Group begins Monday, November 16

Let’s bring your question to Friday’s Q&A session with the development team.

thank you. I’m just now beginning to see how esoteric this topic is typically considered, yet how clearly it was evident while immersed in learning R just after your Summer Boot Camp sessions.

I believe yet another example was provided in today’s lecture when we were evaluating predictive probabilities for boolean operators (or something like that) with values of .99998 accompanied by mean error of 1.00058 (or something like that) note: it’s been awhile since I’ve taken a stats class.

So… perhaps a more precise version of my question for Friday is: If we accept that these tiny values are, in fact, measurements of computational error with magnitude attributable to specifications of the system which had computed it; and we are willing to admit these values of something times 10 to the negative 50th power are meaningless aside from representations of computational processor error…

why not just round it zero? or perhaps some symbolic feature of irrelevance? continued use seems to create user confusion from inconsistent outputs and higher risk of error propagation than benefit.

looking through the documentation I saw some functions which appear to effectuate this under the heading of Precision & Accuracy Control, but why not make such settings default? or default for a particular user type? (like “student/learner”) then everyone in a class would receive similar results regardless of what type of computer they are using.

Actually this seems to work for me, in spite of the red syntax coloring!

rdata = ResourceData["State of the Union Addresses"]
data = rdata[All, {"Date", "Text", "Age"}]
sample = IntegerPart[.9*Length[data]]

trainingDataset = RandomSample[data, sample];
testDataset = Complement[data, trainingDataset];

p = Predict[trainingDataset -> "Age"]
PredictorMeasurements[p, testDataset -> "Age", "ComparisonPlot"]

Or by transforming the Dataset:

tData = data[All, {#Date, #Text} -> #Age &] // Normal;
trainingData = RandomSample[tData, sample];
testData = Complement[tData, trainingData];

p = Predict[trainingData]
PredictorMeasurements[p, testData, "ComparisonPlot"]

From the same test dataset and predictor function as above, it gives the same result:

1 Like

FeatureSpacePlot[
DeleteDuplicates@
TextWords[
“The Wolfram Language includes a wide range of state-of-the-art
integrated machine learning capabilities, from highly automated
functions like Predict and Classify to functions based on specific
methods and diagnostics, including the latest neural net approaches.
The functions work on many types of data, including numerical,
categorical, time series, textual, image and audio.
The Wolfram Language has state-of-the-art capabilities for the
construction, training and deployment of neural network machine
learning systems. Many standard layer types are available and are
assembled symbolically into a network, which can then immediately be
trained and deployed on available CPUs and GPUs.
Using a variety of state-of-the-art methods, the Wolfram Language
provides immediate functions for detecting and extracting features in
images and other arrays of data. The Wolfram Language supports
specific geometrical features such as edges and corners, as well as
general keypoints that can be used to register and compare images.”],
FeatureExtractor →
NetModel[“GloVe 100-Dimensional Word Vectors Trained on Tweets”]]

1 Like

Abrita,
Values[Normal[…]] didn’t work for me but interchanging them worked fine (at least there were no errors flagged by mma).I am somewhat confused by the results though.Based on my interpretation it appears that based on the test results, the prediction is always between 57 and 59 years. I got these results by running Predict with the Method set to “Neural Network” and Performance goal set to “Quality”.
I had 163 records for the training set and 70 for the test set. Is Predict working properly? Is my interpretation correct?

ComparisonPlot.bmp (6.29 MB)

1 Like

Where do we find the quiz for the course? I haven’t seen an email with a link or a file for it. I want to try it before our final Q and A class tomorrow.

@Stephanie Meyer, please check your Study Group email reminder that was sent earlier today. It includes a link to the quiz.

Thanks!!! I totally didn’t even look at the emails because I had the event saved in my calendar. My bad.

Predict is working. i think the conclusion is the date and text of the address is probably not very good at predicting the age. At least while we use the features as is.

A final challenge

Create an deploy a simple machine learning app of your choice. Feel free to use one of our built-in classifiers or predictors.


To get you started, here is the example we looked at in the study group session:

CloudDeploy[
 FormPage[
  {{"myPicture", "Your picture"} -> "Image"},
  Module[{entity},
    entity = Classify["NotablePerson", #myPicture];
    Row[{#myPicture, Spacer[10], entity, Spacer[10], 
      entity["Image"]}]
    ] &,
  AppearanceRules -> <|
    "Title" -> "Which famous person do you look like?", 
    "Description" -> 
     "Enter your image and we'll show you your famous twin!!",
    "SubmitLabel" -> "Show me who"|>,
  PageTheme -> "Black"
  ],
 "FamousLookAlike",
 Permissions -> "Public"
 ]

Here’s the simpler version for testing: https://wolfr.am/RddbHZR4

Great. If I am not mistaken, the net model is used to create some kind of distance measurement for the featurePlot?? Is that correct?? thanks

Detecting the oldest and youngest in a picture.

https://www.wolframcloud.com/obj/tsukisan/LookingForExtremes

1 Like

Right. The neural net model is being used to extract features from the words here and those features are used to place the words in the 2-dimensional feature space.

thanks

For the deployment aspect, I have tried two more independent product approachs, first one deployed at

http://vfvalue.com/ai/image.html

this page needs authentication to login,

it features chinese input, The following example the input is dog in chinese, and then the result return
“True”

Starting from this, I also tried APIFunction[],and embed the api call in node.js at the server side, that way I can independent get total control of the front end look like and pave a path for independent commercial projects using web interface.

The result:

The issue of precision is principally one of performance. While Wolfam Language can handle precise symbolic arithmetic and arbitrary levels of high-precision arithemetic, they are both much slower than floating point arithmetic which is effectively performed on the CPU while the others are in software. Since machine learning methods applied to big data are already very demanding and the difference between 10^-10 and 0 rarely makes a difference, the priorit goes to speed. Indeed some GPUs are designed to work at even lower “single” precision to enable more calculations per second.

There is also a second issue. Some of the training process is probabalistic, so you will acheive different results each time you run the training. For reproducibility one should control the random state with functions like SeedRandom (and some new tools coming in Wolfram Language 12.2) but since I didn’t do this when I recorded the videos, we will likely never know how to reproduce the exact answer that I got.