PowerBI: Train a Machine Learning Model for Predictive Maintenance

00:14:31
https://www.youtube.com/watch?v=n6lAPyp9gfA

Ringkasan

TLDRThis video tutorial explains how to create and use a machine learning model in Power BI for predicting machine maintenance needs. Utilizing a dataset comprising transaction IDs, machine types, environmental factors, and machine usage data, the tutorial guides through uploading data to Power BI, configuring a data flow, and using the Power Query Editor. A regression model is selected to predict the mean time to failure, excluding transaction IDs to avoid bias. The data is divided into training and validation sets, and the model is trained accordingly. Once trained, the results show an 82% explanation rate for the variance in data, emphasizing that usage significantly impacts prediction accuracy. The video highlights the application of the trained model to new data and addresses potential connection issues when updating datasets. Further guidance is offered on how premium capacity is necessary for such machine learning capabilities in Power BI, along with suggestions on integrating other machine learning models like Azure ML. The tutorial concludes by exemplifying predictive maintenance scheduling with machine learning outcomes.

Takeaways

  • 📊 You can train machine learning models directly in Power BI for predictive maintenance.
  • 🛠️ Power BI supports regression modeling to predict machine failure times.
  • 🔥 Important variables include machine type, usage, and environmental conditions.
  • 🔄 Data is split into training and validation sets to ensure accurate modeling.
  • 🏷️ Premium capacity in Power BI is required for machine learning functionalities.
  • 🤖 Power BI can integrate with other technologies like Azure ML for advanced modeling.
  • 🚫 Avoid overfitting by not using identifiers like transaction IDs in training.
  • 📉 The regression model explained 82% of data variance, reflecting strong prediction capability.
  • 🛡️ Predictive models can help in scheduling maintenance before failure occurs.
  • 🔗 Check data connections to avoid errors when uploading new data.
  • 💡 Visualizing model predictions can guide maintenance scheduling decisions.

Garis waktu

  • 00:00:00 - 00:05:00

    The video starts with an introduction to training and using a machine learning model in Power BI using a demo dataset related to machine maintenance. The dataset includes columns such as transaction ID, machine type, temperature and humidity at breakdown time, machine age, site location, quantity produced, and the number of days the machine was operational until it needed fixing. The objective is to predict the 'mean time to failure' using this data. The presenter uploads the dataset into Power BI, creating a new table using an Excel document. After uploading, the data is prepared in Power Query Editor for further processing.

  • 00:05:00 - 00:14:31

    Once the data is available in Power BI, the presenter moves on to splitting the data into training and validation datasets. The regression model is chosen for prediction purposes. After training the model, the video demonstrates checking the model's performance report. The report reveals that 82% of the variation can be explained by the model. After preparing a sample prediction dataset, the presenter uploads it into Power BI, applies the trained machine learning model, and explores the prediction results. Finally, the video showcases how predictive maintenance can be scheduled using the model’s predictions. The video concludes by encouraging viewers to explore more complex integrations in Power BI with Azure ML models if desired.

Peta Pikiran

Video Tanya Jawab

  • What is the main purpose of the machine learning model in the video?

    The main purpose is to predict how long a machine will operate before it needs maintenance.

  • What data is used to train the model?

    Demo dataset based on machine maintenance data, including transaction ID, machine type, temperature, humidity, machine age, location, quantity produced, and days in use before maintenance.

  • What type of machine learning model is used in Power BI?

    A regression model is used to predict the mean time to failure of machines.

  • How is the data structured for training the model?

    The data is split into training and validation datasets; the training data is used to build the model, while the validation data assesses its accuracy.

  • Can Power BI models support other types beyond regression?

    Yes, Power BI supports other types like classification models.

  • What is the key metric for assessing the machine learning model’s performance?

    The model's performance is mainly assessed by how well it explains the data's variance, demonstrated by an 82% explanation rate in this example.

  • What platform capacity is needed to use machine learning in Power BI?

    A premium capacity or a premium per user license is required to use machine learning in Power BI.

  • Is it possible to integrate machine learning models from other technologies into Power BI?

    Yes, models from technologies like Azure ML can be integrated into Power BI.

Lihat lebih banyak ringkasan video

Dapatkan akses instan ke ringkasan video YouTube gratis yang didukung oleh AI!
Teks
en
Gulir Otomatis:
  • 00:00:01
    welcome to this short video on how to
  • 00:00:03
    train and use a machine learning model
  • 00:00:05
    in power bi
  • 00:00:06
    today I want to show you how you can
  • 00:00:09
    train a model
  • 00:00:10
    and I'm using here demo data set
  • 00:00:13
    based on some maintenance data for
  • 00:00:16
    machines
  • 00:00:17
    so we have here in the first world
  • 00:00:19
    transaction ID which comes from a
  • 00:00:22
    backend system we have the type of
  • 00:00:24
    machine we have a temperature in degrees
  • 00:00:28
    celsius when the machine broke down so
  • 00:00:30
    humidity
  • 00:00:32
    in percent when the machine broke down
  • 00:00:34
    the edge of the machine is a site where
  • 00:00:37
    the machine is located
  • 00:00:39
    the quantity that was produced using
  • 00:00:42
    this machine and finally we have this
  • 00:00:46
    column here the last one that tells us
  • 00:00:48
    how many days this machine was in use
  • 00:00:52
    until it has to be fixed
  • 00:00:54
    and what I wanted to do with my model is
  • 00:00:56
    to predict this column here so based on
  • 00:01:00
    this data I want to predict how long a
  • 00:01:04
    machine will be operated will be for it
  • 00:01:07
    breaks down
  • 00:01:10
    so the first thing what I have to do is
  • 00:01:12
    to upload this document here to power bi
  • 00:01:17
    so I'm switching to my power bi
  • 00:01:19
    workspace
  • 00:01:20
    and from my power bi workspace I am
  • 00:01:23
    using a data flow
  • 00:01:26
    I'm going to close this document
  • 00:01:32
    and I want to create a new table
  • 00:01:36
    I'm using Excel document in real life
  • 00:01:39
    you may use a data lake or whatever
  • 00:01:42
    but I'm using here this Excel and I'm
  • 00:01:46
    going to upload my Excel document
  • 00:01:49
    going to upload this training data here
  • 00:01:52
    that has some
  • 00:01:54
    megabytes takes a few seconds
  • 00:02:01
    and click on next
  • 00:02:04
    and this will open the power query
  • 00:02:07
    editor for me
  • 00:02:12
    so we here in the power query editor and
  • 00:02:16
    I have this table here that I have
  • 00:02:18
    showed you maintenance table with these
  • 00:02:22
    columns transaction type temperature
  • 00:02:25
    humidity each side quantity and mean
  • 00:02:28
    time to failure
  • 00:02:30
    and I'm going to load this
  • 00:02:33
    into Power bi
  • 00:02:39
    so this will be called maintenance
  • 00:02:43
    and I click on Save and close
  • 00:02:47
    and now the data will be loaded I'm
  • 00:02:50
    going to call on the flow ml for machine
  • 00:02:54
    learning
  • 00:02:56
    mttf
  • 00:02:58
    meter failure
  • 00:03:00
    and Save
  • 00:03:04
    and reflush the flow
  • 00:03:08
    so nothing special
  • 00:03:11
    until here and once uh refresh is done
  • 00:03:15
    now I can click on this brain button
  • 00:03:18
    here
  • 00:03:20
    and this will offer me to create a new
  • 00:03:23
    machine learning model
  • 00:03:24
    and the table I'm using is the only
  • 00:03:27
    table I have at the moment that's a
  • 00:03:28
    maintenance and I want to predict the
  • 00:03:31
    mean time to failure
  • 00:03:34
    click on next
  • 00:03:44
    now I can choose a type of model in this
  • 00:03:49
    case it can only use a regression model
  • 00:03:52
    but Power bi supports different types of
  • 00:03:55
    model for example classification if you
  • 00:03:57
    want to create the classification model
  • 00:03:59
    but I'm going here with a requestion
  • 00:04:01
    model
  • 00:04:02
    and click next
  • 00:04:04
    I don't want to use the transaction ID
  • 00:04:07
    because this is just the unique D for
  • 00:04:09
    each row and I'm suggested to use the
  • 00:04:13
    type humidity age and the commodity
  • 00:04:16
    and you can choose to also use for
  • 00:04:18
    example the site where the machine is
  • 00:04:20
    located if you think this is a good idea
  • 00:04:23
    click on next and now we have to give it
  • 00:04:27
    a name I call it let's say
  • 00:04:30
    ml mttf
  • 00:04:33
    model
  • 00:04:34
    and it asked me how long I want to train
  • 00:04:37
    it it will not take 120 minutes because
  • 00:04:40
    this is a very small data set with only
  • 00:04:43
    a few euros and you should also be aware
  • 00:04:45
    that you don't want to train your model
  • 00:04:47
    too hard against the training data but
  • 00:04:50
    you want to train your model to identify
  • 00:04:53
    patterns
  • 00:04:55
    so I'm clicking here on Save and train
  • 00:05:00
    and what happens is that powerapper is
  • 00:05:02
    splitting our data into two parts
  • 00:05:06
    we have a training data and we have a
  • 00:05:08
    validation data the training date is
  • 00:05:11
    used to train the model and the
  • 00:05:14
    validation data
  • 00:05:15
    is used to validate how good the
  • 00:05:18
    prediction is
  • 00:05:19
    not this will take a few moments or
  • 00:05:23
    minutes depending on your model to train
  • 00:05:26
    this data
  • 00:05:27
    I'm going to pause this video and start
  • 00:05:30
    when the training is finished
  • 00:05:36
    we Apex model has finished training
  • 00:05:40
    so let's have a look
  • 00:05:45
    and as you can see we have this
  • 00:05:47
    maintenance table here as a training and
  • 00:05:50
    suggesting data and let's switch to
  • 00:05:52
    machine learning models as you can see
  • 00:05:54
    we have this model here and we can also
  • 00:05:58
    view it's a training report
  • 00:06:00
    and this will tell us
  • 00:06:02
    how good this model is based on the data
  • 00:06:06
    that was separated for validation
  • 00:06:09
    so this takes a few seconds
  • 00:06:11
    to generate the report about the model
  • 00:06:14
    performance
  • 00:06:15
    what we will see is a percentage how
  • 00:06:19
    good the variation the model can be
  • 00:06:21
    explained based on the data we provided
  • 00:06:25
    and some info about services and top
  • 00:06:29
    protectors
  • 00:06:34
    and here it is
  • 00:06:37
    it says that 82 percent of the variation
  • 00:06:40
    can be explained
  • 00:06:42
    and when we look at the top protectors
  • 00:06:44
    its quantity is a type of the machine
  • 00:06:47
    and sense age but most important is how
  • 00:06:51
    much the machine has been used which
  • 00:06:54
    will explain the mean time to fill up
  • 00:06:58
    so now that we have this machine
  • 00:07:00
    learning model it would be nice to apply
  • 00:07:03
    this model to some data and I have
  • 00:07:06
    prepared some
  • 00:07:07
    data for our prediction here
  • 00:07:11
    so I have a transaction ID I have a type
  • 00:07:14
    a temperature humidity I have the H of
  • 00:07:18
    the machines aside and the quantity and
  • 00:07:21
    what I would like to see is a mean time
  • 00:07:23
    to failure that the machine model thinks
  • 00:07:26
    it will take to break the machine and I
  • 00:07:31
    want to combine these two
  • 00:07:34
    so back to Power bi
  • 00:07:37
    modern now wants to do is to switch to
  • 00:07:40
    tables and to upload my data that I want
  • 00:07:44
    to apply so I'm going to add stable and
  • 00:07:49
    again because it's an Excel file
  • 00:07:51
    I will upload this Excel file here
  • 00:07:57
    and this is my data
  • 00:08:03
    next
  • 00:08:05
    and this will lead me
  • 00:08:07
    back to
  • 00:08:09
    the power query editor so let's check
  • 00:08:12
    the data
  • 00:08:16
    and open the power query editor
  • 00:08:19
    now what we see here is all the data in
  • 00:08:23
    the flow we have some machine learning
  • 00:08:25
    models we have some maintenance data and
  • 00:08:27
    what might happen to you if you try to
  • 00:08:30
    save and close this you might get an
  • 00:08:32
    error
  • 00:08:33
    so I would recommend to check these
  • 00:08:37
    queries here first
  • 00:08:40
    because you have to add some connections
  • 00:08:44
    and apply some connection information
  • 00:08:49
    so we click next
  • 00:08:59
    switch to the next one
  • 00:09:02
    configure the connection to AI functions
  • 00:09:07
    using my organization account
  • 00:09:10
    as you may have noticed I'm using here a
  • 00:09:13
    premium per user test version
  • 00:09:15
    so you have to you have a premium
  • 00:09:18
    capacity in order to use this machine
  • 00:09:21
    learning technology in power bi
  • 00:09:44
    so this may take a few seconds or some
  • 00:09:48
    seconds more
  • 00:09:50
    and when this is done we can
  • 00:09:53
    save and close the power query editor
  • 00:09:59
    now we click on Save and close
  • 00:10:05
    and now we have an additional table
  • 00:10:09
    here in our flow
  • 00:10:11
    which is called prediction and now I
  • 00:10:14
    want to apply the Machine model to this
  • 00:10:17
    prediction in order to predict the mean
  • 00:10:19
    time to fill up
  • 00:10:22
    so I'm switching back to machine
  • 00:10:24
    learning model
  • 00:10:26
    and apply
  • 00:10:29
    and here I can select the table I'm
  • 00:10:31
    using this prediction table it is
  • 00:10:33
    important that you have the same column
  • 00:10:36
    names and the same type like in the
  • 00:10:38
    machine learning model this has to match
  • 00:10:40
    in order to make this work
  • 00:10:42
    and I will call this
  • 00:10:46
    pretty output
  • 00:10:50
    save and close and again this will take
  • 00:10:53
    a few seconds now
  • 00:10:55
    for power API to
  • 00:10:58
    make this prediction for our data based
  • 00:11:01
    on the trained machine learning model so
  • 00:11:03
    let's give it a few seconds to finish
  • 00:11:08
    back from the coffee break so let's have
  • 00:11:11
    a look at our model
  • 00:11:15
    and now we have this prediction here and
  • 00:11:18
    we have an output that is called
  • 00:11:20
    enriched which contains the prediction
  • 00:11:23
    that we wanted and an explanation
  • 00:11:27
    and what I'm going to do now is to use
  • 00:11:29
    power API to have a look at this
  • 00:11:31
    enriched model which contains a
  • 00:11:34
    prediction
  • 00:11:35
    so I'm connecting to my data flows
  • 00:11:40
    and in my workspace
  • 00:11:42
    I have this prediction enriched
  • 00:11:47
    model
  • 00:11:50
    and I'm going to load it into Power
  • 00:11:53
    query editor
  • 00:11:57
    and let's
  • 00:11:59
    have a look here we have this output
  • 00:12:02
    from the regression result
  • 00:12:04
    and the only thing I want to do is to
  • 00:12:07
    switch from text
  • 00:12:09
    to make it a number
  • 00:12:13
    and load it into my report
  • 00:12:20
    here it comes
  • 00:12:23
    and now I'm going to make a table
  • 00:12:27
    to fuse a prediction
  • 00:12:30
    that's a machine learning model
  • 00:12:32
    has made for us
  • 00:12:34
    so
  • 00:12:36
    let's use a table and I have my
  • 00:12:38
    transaction ID here and I don't want to
  • 00:12:42
    aggregate it
  • 00:12:44
    but I want
  • 00:12:48
    it's a machine type say h
  • 00:12:52
    site the quantity and here I have this
  • 00:12:55
    three
  • 00:12:57
    uh columns uh Fields whatever you call
  • 00:13:00
    it that come from the Machine model
  • 00:13:02
    machine learning model
  • 00:13:04
    and I'm interested in some regression
  • 00:13:06
    result and as you can see this is uh the
  • 00:13:11
    prediction along the machine will be
  • 00:13:14
    operable before it will break down as
  • 00:13:16
    you can see we have this one machine
  • 00:13:19
    which is five year olds and has produced
  • 00:13:25
    67
  • 00:13:28
    000 goods and it will last approximately
  • 00:13:33
    nine days until it needs a repair and we
  • 00:13:36
    have this other machine here
  • 00:13:38
    which is one year old and has produced
  • 00:13:42
    18 000 Goods and some machine learning
  • 00:13:45
    model says it will
  • 00:13:47
    at least
  • 00:13:49
    278 days until it needs a repair so you
  • 00:13:52
    can use this information here down here
  • 00:13:55
    for predictive maintenance and for
  • 00:13:57
    example scheduler maintenance for these
  • 00:14:00
    machines here
  • 00:14:01
    and maintain it before it will break
  • 00:14:05
    down
  • 00:14:06
    so I hope you like this video and see
  • 00:14:09
    how easy is this to create machine
  • 00:14:11
    learning model in power bi however if
  • 00:14:15
    you want to create a machine learning
  • 00:14:17
    model in another technology like HTML
  • 00:14:19
    here of course free to do this and
  • 00:14:23
    integrate Azure ml machine learning
  • 00:14:25
    models as well in power bi
  • 00:14:28
    thanks for watching
Tags
  • Power BI
  • machine learning
  • predictive maintenance
  • regression model
  • data flow
  • Power Query
  • validation
  • training data
  • Azure ML integration
  • premium capacity