MathWorks - Mobile View
  • 登录到您的 MathWorks 帐户登录到您的 MathWorks 帐户
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
MathWorks
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
  • 登录到您的 MathWorks 帐户登录到您的 MathWorks 帐户
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出

视频与网上研讨会

  • MathWorks
  • 视频
  • 视频首页
  • 搜索
  • 视频首页
  • 搜索
  • 联系销售
  • 试用软件
  Register to watch video
  • Description
  • Full Transcript
  • Code and Resources

Forecast Electrical Load Using the Regression Learner App

Gabriel Ha, MathWorks

The Regression Learner app lets you explore your data, select features, specify validation schemes, optimize hyperparameters, and assess model performance to predict your data without needing to write any code.

You can export regression models to the MATLAB® workspace or generate MATLAB code to integrate models into applications.

The app takes menial workflows and tasks like setting up the validation, picking the relevant predictors, and picking the optimal model and tuning it and makes them interactive, saving you time. It also gives you full transparency into what's happening under the hood and automates the workflow by automatically generating code.

Regression Learner App in the Statistics and Machine Learning toolbox lets you train multiple models and choose the best model to predict your data, without needing to write any code.

You can also use the app to explore your data, select features, specify validation schemes, optimize hyperparameters, and assess model performance.

This example will use the app to model the amount of electricity required to support an electric grid – also referred to as the “load” – and use that model to make predictions about a future load.

You can find the Regression Learner app in the app gallery under machine learning and deep learning.

You can also open it directly from the MATLAB command line.

Start a new session, and then select the dataset you want to use. Based on the data types of the variables therein, the app will automatically assign them as predictors or as responses. However, you can always change their roles if necessary. You can also deselect variables irrelevant to predicting a response, which will save on training time.

The default automatic cross-validation option protects against overfitting. In this example, where we have lots of data, hold-out validation works well.

Next, you’ll be able to explore which machine learning model makes the most sense with your data.

There are many models from which you can choose: linear regression models, regression trees, Gaussian process regression models, support vector machines, and ensembles of regression trees.

If you already have an idea of what kinds of models are best suited for your data, you can train them one-by-one, or select a group of models to train. If you’re unsure, just select them all, start training, and look at the one that gives you the best initial performance.

You can see the models in the history list along with the Root-Mean Square Error (or RMSE). RMSE represents the model’s performance, or fitness, against your data. The lower the error, the better the fitness. The app will automatically highlight the model with the lowest error.

In this example, the model with the lowest RMSE is the Matern 5/2 GPR.

When you select a model, you’ll be able to use various plots to see more details about its performance.

As an example, the predicted vs actual plot helps you understand how well this particular model makes predictions for different response values. A perfect regression model has a predicted response equal to the true response, so all the points lie on a diagonal line. The vertical distance from the line to any point is the error of the prediction for that point.

To further optimize the model, you can tune its hyperparameters. The app will try different combinations of hyperparameter values by using an optimization scheme that seeks to minimize the model error.

To do this, select the Optimizable model corresponding to your model type, in this case, the Optimizable GPR.

The app will iterate through all these combinations of hyperparameters for GPR models. The visualization shows how the error decreases as different combinations of hyperparameters are evaluated. When it’s done, the app will highlight the best one with the lowest RMSE.

After you are satisfied with the training and tuning process, you can export your model back to the MATLAB workspace or generate MATLAB code.

Exporting to the workspace enables you to use the trained model to make predictions on new data.

Generating the MATLAB code for this model enables you to integrate it into machine learning applications, and enables your colleagues to quickly replicate your results.

To learn more about regression learning and download example datasets, click on the Help icon in the top right corner of the app.

Download Code and Files

Download code

Related Products

  • Statistics and Machine Learning Toolbox

Learn More

Classify Data Using the Classification Learner App (4:34)
Machine Learning Questions Asked and Answered: All About the Regression Learner App
What Is Linear Regression?
Machine Learning with MATLAB

VIEW SLIDESHOW

Five Interactive Apps for Machine Learning

Feedback

Featured Product

Statistics and Machine Learning Toolbox

  • Request Trial
  • Get Pricing

Up Next:

4:34
Classify Data Using the Classification Learner App

Related Videos:

35:09
Regression Analysis with MATLAB: New Statistics Toolbox...
46:23
Solving Data Management and Analysis Challenges Using...
39:42
Computational Statistics in BioPharm Using MATLAB Products
34:44
Multilevel Mixed-Effects Modeling Using MATLAB

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • 联系销售
  • 试用软件

了解产品

  • MATLAB
  • Simulink
  • 学生版软件
  • 硬件支持
  • 文件交换

试用或购买

  • 下载
  • 试用软件
  • 联系销售
  • 定价和许可
  • 如何购买

如何使用

  • 文档
  • 教程
  • 示例
  • 视频与网上研讨会
  • 培训

获取支持

  • 安装帮助
  • MATLAB 问答社区
  • 咨询
  • 许可中心
  • 联系支持

关于 MathWorks

  • 招聘
  • 新闻室
  • 社会愿景
  • 联系销售
  • 关于 MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks 公司是世界领先的为工程师和科学家提供数学计算软件的开发商。

发现…

  • Select a Web Site United States
  • 专利
  • 商标
  • 隐私权政策
  • 防盗版
  • 应用状态

京ICP备12052471号

© 1994-2021 The MathWorks, Inc.

  • Weibo
  • WeChat

    WeChat

  • Bilibili
  • Youku
  • Facebook
  • Twitter
  • LinkedIn
  • RSS

关注我们