Placeholder Image

字幕表 動画を再生する

  • All right, everybody.

  • My name is Militia Mc Gregor, and I'm a senior U engineer right now, But in a past life, I used to be a mechanical and aerospace engineer, which is how we get to using machine learning to improve u r u ex roundabout ways.

  • So the goal of this is to make our Skynet future more user friendly.

  • So I like to give a quick overview of what I'm going to talk about before we get into it.

  • So, first, how many have you all know about neural networks?

  • Like how they work?

  • Oh, yes.

  • Okay.

  • How many people have heard of Brain Js?

  • That's more than I've seen ever.

  • So great.

  • Is Charlie here?

  • Oh, yes, I know in us you'll get to see why I asked later.

  • So then we'll get into more of like how you actually do machine learning.

  • So we'll talk about choosing features to use how you actually train a model tow, understand our wonky user behavior and how you actually use a machine learning model to make updates to your dump.

  • And at the end, of course, there's some little takeaways.

  • So just to get you kind of warmed up and started with neural networks.

  • A neural network is basically a math equation that makes predictions.

  • You put in stuff, you get out stuff.

  • So one thing that I think personally, machine learning has a really bad Um, I guess thing with is jargon.

  • So I'm hoping to break some of that for you guys.

  • So a neural network is basically just a brain made of layers of notes.

  • And this is what I know.

  • It looks like so you have as many inputs as you want.

  • You assigned those inputs a certain weight to give them like, uh, say so you give them a weight so that they know which input has more value to the prediction you're trying to make, and then you run it through some crazy math equation that a lot of people don't really want to know about, and then you get a predictive value or values.

  • So another thing that comes up a lot in machine learning is deep learning.

  • It's so scary and fancy.

  • But the only thing that deep learning means is that there are more than one node in your neural network, so you can have two nodes, and you have a deep learning model.

  • Oh, you can have three notes, and it's super deep.

  • So some of the places that you might see neural networks in the wild would be with, like, predicting user into So your user clicks on a button or a certain part of the screen, and you have certain content over there.

  • That means that that user is probably interested in whatever you're showing them that they keep hovering over clicking on.

  • And based on that fact, you can make adjustments to what the content is.

  • You can change the jargon or the language around it.

  • You can even throw in means if you want to, just based on the inputs that you get from your user and something else you can do to help.

  • Our Skynet future is to make personalized interfaces.

  • So let's say that you have this large dentist data set of user behaviors, and it shows you that on Tuesdays at 305 p.

  • M.

  • All of your users are drinking.

  • Ramos is so you might want to throw in something that's maybe orange or something that might not have slipped through their more sober mines.

  • And then, of course, you can always use machine learning to find areas of improvement.

  • So when you get all of your user data, you can take that and look at some of the problem areas they have.

  • So maybe you're trying to increase conversion rates or you're trying to get more people to come to your website or you just want more people.

  • I spend money on your website.

  • Whatever it is, you can take your user behavior data and skim it for any type of behavior that you're trying to make them do.

  • So basically, neural networks in the wild are a way to kind of implant little ticks into our users so that they don't have to worry about as much.

  • It just does stuff for him, and that's what all users want.

  • And that's what we want so that they don't break our stuff.

  • So going to talk about brain Js for a little bit?

  • It is another JavaScript machine learning library, and I deliberately chose this over tensorflow awhile back.

  • Um, when I try to learn tensorflow Js, it confused the absolute crap out of me.

  • So I found branches and it's so much easier to use.

  • How many people know howto work with objects, arrays, objects with the rays and a raise of objects.

  • Then you can do machine learning.

  • So one of the best things about brain Js if you aren't as interested in getting into like the mathematical stuff or you don't really wanna dig too deep into machine learning, you just want to say, Hey, have this data and I need a prediction.

  • This is a really good library to do that with just because objects and the rays are really easy to work with.

  • And again the tutorials air really straightforward.

  • They get you up and running pretty much from square one so you can start using sequential models.

  • You can use some R and ends is just all built in for you.

  • And I don't have anything to do with brain Js.

  • I'm just a little bit of a fan girl for it, so just throw that out there so we'll get into the best part choosing your features.

  • So features are basically the data points that you're trying to collect from users or from whatever other hardware systems you have.

  • But for this talk, in particular, were focused on Are you are you ex.

  • So one of the biggest questions you have to ask is what is gonna add the most value for a user?

  • I know a lot of us find these new tech tools and we're like, Oh, my gosh, this is so cool.

  • And then we start throwing stuff into the application that really doesn't do anything for the user.

  • So make sure that when you're looking or those data points you're trying to get from your user that the prediction you get from that data will add value to the user.

  • Then you have to figure out how you're going to get that information.

  • Are you gonna hook him up to some kind of e g sensor and monitor brain waves?

  • Are you gonna hack into the webcam and watch them do whatever people do are Are you just going to get like, some mouse inputs or soon information from input boxes?

  • Probably the 2nd 1 hopefully and then another thing that a lot of machine learning projects lose sight off at some point is what exactly are you trying to predict?

  • So you have all of this data, you have terabytes of data and you like it's machine learning.

  • We need to use that.

  • Okay, What are you trying to do with it?

  • So make sure that you actually know what you're trying to predict before you just dive into data analysis.

  • And then this is my favorite.

  • Well, anybody care if you make this update, so yeah, it's cool to use machine learning and stuff.

  • It has this applications.

  • But at the end of the day, if your users don't care, was it really a successful project?

  • Just something new ponder about.

  • So this is the fun part we're going to get into actually training a model, tow, understand user behavior.

  • And I have code in a demo that is supposed to be running right now.

  • It worked a few minutes ago, which is why this is commented out instead of deleted.

  • Okay, Can you guys see that?

  • Okay.

  • And we can ignore the comet for now, but anyways, we're gonna go into the back in.

  • So this is one of the ways you can create a machine learning model using know Js with the brain Js library and basically what we do, The main things.

  • I mean, how many of you are back into engineers or full stack.

  • Okay, that's fine.

  • If everybody knows about node in service than so pretty much, the only thing you really need to do is import this brain Js library in blah, blah, blah.

  • Okay, so now this is the fun part.

  • So this is our training data for the neural network model.

  • And it's very small because I made up all of these values, you know, demo day to sit.

  • But basically, what we're doing is we are going to make this you I interface that it kind of bothers people who might be trying to hack our website.

  • So based on what they type into our input box, there's certain things that a normal user wouldn't like.

  • I don't expect to use her to type in something like having or group or select, especially in any type of combination.

  • So based on these values, which you see, it's an array of objects, and down here, that is our input data.

  • So this is what we are saying that hey, if you see any of these inputs, we're going to use them to predict if our user is malicious or not.

  • So basically, if they use any of these words or terms, it assigns a maliciousness rating and that is our output data.

  • So the way the machine learning model works is that you have to have a training input, data set and training output data set because machines aren't people, they don't really fill in the blanks yet.

  • So what we're doing is called supervised machine learning, and that's just where you tell it.

  • Hey, if you see this combination of things, you can expect it to me.

  • This and that's how we teach our model to make predictions based off of inputs.

  • So basically, we're gonna use these to data sets to train our model, which is incredibly easy.

  • So little little junkie nous here again, I wanted to make sure this actually worked this morning.

  • So what we're doing here is just combining the input and output data into a single.

  • I think this is an object object oil.

  • But if we combine it into a single entity and we do that because that's how the brain Js library works and Tada, this is how you make a neural network.

  • This one line right here you have a neural network and basically we just kept it really simple and wit with the neural network.

  • So there's like recursive neural networks.

  • There's some other crazy things you can use, but this is easy, and we gave it three hidden layers.

  • What that means is that basically, we give it the inputs.

  • Those inputs have weights, and then the model takes over.

  • And it's like this combination of inputs equals this, and it just pushes it through to the prediction.

  • So hidden layers are good when you need more accuracy.

  • But remember that you don't want too many because it'll slow your results down.

  • It'll it'll just be really, really slow.

  • You don't want that when you run in the server that people are hitting, you know, millions of times a day.

  • What?

  • This is the best part.

  • So you see this?

  • This is how you train a neural network, One function call, and we have our model mate.

  • That is it brain just easy.

  • So we have our model made, and now all we have to do is make predictions, and the way we're going to do that is we're going to use our model to make updates to the Dom based on some of the inputs that our users put it.

  • Okay, Deep breath.

  • Still time.

  • So, hopefully this work first, though, how many of y'all have heard of slips?

  • Um, yes, there's a couple people, but okay, this alarm, it's my wife.

  • I disconnected, but you should definitely Google slips.

  • Um, I don't know why my wife I disconnected, but such is life when a V stuff happens.

  • But just to show you kind of what it would look like if you start typing in words, you kind of notice the colors change and you see, my maliciousness rating is definitely pretty up there.

  • You really don't want people to be able to type this in, so you probably have some kind of security blocks on the back end, and that's cool.

  • But why not start messing up the user interface for somebody trying to type it in?

  • It comes from that principle.

  • Have you guys seeing the bootleg video games where they start really messing up?

  • The deeper you get into Okay, okay, is basically the same concept.

  • You just make it difficult for them to keep trying to hack you, even though you already have all of your back insecure in your data basing.

  • Nobody's using admin at me, so you're good to go.

  • But the way that we do this is on the front end.

  • We have a very small piece of code somewhere in here somewhere.

  • Yes, here we go.

  • So basically what we're doing here is we get the input from the user.

  • We send it to our back end.

  • It goes through our machine learning model right here.

  • And what it's looking for is going to split up all of the words that the user's typed into the box, and it's going to make a new training input data set.

  • So instead of our original, which was just some made up stuff to set the base for our model, we actually have real data.

  • Now.

  • It's wonderful, but all that's happening here is we are signing some kind of value to it, and we rerun the model.

  • So this line right here is it.

  • This is how you get a predictive value from a machine learning algorithm.

  • You do another function call.

  • That's it.

  • It's pretty great.

  • But back on the front, we get that function we call that function, it passes the data back, and then we start to mess with our user.

  • So this is where I like to ask you guys.

  • What do you want to change on the screen when somebody tries to hack you?

  • Do you want it to like at a style where they can type in any more?

  • Do you want it to move everything around doing live coding here?

  • So what do you guys want to see today?

  • Comic sense?

  • Um, I couldn't hear a lot off, but I think comic sense might be it.

  • So we'll just do something simple.

  • I think I have that in stock to font family.

  • Let's see if that's actually gonna work and it's still running.

  • Okay, Still running just so let's see if it's gonna do comic sense.

  • Hopefully, I can't tell if that change you guys.

  • One thinks.

  • I don't think it changed it to comic sense, but basically, I think you kind of get the idea here that you can pretty much wreck someone's day just with machine learning and you are you eggs.

  • But on the flip side of that, see if the other demo is running, I think it might actually work.

  • It's always nerve wracking when you get up here, and it's like I think my demo works.

  • I don't click on stupid stuff, Okay, so this time, instead of us, you know, making life hard for the user One of the things we're going to try to do is make it easier.

  • But I will throw in a caveat.

  • This is just a fun thing.

  • You should probably never make live updates to your you how you x when a user is actively using it, you don't really want buttons and things to move around.

  • Just don't run that after.

  • But basically when a user types in something, so tell me something good in Hawaii, huh?

  • No, of course, one of them wouldn't work, but that's that's fine.

  • We roll with it, but anyways, not going to stand up here and try to debunk that all morning for you guys.

  • But basically what that one was supposed to do is as a user types, it starts to pick up kind of their sentiment on how they feel today.

  • And based on that, it'll either brother color of the screen to like a yellow because they're really sad and they need some sunshine in their lives, or it'll darken it a little bit because they're a little bit too happy and need to bring it down.

  • But, um, that is pretty much it for the code side.

  • Really glad At least one out of two worked, so I will go ahead and wrap up.

  • So the key takeaways try to find uncommon ways to implement machine learning.

  • So one of the other projects that I worked on with machine learning is like this e e g sensor that picks up brain waves, and you can use it to control stuff like real life stuff like drones and freaking robots that climb up the wall just from your brain signals.

  • It's awesome, and it uses JavaScript and then use brain Js because tensorflow J esus really difficult for no reason.

  • And, of course, one of our goals is toe always improve.

  • Ru i n u ex.

  • But try to think about how you could use your data to improve the U I u X on an individual level.

  • So one of the things you can do is get just this large data storage factory of user data and say, Hey, I think I want to see if my users will actually buy stuff on this day in this country At this time when the weather is like this machine learning is that powerful, and you can get those predictions.

  • Just don't jump into buying a lot of data before you actually know what you want to use it for.

  • Because a lot of companies have done that and been their machine learning stuff.

  • Didn't if the many results.

  • So just some takeaways.

  • Um, yeah, that's it for me.

All right, everybody.

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

A2 初級

機械学習を使ってUI/UXを改善する - Milecia McGregor|JSConf Hawaii 2020 (Using Machine Learning to Improve UI/UX - Milecia McGregor | JSConf Hawaii 2020)

  • 5 1
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語