January 2019
Intermediate to advanced
390 pages
9h 16m
English
We'll use a decision tree regressor to predict electrical power output first. The dataset and its description have already been introduced in Chapter 1, Principles and Foundations of IoT and AI. The code is available at the GitHub repository in the file named ElectricalPowerOutputPredictionUsingDecisionTrees.ipynb:
# Import the modulesimport tensorflow as tfimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom sklearn.preprocessing import MinMaxScalerfrom sklearn.metrics import mean_squared_error, r2_scorefrom sklearn.model_selection import train_test_splitfrom sklearn.tree import DecisionTreeRegressor%matplotlib inline# Read the data filename = 'Folds5x2_pp.xlsx' # The file can be downloaded from ...
Read now
Unlock full access