Programming Throwdown - Applied Artificial Intelligence
Episode Date: June 13, 2013This show covers Applied Artificial Intelligence, techniques for applying AI to work or hobby projects. Tools of the show: WebM and FFMpeg. Books of the show: 2br02b http://www.gutenberg.org/...ebooks/21279 and The Code Book (Kindle: http://amzn.to/14zADaL), (Paperback: http://amzn.to/11j2l7G) ★ Support this podcast on Patreon ★
Transcript
Discussion (0)
Hosting provided by Host Tornado.
They offer website hosting packages, dedicated servers, and VPS solutions.
HostT.net.
Programming Throwdown, Episode 28, Applied Artificial Intelligence.
Take it away, Patrick.
Wow, nice.
All right, so this episode we're going to skip the news
because we've got a lot to talk about.
And then also, I'm not
sure whether everybody likes the news, and by the time
we release it, it's not always
freshest news. It's not new, it's old.
So it's much more just our discussion.
But we have a lot of feedback,
so I want to talk about that. So first of all,
thank you everybody for sending us feedback
via email, comments on the google plus post comments on our I don't
know many comments on our blog really yeah one thing we we well at least I haven't been really
following the g plus page I've kind of abandoned that in favor of the g plus community which I feel
like kind of has a better ui so definitely post on the community you know we've gotten a lot of
posts about you know new languages a lot of posts about new languages
like Haskell. Well, not
new languages, but the languages that we haven't
covered. That's right. And so we definitely take
those seriously, and there will be definitely a Haskell
episode this season.
Where a season is an indeterminate
number of episodes. Yeah, actually, we should
probably figure out how long
the season goes. It's our gut.
I don't know how they do it in the movies and um it's arbitrary it's arbitrary so anyways but thank you for your feedback yeah
we really appreciate it and and sorry we don't always reply to everybody we're you know got busy
crowded email inboxes like but we do read them we do see them we do appreciate even the people
who tell us we're wrong um that's okay we we don't mind yeah we appreciate constructive criticism
or deconstructive criticism i don't appreciate it but it's okay we we don't mind yeah we appreciate constructive criticism or deconstructive
criticism i don't appreciate it but it's okay we read it and smile a couple of people or said
something like uh oh you'd be much better off listening to my podcast yeah that's one star
which that's how you know you've made it yeah maybe so speaking of that i checked and we have
107 as of this recording podcast reviews in itunes nice thank you all i know not all of you
listen via itunes or ios devices and so i know that's not nearly representative of the total
amount of people who are giving us love but we really do appreciate that feedback
we noticed actually even though we had a big break before last episode in this episode that
people are still finding the podcast
you know we're building up a set of topics which people are interested on so if you're new welcome
yeah um but we're definitely building up people and it's growing over time and so like that's
definitely keeps jason and i interested and engaged in uh recording each interval um so so
uh just some stats um last month our our stats actually went down because the website was down.
So if you were following our G Plus community, you knew about that.
We had an issue with our ISP that took a couple weeks or took a week or so to resolve.
But before that, we were hitting 1.2 terabytes a month of bandwidth.
So you guys are definitely downloading a lot of episodes.
So which one of you is downloading just like a thousand of them yeah well according to feed burner we have over 2 000
unique subscribers nice so totally awesome you know definitely uh you know we had 2 000 subscribers
and a hundred uh comments so a lot of you out there if you're shy come on don't don't uh don't
be shy tell us uh what you think we could do to make the show better.
A couple of people have given us advice like don't do the news every time because it starts to get old.
And we take that advice very seriously.
Yeah, and there's a fine balance there.
We don't listen to everybody's advice.
No offense.
We do appreciate the advice.
Feel free to share.
We do try to listen to if a lot of people are saying something.
But, you know, this is Jason and my podcast.
Horrible grammar.
I'm sorry.
But this is our podcast.
And so, like, you know, at some level, we want to keep it what we want to be.
Like, we need to keep doing it, right?
So we have to do something that we like doing.
Yeah.
So, you know, don't feel, like, offended if you have, like, oh, I really want to talk about this or that.
And Jason and I aren't really into it.
Then, you know, we may not talk about it because, you know won't give it passion we want to be passionate about what we do yeah definitely
it's sort of a blend between you know taking getting feedback from the community and making
the best possible show from the community but also you know doing something that we're knowledgeable
and staying true to ourselves too and so yeah it's a it's a fine line but we definitely that's
the line we want to walk because your feedback has made the show much, much better.
Yeah, so thank you for all the iTunes love.
If you're into such things, please rate us on iTunes.
That'd be awesome.
We do appreciate it.
It makes us feel good.
So one of our listeners, Neil, wrote in to recommend a TV show that he appreciates.
I thought I was going to get like an awesome sci-fi recommendation,
but this maybe in some ways is cooler.
He recommended a cooking show, America's Test Kitchen.
And I have actually watched this show a number of times.
I don't watch it every episode, but this comes on PBS,
so Public Broadcasting Station or whatever.
Everybody's got their own different one locally,
at least here in the United States.
And maybe it's online if you live in another country.
Because we do actually, Jason shared the stats with me as well, a lot of you are in the United States. And maybe it's online if you live in another country. Because we do actually, Jason shared the stats with me as well.
A lot of you are in the United States,
but there are a lot of people who listen and aren't in the United States.
And that's really awesome as well.
Do you want me to say hello in German?
I'm going to look it up.
No.
Okay.
I'm going to look it up.
So while he looks it up, I'm going to tell you about America's Test Kitchen.
So Neil said that they kind of try to develop an algorithm for cooking.
And I agree.
I think they, you know, it's not a techie show a techie show, but if you ever have watched a cooking show
and it's like, ah, a pinch of this, a pinch of that,
these people try to say, let's try five different ways to batter a piece of chicken
and really get the – we really determine people like crispy skin that sticks good
and is about medium thickness.
So what can we put in, even if it doesn't make a lot of sense,
that really makes that work?
And they try to try various combinations as opposed to just kind of,
you know, you'll know when it's good.
So I do appreciate that.
That's kind of interesting.
So thank you, Neil.
I haven't seen that show yet, but I'll definitely check it out.
Yeah, I mean, all of us have to eat.
So that means some of us at least cook some of the time.
So definitely interesting.
Yeah, so our two, the two number, number two and three most popular countries for programming throwdown viewership are Japan and Germany respectively.
Nice.
So konnichiwa to our Japanese friends and hallo to our German friends.
Why are you laughing?
No, I'm laughing because it's so close to English.
At first, I thought that Google was playing games with me because it wasn't an actual search result.
I put hello in German and it went straight to Google Translate.
And it just said hello.
And I thought that something had gone horribly wrong.
Okay. So, maybe we'll talk about machine translation today.
Yeah.
How apropos.
So thank you guys out there listening all over the world.
And please forgive Jason if he said that poorly.
So Travis wrote in to discuss.
He had a number of good comments and points.
But he was also saying, you know, like,
hey, you guys got a lot of episodes.
I'm listening to some of them.
But, you know, it's kind of hard to, to you know understand like when i have a new project like
what what language should i write it in and this is something like jason and i discussed a little
and it's like yeah you know it's a hard question um and but sometimes you know and um i don't i
almost stare your point but my point is like it is true like sometimes you can get bogged down
though like trying to figure out too much analysis like what do I want to do? And we do cover a lot of languages.
There's not really a good format for us to like cover every like application of the language
as episodes that you can then see your choices.
And like many things in life, there's more than one way to solve the problem.
Some ways are better than other ways, but between two choices, like even if the man
or Google or the internet or whatever says that like
you know this way is the best like you should always do it this way that's just over opinionated
people for the most part because for you the best way is dependent on you completely if you know a
language and there isn't an obvious reason why it won't work in that language you know go for it
like maybe that can be the best learning experience for you is to try it in that language you know go for it like maybe that can be the best
learning experience for you is to try it in that language and that's often how new languages get
created um you know people find shortfalls in what's there but definitely it's like your personal
situation and like don't and i think i get stuck in this uh rut a lot like you go online you're
like looking up like i want to buy a you know of pants. Oh man, this pair of pants has like three star reviews.
You know, like, oh, it's terrible too.
But it's like, wait, wait, hang on, hang on a second.
First of all, it's just a pair of pants.
Like, it doesn't really matter.
Second of all, it's like, those people could be very different than me.
Like, if they all talk about the fit.
But I don't know what they, like, their body type may be very different than my body type.
So, like, that advice doesn't always apply to me so just a general you know big caveat to
the internet in general and advice on the internet you know just remember take
it with a grain of salt because everybody's situation is different yeah
definitely so what are your thoughts yeah so Patrick's absolutely right you
should just dive into it pick a language that you know you feel comfortable with
or one that would be fun to learn if it's if it's a project you're doing for
fun and jump into it you'll either learn why that was a bad choice which is
really interesting to find out or most likely you will do fine in that language
it might not be the most efficient you know but but you'll get you can get
almost anything done in any language for the most part. So the only thing I would want to add is
think about your audience, right?
So, well, two things.
One, think about your audience.
So if you're wanting this to be a web app,
then JavaScript obviously is gonna play
a pretty heavy role.
If you're wanting this to be some kind of server,
backend kind of thing that's gonna serve
thousands of customers, then you'll want to use C++ or Go or Java
or something similar, right?
So you have to think a little bit
about your target audience.
The other thing is, you know,
know that you can have two programs
written in two different languages communicate.
You know, we talked in our IDL episode
about, you know, Thrift and protocol buffers and things
like that so you know if it turns out you write it in Lisp let's say and now
all of a sudden you need a web front-end you can always do that part in
JavaScript and then use Thrift RPC or something else to talk about it to talk
to to your to your other programs so yeah don't be too worried about picking
a language just pick one that you want to learn or one that you're most comfortable with,
depending on the type of setting you're programming.
And if you need to get something done quick, then pick the language you're most comfortable with,
and you should be just fine.
So we talked about it before, so I won't overly hash it here,
but also remember that a lot of us aren't writing apps that need to scale for millions of users from day one.
And so you can always develop something as you go learn using what you learn leveraging what you
learned in advance and you hear about epic mistakes like you know facebook doubting whether or not
maybe it should have been so heavy and implementing or what is it no i guess it was dig implementing
stuff in php and then like only hiring php programmers and like how this was like they feel like a big problem for them
It's like well, but first of all, they're the use case and we talked about before like being in that situation is somewhat
Like good situation to be in that you have so many users that you can't support the traffic anymore
If you're dig you can just rewrite it in another language and be just fine
Although I don't think that worked out so well for him but and did get other a lot of their a lot of their ass there's a whole thing
about yeah yeah it's not here and there but it's growth model was fun really
flawed but anyways that's for another yeah I don't think their language is
what killed them no I don't think so either yeah but yeah all right time for
tool of the show to the show so my tool of this show is WebM. WebM.
So WebM is pretty awesome. It's becoming more and more popular. It's built into Chrome and Firefox, many of these modern browsers. Basically, it's a completely open source, royalty-free,
patent-free video encoder and decoder. It's in C++, but there are Java and other bindings for it.
Or as we just talked about,
you could have some kind of thrift RPC server
where you pass video frames to this thing
and get compressed video back, et cetera.
But WebM is pretty epic.
It has better compression than H.264.
So for people who aren't that familiar if
you go on you know YouTube let's say and you watch a video you're gonna watch it
in h.264 format which is this format developed by seeing people who made mp3
and it has a set of patents associated with it and I believe Google actually pays the H.264 people royalties for every
video they encode or there's some kind of negotiation but basically if you want to encode
video in this format as YouTube does you have to theoretically pay money and all of your
programs you know say the program that connects your camcorder to your computer and compresses video for you,
they have to pay this company money, and it's kind of a racket.
There's also a bunch of issues with it.
The code itself doesn't have very good fidelity because it's closed source, etc.
So WebM gets rid of all of that.
It's totally open source.
People are able to edit the code, fix the code, clean it up, etc. It has an unoptimized version, which doesn't do all sorts of crazy hacks.
And that unoptimized version will run in anything. Like you can encode a video in your Raspberry
Pi or on your Android phone even. That's something that's not possible with H.264. So at least,
well it is possible using something Patrick will talk about, but that's
a side issue. In general, and even if it is possible, there's litigation, there's litigious
issues around it. So yeah, so definitely check out WebM if you want to do anything with video.
So what is the, so the reason H.264, like part of why it is really popular, and there's
a lot of problems with it, but now like it's so ubiquitous that like i think there's a lot of hardware associated specifically with accelerating
h.264 decoding at least yeah and somewhat encoding but you know let's focus on decoding because
the idea is you create once and watch it many times hopefully at least for you know internet
videos or whatever yeah um so like there's a lot of hardware on low end phones and tablets and people to like specifically
to decode H.264.
Right.
So does WebM suffer like have to do all that in software?
Can it leverage like is that stuff generic enough to work for WebM?
Is it going to hurt adoption?
Yeah.
So yes, to your point, there are hardware chips for H.264 decoding.
I don't think there are hardware chips for WebM, at least I haven't
heard of it. So yeah, it will suffer in that arena. It will use more of your battery and
things like that. Right now, they're kind of targeting desktop. And so if you look at,
you know, there was a presentation on Google I.O. about WebM two days ago, and almost all
of the presentation was focused on the desktop experience. So I think it's one of these things you, you know, on desktop,
they're, you know, WebM is just better in every dimension.
And so they kind of, you know, do that part of it, get the desktop right,
and then start to roll out the phones with WebM and things like that.
So it's still got a few years out, but if you're developing,
if you're writing code, and if you're part of, pretty medium or large-sized project, you could use WebM,
and in 12, 18 months, the phones will probably have hardware for it.
Jason predicts.
That's my prediction. That's my Moore's law.
And if he tanks your project, it's not as full.
But even in software, decoding is never really an issue.
If you're watching tons of YouTube video,
then yeah, your battery will suffer using WebM.
Well, I know on my Nexus 7,
so I have a video player which will tell me
if it's on hardware or software decoding.
And when it's on software decoding,
it doesn't work as well, and the battery drains much faster.
Oh, really?
Maybe that's just my feeling. Like a factor something it's hard to say i mean i never measured it empirically it
just seemed like when i was finished watching it and maybe that's psychological because it's
telling me it's on software decoding um but yeah i mean i mean i know this is is an issue i was
just curious yeah i mean it would make sense for them to start, you know, I know that YouTube
actually has something, if you go in the settings, you can actually put on HTML5 mode.
This is something that anybody can do.
I don't remember exactly how you do it.
Somewhere in your YouTube settings.
And then it will use WebM.
And so you can actually get a sneak peek of what a non...
Although, based on what you just said, you're not supposed to be able to tell the difference tell the difference really yeah you won't really notice but it's just kind of a cool thing to do
to say yeah and i mean it's one of these things where like ideally maybe this sounds like better
idealistically i just like we'll see i mean it practically maybe it you know it's like an
adoption thing it's like regardless of whether you think it's right or wrong like everybody uses
h.264 so there's a lot of peer pressure.
Right, yeah.
I mean, but as I mentioned, the patent thing is kind of a big issue. It is, yeah.
It would be nice to get rid of it.
Yeah, if you're writing software for a company
and you're selling the software to someone else,
a consumer or another company,
you will have to pay this Frankenhauser.
You will have to pay a lot of money in royalties.
So for people doing business apps and stuff,
it's a serious consideration.
Yep, definitely.
All right, well, my tool of the week,
actually being a tool this week, shocker,
nobody pass out, is FFmpeg.
So similar to Jason's talking about video,
I guess it's a good tie-in in encoding MPEG.
And FFmpeg is an open source library,
I guess probably the most used one for decoding video,
various video encodings for you
when you want to play a video in an application because all of us kind of get there at some point
where you want to do something. But, you know, actually what I've used it for in the past,
surprisingly, is, you know, there are a set of executables that they, you know, release to do
kind of decoding to various formats or raw formats or whatever. But you can, I found myself in various times for various reasons wanting to like take a video
and like create all the frames from the video. So if you like pause the video and like that,
but like, you know, kind of better and you know, like all along because you may like have had a
really good video and you want to capture a shot. Now, obviously those shots aren't as good as like
taking a picture with your camera,
but I wanted to run some image processing,
but I don't really want to bother hooking it
into the whole decoding the video and everything.
That would be nice, but if I could just get the images
and do a couple of them one by one,
test it for that reason,
or I created a little animation once in i think matlab
like a little like oh i wrote out some images like with some variations that i was doing and i wanted
to string them together in a little video so i could give to people as opposed to like oh just
you know click through each of these pictures and ffmp could do both of those for me with just you
know on the command line i just run the program and it's like this file with this wild card just like zip them all up together into one video and encode them and then also the other like
take a video and explode them into a bunch of files i know that sounds weird you maybe you've
never come across that before i've come across it a couple times and it's invaluable to know about
this project and to know that i can do this oh i didn't know that. What kinds of things can you do with audio? It can convert raw audio to MP3
or vice versa.
It supports, I think, like,
like a bunch of other audio codecs.
If you want to take a video that's in one format
and change it to another,
almost any format, it will support.
It's pretty epic.
Yeah, and a lot of the tools that you would use to do that,
like open source ones, free ones, these ones,
like use FFmpeg to do that.
That's the engine.
And really all they are is helping you set up the parameters.
Yeah, exactly.
Which can be really confusing.
Yeah, yeah.
It's a total nightmare.
All right.
Book of the show.
Book of the show.
So my book of the show is actually a short story, not a book.
That's not a book.
I know.
I cheated.
And it's totally free uh the link i
provided uh take you straight to a website where you can download the short story uh it's pretty
awesome it's um so the name of it literally is 2b r0 2b but what it really means and it's
sort of like the british way of saying, is to be or not to be.
And it's a cute story.
I'm not going to give anything away because, like I said, very short story.
If I give anything away, you will know the whole story.
So it's a pretty funny read.
It's like a kind of sci-fi dystopian feature theme.
And it's got a kind of twist at the end that i thought was pretty cute uh so
definitely give it a read it's only going to take maybe 10-15 minutes is it recent barrier of entry
you know i think it's it's rather old okay um but uh i thought you know i came across it when i was
looking for new sci-fi stuff to read um and uh it was uh oh my kurt Vonnegut. He wrote Slaughterhouse stuff.
Yeah, that's right.
And other stuff.
So, yeah, it's pretty awesome,
and you guys should definitely check it out.
You only waste a little time.
I feel like I'm going to just read it right now,
and you can just keep talking for a few minutes.
Yeah.
Is it that short?
I think it's like five or six pages, maybe.
Okay, so maybe.
All right, I'll read fast.
All right, just pause this while I go.
No, I'm just kidding.
All right, so my book is The Code Book.
So this is a nonfiction but wide audience,
not a textbook, written by Simon Singh.
I hope that's how you say his name.
And this is, what do they call this,
like a popular book or whatever?
Not like that it's popular and that it sells a lot.
I'm sure it does.
But like it's written for a general audience to cover cryptography.
So he takes like a very storied approach in a lot of, you know, very plain English things to the history of encoding things.
Is it fiction?
No, it's nonfiction.
But like I said, it's not a textbook
like it's not going to teach you're not going to you may come out knowing how to do some sorts of
like basic coding but it's not going to teach you like encoding but some it's not going to teach you
like uh you know here's how to write a public key cryptography system securely it's not like david
deutsch fabric of reality like one of these like books that sort of cover something at a high like
strength theory at early yeah okay that would be exactly like equations right i would equate it to
like brian green's books like the elegant universe or whatever like these kinds of things yeah so
like they're writing about it so pretty much anybody can read it like it's very approachable
it's very story oriented a lot of analogies um but there's some really good stuff in here and um
it's rather old uh 2000 so it so it's almost 13 years old now.
But I remember reading this closer to when it originally came out.
And I haven't read it in a while, but I remember I was coming across something the other day,
and I was like, oh, I knew that about cryptography.
I was like, I have no idea where I knew that from.
And then I remembered, oh, I had gotten some of this from this book.
So it talks about ancient Egypt, ciphers queens you know wanting to hide secret information and then it does cover at
a high level like quantum cryptography so again not good enough to ever but like what is a
fundamental ideas kind of and being 13 years old i'm sure it's maybe not completely up to date
um to what's going on now but that sounds like a good read like i think these books are people
have debates like how valuable it is like what would you do with this knowledge but personally
as opposed to just reading a fiction book which like you know doesn't apply at all like reading
this book even though i may not be able to like go write encryption algorithms that i may not be
able to like you know actually use the information in here i mean it's a like background story yeah to the way
things are and i find it interesting and it gives you like little bits of things to talk to other
people about or you know just kind of satisfy the curiosity of the mind which i find common upon
among people who write code yeah definitely it sounds awesome i mean one nice thing about books
like this is you know i'm reading a fiction book right now reading snow crash and you know it has a lot of
ties to programming and hacking and this kind of stuff but being a fiction book I
don't really know where it draws the line oh yeah I've had this before like
oh it says this I wonder if this is true yeah yeah but with the with something
like this you kind of you you know that you really like believe, like, it's trying to tell the truth.
Like, you feel confident in things that you've learned.
But at the same time, it's not like reading a textbook.
Yeah, you can just, like, read it in the evenings or on an airplane or whatever.
And it's not like, oh, man, I don't get this.
Yeah, yeah.
Yeah, so I've read a number of books about it.
Like, you pointed out some about, you know, the universe or cosmology or like these kinds of things and uh you know quantum physics especially for some reason is really
intriguing to me yeah but it's like no application to like anything i do but i it's my recommendation
i'm sticking to it you mean you're not doing quantum physics i thought everyone in the valley
just does quantum quantum oh yeah that's in our stealth starter. I've entangled our listener.
Oh!
Now it's unknown what state they're in.
Yeah.
Oh, man.
You have to write us and tell us
so that your super state can collapse.
Yeah, exactly.
Oh.
All right.
So apply artificial intelligence for us, Jason.
Yes, apply.
So, you know, we...
I'm sure if you're watching or if you're listening to the show as an order,
you saw our theoretical soapbox rant.
Yes, and if not, maybe you should consider going back and listening to it.
Yeah, I don't really know which order would be easier.
Oh, wait, what?
Yeah, maybe you should see it in parallel.
Should we release these in parallel?
Oh, that would be pretty weird.
So this one is going to be more on specifics.
So the goal here is what can you do in AI that's going to help you or your business or your project that you're working on, et cetera.
What are some things that everyone wanting to do stuff in AI needs to know, should know to sort of make the process go a lot smoother?
At least according to Jason.
According to Jason.
And Patrick.
Yes.
And Wikipedia.
And, yeah, years of experience.
I mean, we've been doing AI stuff for a long time together.
Well, you happen to have a PhD in it.
Well, yeah, I've been doing it for a long time.
I took a couple of classes in it.
And I watched a video on YouTube.
The two of us have been working at the same company for, what, seven years?
A long time.
A long time.
Yeah, like six years.
Two different companies, but at the same company.
Right.
Ooh, that was hard.
We were at one company together.
Now we're at a different company together.
Yeah, exactly.
But, yeah, we've done a lot of ai stuff we have pretty
good experience we want to share with you guys so um so for some common terms in ai so definitions
yeah yeah so we'll knock these out so first is objective function objective function in a nutshell
is like a formal math um function of your target so in other words let's say your goal is to get as
many people to click on your website as possible yes pay me money then your
objective function is the number of clicks that one okay you might think
that might be the way to go like like on your website every time somebody clicks
then you your website doing better, right?
Yeah, he didn't click their website do works, right?
I'm gonna cry
Another thing is features features are the inputs to your system. So for example
You might do the objective function might be will this person click or not click and the features might be
You know what you show them. So let's say you're Twitter.
So you might show people random people's tweets.
You might say someone might go to Twitter and not go on their feed or their friend's
feed.
They might just go in some kind of discovery mode.
I've actually never used Twitter so I'm making this up.
But they might go in some discovery mode on Twitter where they say,
just show me random people's tweets.
And so the features would be the person whose tweet they're currently looking at,
the text of the tweet, any hashtags written in the tweet.
And the objective function would be, did this person follow that person, or
did they respond to that tweet, right?
If they did, that's good.
They did something to increase the volume of content on Twitter.
So it's like given these number of things to consider,
how likely do I think this thing I want to happen will happen?
Exactly, yeah.
So those are the features.
So, you know, there might be, you commonly hear the term hidden features,
and that's where there's just aspects of the problem that you didn't you
know account for like for example if your only feature is uh you know day of the year or something
like that that's your only feature then it's going to take you a year before you can learn anything
and come back to you know february right or something so you uh you might have hidden features
that are oh maybe this person person really likes baseball players,
but that wasn't one of your features, so you're not able to learn,
you're not able to match the objective function very well.
So hidden features aren't something you have, they're something you're missing.
Right.
But you couldn't necessarily ever have.
Right, exactly.
There are some features that are just, maybe they're part of the human psychology
that you just aren't able to capture. So actually along those lines
there is a concept called underfitting or overfitting and so the idea is you
know you have this objective function and the objective function has a certain
distribution so you want to sort of you want to sort of capture, you want to learn this objective
function. So for example, Patrick went on Twitter and he went to this tweet and he clicked
on it. So if the next person does exactly what Patrick does, I want my system to learn
that it expects a click, right? What can happen is it could memorize exactly Patrick.
Like it could say, okay, if Patrick Wheeler comes
to this site and does exactly these three things,
then he'll click on the tweet.
But under any other circumstance, there won't be any clicks.
So it has just memorized the answers.
It hasn't really understood the problem.
It doesn't realize that some people
like athletes and some people like etc so this happens a lot with uh stock market algorithms
yeah people go through the whole history of the stock market and train their algorithm on you know
the whole history or whatever but then as soon as tomorrow comes just because like you back tested
it but it already had memorized all of history it's like a very naive problem like theoretically people are not supposed to keep doing it but everybody does it
it's like you look at the whole history of the stock market then you give it some
piece of that from the past and of course it knows exactly what to do it's seen it before
yeah but then as soon as you go live with it tomorrow and it sees something it's never seen
before it just flips out yeah it does something crazy it wasn't supposed to do yep and so that's called overfitting so that means that you fit the objective function so perfectly
but the real world you know what's going to come in the future doesn't fit the objective function
the future has a different distribution than the past and your algorithm was in general it was very
tied to the past distribution and so it doesn't work when you try to predict future things.
That's overfitting.
The way we deal with that in machine learning is we split the data into two sets.
We have what's called a training set and a holdout set.
Let's say we do like a 90-10 split.
So 90% of our data goes in this training set,
and then we train a model-10 split. So 90% of our data goes in this training set. And then we train a model on
that set. And we take the model once it's been trained, and we score it on the holdout set. So
this is data that it hasn't seen before. If it does really well on the 90%, but then it fails
on the 10% that it hasn't seen, that's a sign that the model has overfit. And so there's various
things that you can do to fix this.
You can lower some features.
Like, for example, let's say I had a feature for every person on Twitter.
I had a Patrick feature.
I had a Jason feature.
I had a you feature for the listener.
Then it will use that information.
It will memorize something about Jason that it won't apply to Patrick, right?
So if I take that feature out of
the system to where it doesn't know exactly who's using it and i replace it with something like
is the person male or female is the person young or old if i use more general features you can you
can sort of address this overfitting problem this is a dangerous thing to get in right because like
you can almost accidentally end up
training it on the 10 that you're holding out as well so some like people who aren't careful
like oh i trained the model on the 90 but then i determine which models to keep and do further
tweaking based on the 10 but then you've kind of allowing the 10 to creep in right that's true so
then now you're really training on everything and so so when you give even brand new data, it's a delicate balance.
And this is where it doesn't come down to a formula.
Yeah.
Like this is what you do.
You keep this much data away and you take this much data.
And it's hard if your data is really expensive or you don't have a lot of it.
And then like how you got to be careful.
You can't use just you don't have an
infinite supply of it yeah so you have very small sample size yeah definitely no it's totally right
um so yeah so so underfitting is where you can't even learn on the 90 so in other words you know
going back to the twitter example if all i gave you is patrick's age and you had to determine
whether he'll click on this baseball link or not, that's a pretty hard problem because there's some...
How old are you? You're like 30, 20?
You asked a man his age on a podcast.
Anyway, so let's say Patrick is 104.
There's probably some 104-year-olds who like baseball and some who don't. And so you're not going to be able to use just someone's age to determine if they will
click on a baseball tweet.
So you will just not do well on the 90%.
That's underfitting.
And so that, when you have that problem, then it often comes down to these hidden features.
And maybe there's some other part of the problem that you can capture that you're not capturing.
So one last set of common terms.
There's three basic types of machine learning.
There's classification, regression, and control.
So classification is kind of how it describes, you know.
Like you might say, so even just let's say you want to recommend somebody.
You want to say, does Patrick like sports or does he like leisure?
Does he like television?
You want to fit Patrick into one of these buckets to determine what kind of Twitter user he is.
Give me a label.
Yeah, exactly.
Regression would be if you want to do stock market prediction.
That's an example of regression where a know a stock doesn't do you know zero or one
there's some continuum of success for a stock and so whenever you're dealing
with these continuum you're dealing with regression problems and last is control
control is actually very similar to classification you know given a certain
set of features in a certain environment, you want to choose one action versus another. The difference is control often involves a feedback loop.
So you're doing many classifications, and the results of previous classifications matter.
Like you make a move in checkers, the board changes, and the fact that you made that move
matters.
So you said machine learning there. so how would you define the difference between
artificial intelligence and machine learning? Oh man, on the spot. So yeah, so in the past,
in the previous episode, we focused on AI in general. You know, machine learning is technically
a category inside of AI. There's a lot of, you know, as we mentioned in the podcast,
in the previous podcast, there's a lot of intelligence know as we mentioned in the podcast in the previous podcast there's a lot of
intelligence which is innate in humans and there's a lot of intelligence which is sort of can be
captured you know by human in a program so in the case of in the canonical case that we mentioned
image processing of compressing the blue channel that isn isn't machine learning. That's just understanding human
physiology, the psychobiology of the brain, and then reverse engineering that. So that would be
an example of something that I would consider that AI, but not machine learning. Machine learning is
typically where you have a set of data, and you have a set of features and objective function and you want to create
a fitness function or another way of saying it is you want to create a model which given
new features will create, will try to predict the label for a new training example.
So there's typically with machine learning, you're dealing a lot with inputs and outputs
and this kind of thing,
and not so much with human biology and things like that,
although that can get into it.
Okay, fair enough.
All right, so what are the methods?
So you talked about having a model.
So, I mean, you've got to get to that model somehow, right?
It's like get to this objective,
figure out the objective function and take some data.
How do you go about doing that?
Yeah, definitely.
So there's three main methods.
There's supervised learning.
And so the idea with supervised learning, as the name kind of suggests, you have some sort of supervisor.
So imagine if, for example, you know, going back to our Twitter example, Patrick will go to the website and you will either click or not click yeah I might my system might
predict Patrick's going to click on this tweet and then he doesn't right so we
have what's called a residual or an error or my system might predict
Patrick's going to click and he does so we have a confirmation right so
supervised learning is where you're constantly getting this feedback that you can use to fix your model.
And there's many different ways to do supervised learning.
There's gradient descent algorithms. There's a perceptron.
Then there's back propagation, which back propagation is pretty cool.
The idea is you have sort of a set of errors like you told the robot to make a
write and it found out it couldn't make a write so the make a write has an error
and then that causes the things which calculated make a write to have an error
and the things which calculated those to make an error all the way down to maybe
at the bottom you have just sensors and motors and you start learning the errors there and so you can even use things
like back propagation to find you know dead pixels in your robot display or if
the robot wheel breaks machine learning system can pick up on that and so so
that's kind of supervised learning you're constantly getting this feedback
now think about checkers for example when you make a move in checkers
No one pats you on the back or kicks you in the face, right?
No one says that was a terrible move right like what were you thinking that first move was horrendous, right?
checkers you get feedback at the very end and
so
That feedback at the end is called the reward. that's what in general it's called even with
supervised learning but with reinforcement learning you have to estimate the value so
you really need to know that first move was that a good or bad move even though i got no
you know feedback because you can infer it from the feedback i get at the end of the game
so there's a set of techniques for doing this, reinforcement learning. There's temporal difference learning, there's minimax, Monte Carlo
tree search, genetic algorithms, and there's another algorithm called NEAT,
which stands for Neuro Evolution of Augmenting Topologies. Of course. Yeah, so
you can see these in the show notes. There's a ton
of different methods for doing this, but they all kind of are focused on this idea of getting
value from reward. And if you think about it in terms of, let's say you're making a website,
you might want people to say, let's say you're making the next Amazon. You might want people to
buy books from your website. But to do that, to you know get people on your website some of those people will register their credit card some
will fail at that step right some people will go on to like you know some other
part they'll add it to their shopping cart right but but all of these steps
have some value like if you add the book to your shopping cart you're probably
closer to buying it than somebody else. And so knowing how much closer you are is also a reinforcement learning problem. So in the web
domain, there's actually a lot of reinforcement learning. So tell me if I've got an example,
correct. So with the checkers example, if I was trying to train my model to replicate a specific
human player. Okay. So then supervised would say like say like okay what do you think the player
is going to do and then you ask the player to make the move and you say well did you get that
move right or not did you guess the move he said so you're super every step you're saying did you
match what somebody or something did yep so that's called there's actually a specific term for that
it's called heavy and learning is when you have somebody kind of sitting alongside the computer
and you make the computer match that person okay but then unsupervised would say or sorry
reinforcement and learning would say like okay you're gonna do good or bad
win or lose checkers but I don't have a specific human I want you to model I
just want you to win right so you only only for sure thing you're gonna know is
at the very end if you won or lost exact so you've got to come up with your own
metric for how well you're doing in the meantime.
Yep, that's exactly right.
Okay.
So one really cool thing about reinforcement learning is there's something called co-evolution.
And the idea is you can actually have 10 computers.
They can all play each other.
And then they can learn from each other's and their own mistakes.
And in theory, you could use co-volution to make the perfect checkers player.
You know, it would just keep learning by playing itself and playing its opponents.
It would keep, like, making mistakes.
Because if two computers play each other, this gets back to our previous podcast
where we talked about the two grandmasters and you could sit in between them, right?
If two computers play each other, one of them will win and one of them will lose.
And if the one who loses can learn something from its mistake, it will eventually win.
And now the second one will learn something.
If you could follow this process to infinity, then you'd have the world's top player.
There are some caveats to this.
So there's something called the red queen effect where it's
another way of saying is the rock paper scissors effect you can have three computers and just like
rock paper scissors each one can beat another one but there's a cycle those are called like
transitive right yeah just because i beat you and you you beat bob and bob beats me now oh crap like
no no like so me beating you, you beating Bob
doesn't mean I'm better than Bob.
Bob could still beat me
and there's nothing wrong with the universe.
Exactly, exactly.
And so you get into these Red Queen effects
and it actually makes it very hard.
So in practice, co-evolved players
aren't the best players in the world, sadly.
But that's totally possible in theory.
And so that kind of makes that alluring.
So I jumped the gun and I said unsupervised.
Because I said supervised and I was like,
what's not supervised?
Unsupervised.
So what is unsupervised then?
So unsupervised learning, this is actually
pretty hard for me to understand at first.
But it's a little bit simpler.
Another way of thinking
of unsupervised learning is just two things, either clustering or dimensionality reduction.
Sounds awesome.
Yeah, they both sound pretty epic. So, you know, clustering, for example, if you go to,
say, Google News and you look up a news article like the Tesla article that we mentioned a couple weeks ago,
you'll see this article like North Carolina bans Tesla.
And then at the bottom, you'll see 200 similar articles, right?
Well, that's because Google News is doing clustering on all the news articles in the Internet.
And it's saying, okay, all of these news articles are in the same cluster.
Like they're all about Tesla being banned in North Carolina.
So that's an example of clustering.
Dimensionality reduction is, let's say, for example, let's say you're Twitter and you're trying to capture user behavior.
Whether someone is 13 years old or 14 years old, like let's just look at people who are you know providing their ages on their accounts, that might not matter. Like a 13 year old and a
14 year old might behave the same on Twitter, but a 13 year old and a 70 year old definitely don't
behave the same, right? So if you think of every possible age as a dimension, so you know a 13 year old a 14 year old two different
dimensions where you know someone's either in one dimension or the other
some of those dimensions can be collapsed like you can maybe collapse it
down to a preteen teenager young adult middle age and elderly so that's now
you've collapsed what's the oldest person let's So now you've collapsed, what's the oldest person? Let's say 120.
You've collapsed 120 dimensions down to five.
And so that's an unsupervised problem.
So you're just taking user behaviors,
and you're not trying to predict anything.
You're just trying to find out, can I collapse some of this data?
Yeah, it's a form of compression almost.
So like the classic one with image processing, and you kind of mentioned this with the human eye in a way but
like if you have red green and blue for a specific sensor type of activity you're doing but you know
that's a lot of data if you have a full you know 64 by 64 of red 64 by 64 you know there's a big
array of every color but you find out it turns out you're on Mars.
I don't know.
And there's a lot of red, but no blue.
Yeah.
So red and green are really the only things that matter from a high level.
Blue just basically is always the same value all the way across.
So you're kind of wasting data by storing that.
If instead you used all those bits you were using
to store more red and green information,
then you may be better off. Yep. can you kind of reduce those dimension or you just
reduce how much you have to store a process and stay close to the original
you know almost the same amount yeah definitely so so for both of these
these end up being the same problem like yes during dimensionality reduction if
you think about it's a little bit intuitive that you know the same methods
could be used to do
either.
Clustering is basically reducing down to one dimension, right?
So the most common one, and if you make your own Google News site at home, you can use
this.
You can write the code in four or five lines.
It's actually on Wikipedia.
Is k-means clustering.
This is what everybody does the first time they do
some kind of clustering. There's also PCA, which stands for principal components analysis.
That's a little bit more advanced and involves a lot of linear algebra. You have to like
invert a matrix, transpose, some other stuff. So that's pretty heavy. I'm sure you could
find a library to do it if you don't want to tackle that one yourself and then there's a neural gas
which is pretty awesome
I think that was from
World War I right?
No no no, it's mustard gas
Oh, nerd gas
So yeah, neural gas is
basically
a little bit complicated but kind of constructs these neural
networks and uses this force directed clustering to place the neurons.
And, you know, these are kind of an increasing complexity.
So if you need neural gas, you probably are doing something pretty heavy.
Yeah, I feel like I need to write these words you said down and I'll just go Google them.
Yeah, definitely. So this is the kind of episode you want to look at the show notes.
And, you know, Wikipedia is awesome at not only telling you about these like we are,
but also providing some pretty killer illustrations.
I know for Neural Gas, if it's not Wikipedia, it's some other website that's pretty early in the search results.
It actually, you can draw a shape on the screen or some Java applet.
And the Neural Gas, like, will create a model that fits this shape in real time
you'll see all these neurons like going around your shape fitting it's pretty epic yeah i mean
the goal of this episode isn't to allow you tell you what lines of code to write to do these things
but more like you'll have heard these before or you'll know what to look up if you say oh what was
i i have this problem i need to make make two articles and determine if they're like each other or not.
What was that thing Jason said?
It's like, oh, okay, yeah, I've heard that before.
K-means, like, oh, okay, good.
Yeah, definitely.
I mean, at the end of the show, we'll talk about some tools,
some open source tools that will make your life a lot easier.
But, yeah, definitely we don't want to get too specific
because that will just be kind of boring.
Yes.
Those textbooks are boring. Yeah, yeah, exactly that will just be kind of boring. Yes. Those textbooks are boring.
Yeah, yeah.
We would be even more boring.
Yeah.
Because we'd also be doing it wrong.
We'd still have to go read the textbook.
Yeah.
Oh, man.
So there's lots of challenges.
Obviously.
Yeah, I mean, this is definitely not a pure science.
There's a lot of art.
I don't have a robot to clean my house yet.
No.
That's totally, we should make one. That would be so epic that was last episode yeah true okay so one of the
challenges is making an objective function right so let's say you have a website and you have some
way of customizing the color scheme and so you want my your objective function to be every time someone clicks a button
that's good. And if they come to your website
they don't click a button, that's bad.
So the system might learn
make the entire website text
everything the same shade of pink
and just make one button blue.
There's only one thing the user can do
is click this button because everything else is
completely camouflage. So they might, yeah, everyone who comes to your website will can do is click this button because everything else is completely camouflaged.
So they might, yeah, everyone who comes to your website will either leave or, like, click this button.
A lot of people will probably click the button just because they've never seen a crazy website like that, right?
But that, although you maximized your objective function, you clearly, the system didn't do what you wanted, which is make a pleasing website, right?
So would it be able to make the hamster dance website?
I've never seen the hamster dance website i've never seen
the hamster dance website okay sorry anyways that sounds wait describe it sounds pretty epic it's
like rows of little animated gif hamsters singing a little song and dancing in unison what really
it was like very old website it's like is that around the time i saw the prime number pooping
bear have you seen this no it's a bear that poops prime numbers.
That sounds much more intellectual
than what I'm talking about.
Despite a pooping bear being not sounding intellectual,
it's far more intellectual than the Hamster Dance website.
But we're really out of...
So how is this related to A-B testing?
Oh, yeah.
So definitely you want to take your model
once you've trained it, and you want to take your model once you've trained it and you want to
you know give it to some users and see how they interact with it right so AB
testing is where basically you have a new feature it might be a new UI might
be new layout right might be a new model of something you've trained which you
know changes the text or whatever you want to show it to a small group of your users,
and you want to see how their behavior differs
from the control group.
So for example, if you change the color scheme
of your website, you might have two websites
for a short amount of time,
one with the old, one with the new.
If people on the new one are clicking on way more stuff,
that's a good sign that this new color scheme
is the way to go yeah i mean
i think with all of these things we talked about like and i guess it falls good under challenges
right it's like it's hard like no matter what the model says doesn't mean it's going to be right
yeah so like we talked about the stocks again like it's a good thing right just because it shows it's
made money in the past you may have made a flaw or just maybe like it's not i don't know it's not
up to scruff it's not good enough right know it's not up to scrub it's not good
enough right so you know that you can end up when you try it in the real world you don't want to
just push it out to everybody you don't want to put all your i wish i had a million dollars all
your million dollars in the algorithm on the first day right like that would be silly because you may
have messed something up yeah yeah exactly yeah so exactly. Yeah, so same thing. You all just let your algorithm push live
the all pink and one blue button thing.
Sure, maybe performance goes up really fast initially
and then people never come back to your website
because they don't understand what's going on.
Yeah, actually that gets a really interesting point,
which is your objective function often captures
something that is very short term.
Like, as we mentioned, people clicking on your website.
It's often something that's very instant.
And it has to be.
Otherwise, you wouldn't be able to train a model on it.
So you have to sort of balance what the model says with your actual business.
You might not want people to click on your ads as often as you could, as they could. Like, if you had the system just say, okay, I want people to click on ads.
Like, when they click, I want the percentage of clicks on ads to be high.
So the system, if you gave it total freedom, would make one ad that was the entire page,
and everyone who clicked anywhere on the page clicked on the ad.
But that ruins, as you mentioned, the long-term value of your
website. And capturing things like long-term value, user retention, in an objective function
are extremely difficult. So most of the time, you're sort of balancing the model and the
objective function with what you really want as a developer. So that could be a challenge.
The way you described it is really interesting because I think a lot of times there's,
people tend to think about artificial intelligence, machine learning,
they think as like a very like research PhD thing, like trying to build the next humanoid.
You know, we talked about like RoboCup, you know, DARPA Grand Challenge.
We talked about these things in the last episode.
And I think people tend to think about those kinds of things,
but they forget, like you're saying,
you can use this machine learning stuff
to help drive traffic on your website at some level
or determine what you should do as opposed to just guessing.
And maybe not a single guy website.
That's probably not the wisest use of time unless he really enjoys it.
But if you get to a certain size website,
you really can take advantage of this data if you know what you're doing. Yeah, definitely. I mean,
I'm sure a lot of you listeners are familiar with Google Analytics. So it's a product where you can
put some JavaScript on your website and you can actually see what's called the user funnel. So
you can see people come into your website. You know, 100% of the users visit your website a hundred percent of users who visit visit of that hundred percent some people click on
links some people leave right and you can actually see the user funnel like
who does what clicks on links and the long tail like who stays on your website
for a really long time etc and now they you know you've heard us talk you know
that that is a reinforcement learning problem right you want somebody visits your website for the first time
you know they click they're a little bit of reward because you know they're on
your website for longer for clicking but there's also potential long-term value
right I mean just because you know if they click on one link versus another
that second link might get clicked on more often than the first but the first
might lead to many other clicks or if you're on YouTube for example one video
might be like funny fail video and it's all people falling off slides and that
might you know people might watch a video but another video might be part
one of how to cook and people might watch part one through 1,000 right watch
a ton of videos as a result of that one so even though. And people might watch part one through 1000, right? Watch a ton of videos
as a result of that one. So even though someone more people might want to watch a fail video,
it still might be better long term value to watch part one of the cooking video. So now
you can start to see how reinforcement learning, supervised, unsupervised learning sort of
play a role even in modern day businesses. Another big challenge is what's called
training serving SKU. So this is a little bit hard to explain but basically you
know let's say let's say you're collecting data and let's say you're
using people's ages for example. It's very often that there's a bug somewhere in the system. So for example,
when I collect everyone's ages and give it to the model, I'm doing it correctly. But then when I
try and score the next people who visit the website, their ages are off by a factor of two
because of some divide by two error somewhere in the system. So the machine learning algorithm
isn't going to tell you
like, hey, you have a bug, these ages are half
of what I expect them to be.
It's going to act literally like those ages are half
and it's gonna treat everybody like a child.
And it's not obvious that there is a bug in your system.
So there's many ways of dealing with this.
One way to deal with it is to, you know, look at the results.
So eventually, you know, if I show Patrick a Twitter tweet and he clicks or doesn't click,
that will become part of my training data. Like once you take that action, I'm saying
you as Patrick, once Patrick either clicks or doesn't, that ceases to become serving.
I've already served that choice to him,
and now he's taking it and actually becomes training.
So if I keep my score from there and pass it forward,
I can see, like, oh, I thought 90% chance Patrick is going to click,
but now at training time I see that there's a 3% chance.
So something is buggy in the system you
know in general there can be bugs are very hard to isolate. Some other
challenges another big challenge is just many of the problems or many of the
algorithms are linear like as we mentioned PCA is linear gradient descent
is linear or can be.
Perceptrons are linear.
When I say linear, what it means is each feature will get a score,
and then all those scores will be added together.
So in other words, you know, Patrick is an adult,
so adults will click on tweets X percent of the time, and children will click on tweets Y percent of the time.
Maybe Patrick's also a male.
Males will click Z percent of the time.
Wait, maybe also a male?
No, Patrick's definitely a male.
And males click Z percent of the time.
And then it just takes all these features and all the percents and basically adds them up.
That's a linear system.
So some things just aren't linear.
Like, for example, 20 year
olds don't click on tweets twice as much as 10 year olds, or at least that's not obvious. Or
100 year olds don't click 10 times as much as 10 year olds, right? So dealing with linearizing the
data and, you know, separating, yeah, maybe age instead of being one number from one to a hundred.
It's actually a hundred numbers, either zero or one.
So somebody age 13, somebody age 14, those are just completely different numbers.
That's not obvious.
So there's a lot of modeling tricks.
And if you go into what's called feature engineering, if you look into this,
there's many different tricks that you can do to sort of make your models easier to learn and so
to deal with this underfitting problem. So and finally there are kernels. So you know in the
case of age, you know that being a teenager and being preteen and being adult like you just
you're you're as a human being you know that there's sort of like a fundamental
difference yeah like when you are a teenager you're in high school and you
have a different let's say mindset and when you're an adult and you're in
college or working right so you that's not something that you want the machine
to learn that's something that you just know about humanity and you can put that in directly. You can say, you know, is this person in the age bracket,
you know, 13 to 18 or not, just based on what you know of the world. And those are called kernels.
It gets a little bit more complicated than that. There's kernel functions and all this stuff, but
in a nutshell, that's kind of what it is, is you taking some part of the problem that you know as a human and applying it to the machine.
Interesting. Interesting.
Yeah, those are the basic challenges.
So we have some tools to help us, some things you can look into maybe to help you out.
So one of those we haven't talked about, but natural language processing.
And so that would be like, I want to understand not just like okay i see there are
words here but what do they they really mean like i want to say this is a verb and this is a noun so
in this sentence so think about like last episode man i guess people really should have listened to
last episode we talked about a chat bot right so like in a chat bot you want to recognize the noun
of the sentence because you want to repeat the noun back to the person so you know
you want to process that language or you know it could even include things up to like you know
sentiment analysis or whatever like is the person happy or sad or angry or feeling good you know are
you are itunes comments mostly positive or mostly negative so it's got a star rating but people are
you know saying bad things also.
So like that's kind of,
they're using bad language.
Like, okay.
You could combine,
well, you go ahead and finish.
No, no, no.
So one of the,
there's actually a lot of packages
that do it,
but one of them is Open in LP.
So by Apache.
So don't,
if you find yourself doing this,
don't like code it yourself.
Like don't say like,
I'm going to figure out how to do this.
Like go find somebody else who already did this. You know, and at least, even if you don't like code it yourself like don't say like i'm gonna figure out how to do this like go find somebody else who already did this um you know and at least even if you don't use it for
the full algorithmic part of it like at least use it for like the basic parts like segmenting what
part of this sentence is a noun and what part's a verb and you know helping you with those kinds
of things because you're going to be a lot farther along the path of getting to the interesting parts
yeah you do interesting things like we could take the ratings that we got on iTunes and say, OK,
people who use more verbs than nouns, did they give us lower stars?
You know, things like that. And so there's a lot of interesting stuff.
Well, you could like monitor over time, like our star ratings not dropping yet,
but people are using less positive language to describe us
then like maybe we should be concerned even before the stars start dropping yeah exactly so don't try
this but like yeah like that's one thing right or if you ever go on amazon sometimes it's confusing
right like it's hard for me i look at the reviews and they're like low stars but the people are
saying stupid stuff right and it's like okay i don't want you know if you could somehow find like
oh i came up with an idea of how to tell that people are saying good things, but giving low star ratings.
Like, weight those differently than people who are both giving a high star rating and, you know, really positive feedback.
Yeah, definitely.
I mean, you could combine OpenNLP with like a supervised method.
Yeah, hi, Amazon has the, you know, X people found this review helpful you could find certain words or phrases which are indicative of a helpful review before the person has
even posted it yeah you can do all sorts of fun stuff we estimate this
percentage of people will find this helpful yeah your comment is not helpful please do not post it
so there's minor two sort of lower level things.
One is Mason.
I'll cover this one kind of loosely because it's a little bit more academic.
But it has a whole cornucopia of different evolutionary computation algorithms.
But another one, which I'll spend a little bit more time on, is Apache Mahoot.
Mahoot?
Mahoot.
I don't know what it is. Is it Mahoot?
I think it's like an Indian word or something, isn't it?
That's okay.
I'll look it up and you can continue.
But yeah, Apache Mahoot.
We talked about Hadoop.
A person who rides an elephant.
Oh, there we go.
So we talked about Hadoop in the past, which is a way to deal with massive amounts of data.
And Mahoot is a machine learning system built on top of Hadoop in the past, which is a way to deal with massive amounts of data. And Mahoot is a machine learning system built on top of Hadoop.
So if you have, say, the whole internet or a ton of data, like every time someone visits
your website and moves their mouse or does anything, you're collecting that data and
you have terabytes and terabytes of data, you want to be using Apache Mahoot.
And it's pretty awesome.
Actually, a number of people I know are contributors to this project.
And the people who contribute to Mahout, it's definitely really well done.
It's done by a bunch of really smart people.
That's because it's you and your friends?
Well, it's not me.
I haven't contributed yet.
But it's a phenomenal library. I't contributed yet. But it's a phenomenal library.
I have used it. And it's great. I highly recommend using Mahoot. And another thing about Mahoot,
a lot of companies are using it. So it's something that if you get familiar with,
you could apply it in industry like almost immediately. Yeah, and we talked about it
before. But like, and this is much more in machine learning probably than in artificial intelligence although the two are kind of closely tied i guess but you know this
big data thing you always hear about right like i mean a lot of that is ultimately walmart wants
to collect all this data about how much people are buying you know based on what input parameters
and they just want to measure everything because they don't know what's useful or not but then it's not just a simple problem of like what machine algorithm
learning what what machine learning algorithm to apply but like actually doing it right so even
like you know my role like i don't do a lot of actual ai or machine learning stuff per se that
that's not my job but i help the people who do because i go ahead and do a lot of the number
crunching and scalable processing that implements what they do so they say hey i came up with this
thing or i want to do this model but the data is not in a good format or it's too much so i'll go
in and help them like reduce that data you know make sense of that data a little bit better so
that they have an easier time and so even if you don't say, well, you know, I don't think I'm going to end up, you know, being a machine learning person
or, you know, I don't feel like that stuff's interesting to me.
There's still a lot of interesting work to help those people out.
You can work with those people, you know, and help them,
and it's still not, you know, you're not doing it yourself.
But it's good to know, like, that this is why they're doing that thing
or this is what they mean when they say they're making a model.
Yep.
One cool thing, too, about Mahout is they have tutorials,
and the tutorials actually let you do stuff that matters.
They actually have a tutorial where they've given,
they've scraped the Internet of a bunch of news articles,
and in the tutorial you'll actually classify the news articles
into sports and some other clusters.
You make me want to go do this. this yeah you will actually have something tangible if you
go through their tutorial which is not very common maybe I'll just stick with
processing it it's pretty awesome highly recommend you guys checking it out I
would like to learn more about that I guess is like a very broad subject like
you could spend your whole career learning any just one of these things and
that being your thing yeah definitely so but there's something to be said too for learning
when not to apply something yeah so sometimes i think and maybe that's like what we've learned
today on this show no no just like today versus like in the past is like learning restraint
yeah that like it's not necessarily true that artificial intelligence and machine learning
will solve every problem today you know or like throwing it at it's not necessarily true that artificial intelligence and machine learning will solve every
problem today.
You know or like
throwing it at it
isn't necessarily the
right answer.
It's not a silver
bullet or a magic
bullet.
Right.
It's another tool in
the tool bag like we
talk about programming
languages are also
tools in the tool bag.
Yeah.
So it comes full
circle.
Well I think that's it
for this episode.
Yeah.
Some pretty heavy
stuff.
We're going to try and
cover a language.
It's been a little while since we've done that.
So we'll cover a language next episode.
English.
I think we can both cover that sufficiently.
Okay, good.
I've been coding in English for a long time.
I don't know about that.
I've been speaking English for a long time.
Oh, they're not the same?
I'm not sure.
Anyways, before we bore you guys, if we haven't watched it already,
thanks for sticking with it
and have a good one
alright see you later
the intro music is
Axo by Binar Pilot
programming throwdown
is distributed under
a creative commons
attribution
share alike
2.0 license
you're free to
share, copy, distribute
transmit the work
to remix
adapt the work
but you must provide
attribution
to Patrick and I
and share alike
in kind