Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias Assign NameStore Dict Str Num Assign NameStore Num Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Num Num Num Num Num Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore ListComp Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num comprehension NameStore NameLoad Assign NameStore Dict Str Str Str Str Str Str NameLoad NameLoad Str Dict Str Str Str Num ListLoad Num Num Num Num Num Str Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore ListComp Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num comprehension NameStore NameLoad Assign NameStore Dict Str Str Str Str Str NameLoad NameLoad Str Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore ListComp Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num comprehension NameStore NameLoad Return TupleLoad Dict Str Str Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore ListComp Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num comprehension NameStore NameLoad Return TupleLoad Dict Str Str Str NameLoad NameLoad decorator_list Assign NameStore Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call SubscriptLoad NameLoad Index NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Call NameLoad SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Slice Num Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Assign TupleStore NameStore NameStore TupleLoad Num Num Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign TupleStore NameStore NameStore TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad NameLoad SubscriptLoad NameLoad Slice Num NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Slice NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad Assign NameStore Num For NameStore Call NameLoad Num Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore BinOpPow BinOpSub SubscriptLoad NameLoad Index NameLoad NameLoad Num AugAssignDiv NameStore Call NameLoad Call NameLoad NameLoad Return NameLoad decorator_list Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Call NameLoad attr SubscriptLoad NameLoad Index NameLoad Num Num Assign NameStore Call AttributeLoad Call NameLoad attr SubscriptLoad NameLoad Index NameLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num For NameStore Call NameLoad Num body Assign NameStore Dict Assign NameStore Lambda arguments args NameParam defaults TupleLoad NameLoad SubscriptLoad Call NameLoad NameLoad keyword NameLoad keyword NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad For TupleStore NameStore NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad NameLoad Call NameLoad Call NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Lambda arguments args NameParam NameParam NameParam NameParam defaults Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad Assign NameStore ListComp Call NameLoad NameLoad NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index Str Assign NameStore Dict Assign NameStore Dict Assign NameStore Dict For NameStore Call AttributeLoad NameLoad attr body If CompareNotIn NameLoad Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad ListLoad Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad attr For NameStore Call AttributeLoad NameLoad attr body If CompareNotIn NameLoad Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad ListLoad Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad attr For NameStore Call AttributeLoad NameLoad attr body If CompareNotIn NameLoad Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad ListLoad Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore Dict Assign NameStore Dict For NameStore NameLoad body For NameStore NameLoad body Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad attr Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Call AttributeLoad Call NameLoad NameLoad attr With Call AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr keyword TupleLoad Num Num For NameStore NameLoad body Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListLoad Num Num Expr Call AttributeLoad NameLoad attr ListLoad Num Num Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr
N/A N/A 
Prediction with Imputated Time Series
-------------------------------------------------------------------------

The time series of the target turbine near Reno is destroyed missing at random
(MAR) given a certain percentage of damage. The damaged time series is
imputated using different imputation methods: last observation carried forward
(LOCF), linear interpolation, multiple linear regression and kNN regression.
The imputated time series is used for short-term wind prediction employing the
spatio-temporal time series model with multiple linear regression. The plot
shows the prediction MSE depending on the rate of missing data for different
imputation methods.
 windml.datasets.nrel NREL windml.visualization.plot_timeseries plot_timeseries windml.preprocessing.preprocessing destroy windml.preprocessing.preprocessing interpolate windml.preprocessing.preprocessing repair_nrel sklearn.neighbors KNeighborsRegressor sklearn linear_model sklearn.svm SVR sklearn.grid_search GridSearchCV sklearn.cross_validation KFold cross_val_score sklearn.neighbors KNeighborsRegressor sklearn linear_model windml.mapping.power_mapping PowerMapping sklearn.neighbors KNeighborsRegressor N/A matplotlib.pyplot plt N/A matplotlib.dates md pylab * matplotlib.ticker FuncFormatter numpy array itertools product chain N/A parks N/A carway 30498 N/A timestep 600 N/A methods N/A mreg_knn mreg_lin linear forwardcopy N/A rates N/A 0.1 0.3 0.5 0.7 0.9 N/A destroy_method mar N/A labels N/A linear forwardcopy mreg_knn mreg_lin Linear Interpolation LOCF KNN Regression Linear Regression static_mreg_knn N/A N/A windpark N/A N/A N/A target N/A N/A windpark get_target N/A measurements N/A repair_nrel N/A N/A N/A target get_measurements N/A 10000 N/A neighbors N/A N/A N/A windpark get_turbines N/A -1 N/A nseries N/A N/A repair_nrel N/A N/A N/A t get_measurements N/A 10000 N/A t neighbors N/A iargs N/A method timestep neighbor_series reg regargs mreg timestep nseries knn N/A kfold n variant 5 N/A 5 10 20 50 100 uniform N/A N/A iargs nseries N/A static_mreg_lin N/A N/A windpark N/A N/A N/A target N/A N/A windpark get_target N/A measurements N/A repair_nrel N/A N/A N/A target get_measurements N/A 10000 N/A neighbors N/A N/A N/A windpark get_turbines N/A -1 N/A nseries N/A N/A repair_nrel N/A N/A N/A t get_measurements N/A 10000 N/A t neighbors N/A iargs N/A method timestep neighbor_series reg mreg timestep nseries linear_model N/A N/A iargs nseries N/A static_linear N/A N/A windpark N/A N/A N/A target N/A N/A windpark get_target N/A measurements N/A repair_nrel N/A N/A N/A target get_measurements N/A 10000 N/A neighbors N/A N/A N/A windpark get_turbines N/A -1 N/A nseries N/A N/A repair_nrel N/A N/A N/A t get_measurements N/A 10000 N/A t neighbors N/A N/A N/A method timestep linear timestep nseries N/A static_forwardcopy N/A N/A windpark N/A N/A N/A target N/A N/A windpark get_target N/A measurements N/A repair_nrel N/A N/A N/A target get_measurements N/A 10000 N/A neighbors N/A N/A N/A windpark get_turbines N/A -1 N/A nseries N/A N/A repair_nrel N/A N/A N/A t get_measurements N/A 10000 N/A t neighbors N/A N/A N/A method timestep forwardcopy timestep nseries N/A N/A argfuncs N/A linear forwardcopy mreg_knn mreg_lin static_linear static_forwardcopy static_mreg_knn static_mreg_lin experiment N/A N/A method windpark windpark_test damaged rate N/A N/A N/A N/A args nseries N/A N/A argfuncs N/A method windpark N/A reconstructed N/A interpolate damaged args N/A target N/A N/A windpark get_target N/A measurements N/A repair_nrel N/A N/A N/A target get_measurements N/A 10000 N/A turbines N/A N/A windpark get_turbines N/A t N/A range N/A len turbines N/A N/A N/A N/A N/A turbines N/A t add_measurements N/A repair_nrel N/A N/A N/A N/A turbines N/A t get_measurements N/A 10000 N/A N/A N/A N/A turbines N/A -1 add_measurements reconstructed N/A N/A feature_window horizon N/A 3 3 N/A mapping N/A PowerMapping N/A X N/A N/A mapping get_features_park windpark feature_window horizon N/A Y N/A N/A mapping get_labels_turbine target feature_window horizon N/A train_to N/A int N/A N/A math floor N/A len X N/A N/A train_step test_step N/A 1 1 N/A reg N/A N/A linear_model LinearRegression N/A reg N/A N/A reg fit N/A X N/A 0 train_to train_step N/A Y N/A 0 train_to train_step N/A turbines N/A N/A windpark_test get_turbines N/A t turbines N/A N/A N/A N/A t add_measurements N/A repair_nrel N/A N/A N/A t get_measurements N/A 10000 N/A target_test N/A N/A windpark_test get_target N/A XT N/A N/A mapping get_features_park windpark_test feature_window horizon N/A test_to N/A int N/A N/A math floor N/A len XT N/A YT N/A N/A N/A mapping get_labels_turbine target_test feature_window horizon N/A test_to N/A y_hat N/A N/A reg predict N/A XT N/A test_to N/A mse_y_hat 0 N/A i N/A range 0 N/A len y_hat N/A N/A y N/A YT N/A i N/A mse_y_hat N/A N/A N/A y_hat N/A i y 2 N/A mse_y_hat N/A float N/A len y_hat N/A mse_y_hat N/A N/A data N/A N/A park N/A N/A parks keys N/A N/A windpark N/A N/A N/A NREL get_windpark_nearest N/A parks N/A park 5 2004 N/A windpark_test N/A N/A N/A NREL get_windpark_nearest N/A parks N/A park 5 2005 N/A target N/A N/A windpark get_target N/A measurements N/A repair_nrel N/A N/A N/A target get_measurements N/A 10000 N/A i N/A xrange 2 N/A N/A damaged_series N/A N/A de N/A N/A N/A rate N/A N/A rate N/A N/A destroy measurements method destroy_method percentage rate N/A 0 N/A dseries N/A map de rates N/A N/A rate series dseries N/A N/A N/A damaged_series N/A rate series run N/A N/A pars N/A N/A N/A N/A method rate pars N/A mse N/A experiment method windpark windpark_test N/A damaged_series N/A rate rate N/A N/A method rate mse N/A N/A results N/A map run N/A list N/A chain N/A product methods rates N/A encoding N/A N/A N/A method rate mse park N/A N/A method rate mse park method rate mse park N/A results N/A N/A encoding method rate mse park N/A N/A method rate mse results N/A result results N/A N/A N/A N/A data append result N/A mse N/A N/A result data N/A N/A keys N/A N/A mse keys N/A key N/A N/A result N/A method N/A result N/A rate N/A result N/A park N/A N/A key keys N/A N/A N/A mse N/A key N/A N/A N/A N/A N/A mse N/A key append N/A result N/A mse N/A mean N/A N/A var N/A N/A std N/A N/A key N/A N/A mse keys N/A N/A N/A key N/A N/A mean keys N/A N/A N/A mean N/A key N/A N/A N/A mean N/A key N/A N/A N/A array N/A mse N/A key mean N/A key N/A N/A mse keys N/A N/A N/A key N/A N/A var keys N/A N/A N/A var N/A key N/A N/A N/A var N/A key N/A N/A N/A array N/A mse N/A key var N/A key N/A N/A mse keys N/A N/A N/A key N/A N/A std keys N/A N/A N/A std N/A key N/A N/A N/A std N/A key N/A N/A N/A array N/A mse N/A key std N/A amean N/A N/A astd N/A N/A method methods N/A N/A rate rates N/A N/A means N/A N/A park N/A N/A parks keys N/A N/A N/A N/A means append N/A mean N/A N/A method rate park N/A N/A amean N/A N/A method rate N/A N/A N/A array means mean N/A N/A astd N/A N/A method rate N/A N/A N/A array means std N/A N/A N/A N/A plt style context fivethirtyeight N/A N/A park carway N/A figure N/A N/A plt figure figsize N/A 8 5 N/A method methods N/A N/A rmses N/A N/A yerrs N/A N/A rate rates N/A N/A N/A N/A yerrs append N/A std N/A N/A method rate park N/A N/A N/A rmses append N/A mean N/A N/A method rate park N/A N/A N/A plt errorbar rates rmses yerr yerrs label N/A labels N/A method linestyle -- marker o N/A N/A N/A plt xlabel Rate of Missing Data N/A N/A N/A plt ylabel Prediction MSE N/A N/A N/A plt xlim N/A 0.1 0.9 N/A N/A N/A plt ylim N/A 12.5 16 N/A N/A N/A plt legend loc upper left N/A N/A N/A plt show