output_folder = sys.argv[1]
threshold_dir = (int)(sys.argv[2])
num_blocks = (int)(sys.argv[3])
compute_mse_current = (int)(sys.argv[4])
cycles = (int)(sys.argv[5])
max_active_set = (int)(sys.argv[6])

####load data
file = "ENEL_2014/Enel_dataset.npz"
results = Result(file, "lasso")

XTrain, YTrain, XTest, YTest = results.extract_train_test()
enel_dict = results.extract_dict()
Coord, Coord_turb, power_curve = results.extract_coords()

angles_coord_turb, _ = compute_angle(Coord, Coord_turb)

##transformation of data
X = np.concatenate((XTrain, XTest), axis=0)
enel_transf = Enel_powerCurveTransformation()

X_angle, _, _ = enel_transf.compute_angle_matrix(X)
output_dict = dict.fromkeys(np.arange(0, 49), np.array([[]], dtype="int64"))

k_levels = np.arange(0, 12).reshape([12, 1])
for key in np.arange(0, 49):
    current_values = np.arange(key * 12, key * 12 + 12).reshape([12, 1])
    output_dict[key] = np.concatenate((current_values, k_levels), axis=1)

X_speed, _, _ = EnelWindSpeedTransformation().transform(X)
print("wind speed computed")
예제 #2
0
from utility import generate_samples_dynamic_set, get_current_data,get_common_indexes, \
    extract_chosen_indexes_from_start, center_test


####load data
file = "ENEL_2014/Enel_dataset.npz"
results = Result(file, "lasso")

XTrain, YTrain, XTest, YTest = results.extract_train_test()
enel_dict = results.extract_dict()
Coord, Coord_turb, power_curve = results.extract_coords()

##transformation of data
enel_transf = Enel_powerCurveTransformation()
output_dict_ = dict.fromkeys(np.arange(0,49),np.array([[]], dtype = "int64"))
angular_coeffs = compute_angle(Coord, Coord_turb)


X = np.concatenate((XTrain, XTest), axis = 0)
enel_transf = Enel_powerCurveTransformation()
X_angle,dict_ = enel_transf.compute_angle_matrix(X)

XTrain_angle = X_angle[:XTrain.shape[0],:]
XTest_angle = X[XTrain.shape[0]:,:]

turbine_dict = create_dict_direction(X_angle,angular_coeffs)
X_transf = np.array([[]])

X_transf, output_dict_ = enel_transf.transform1(turbine_dict, enel_dict, X, power_curve, 0, X_transf,
                                                    output_dict_)
output_folder = sys.argv[1]
threshold_dir = (int)(sys.argv[2])
num_blocks = (int)(sys.argv[3])
compute_mse_current = (int)(sys.argv[4])
cycles = (int)(sys.argv[5])

####load data
file = "ENEL_2014/Enel_dataset.npz"
results = Result(file, "lasso")


XTrain, YTrain, XTest, YTest = results.extract_train_test()
enel_dict = results.extract_dict()
Coord, Coord_turb, power_curve = results.extract_coords()

angles_coord_turb, verso_turb_point = compute_angle(Coord, Coord_turb)

##transformation of data
X = np.concatenate((XTrain, XTest), axis=0)
enel_transf = Enel_powerCurveTransformation()

X_angle, x_verso, _ = enel_transf.compute_angle_matrix(X)
output_dict = dict.fromkeys(np.arange(0, 49), np.array([[]], dtype="int64"))

k_levels = np.arange(0, 12).reshape([12, 1])
for key in np.arange(0, 49):
    current_values = np.arange(key * 12, key * 12 + 12).reshape([12, 1])
    output_dict[key] = np.concatenate((current_values, k_levels), axis=1)

X_speed, _, wind_direction = EnelWindSpeedTransformation().transform(X)
print("wind speed computed")
threshold_dir = 180
values_TM = np.array([[24,281], [24,214]])

XTrain, YTrain, XTest, YTest = results.extract_train_test()

dir = [180,90,45]

##transformation of data
X = np.concatenate((XTrain, XTest), axis = 0)
X_speed,_,_ = EnelWindSpeedTransformation().transform(X)
print("wind speed computed")

for directions in dir:
    print("-------")
    print(directions)
    angles_coord_turb, verso_turb_point = compute_angle(Coord, Coord_turb, directions)

    enel_transf = Enel_powerCurveTransformation()

    X_angle,x_verso,dict_ = enel_transf.compute_angle_matrix(X, directions)

    #np.savez("angles.npz",X_angle = X_angle, angles_coord_turb = angles_coord_turb)
    print("saved angles")
    output_dict = dict.fromkeys(np.arange(0,49),np.array([[]], dtype = "int64"))

    k_levels = np.arange(0,12).reshape([12,1])
    for key in np.arange(0,49):
        current_values = np.arange(key*12,key*12+12).reshape([12,1])
        output_dict[key] = np.concatenate((current_values,k_levels), axis = 1)

    enel_transf = Enel_directionPowerCurveTransformation()