Commit 61dd2e62 authored by Bannier Delphine's avatar Bannier Delphine
Browse files

add confidence pred

parent 2393fbf3
This diff is collapsed.
......@@ -8,8 +8,8 @@ import math
def evaluate_hybrid(model,df, trainAttrX, trainImagesX, trainY,sc):
logging.info("predicting ...")
preds = model.predict([trainAttrX, trainImagesX])
diff = sc.inverse_transform(preds.flatten()) - sc.inverse_transform(trainY)
percentDiff = (diff / sc.inverse_transform(trainY)) * 100
diff = preds.flatten() - trainY
percentDiff = (diff / trainY) * 100
absPercentDiff = np.abs(percentDiff)
mean = np.mean(absPercentDiff)
std = np.std(absPercentDiff)
......
......@@ -53,6 +53,7 @@ def create_cnn(width, height, depth, filters=(32, 64, 128), regress=False, type_
# la couche suivante ne sert à rien pour l'hybride, à garder pour le modèle cnn seule
if type_cnn == 'simple':
if regress:
x = Dropout(0.5)(x)
x = Dense(1, activation="linear")(x)
# construct the CNN
model = Model(inputs, x)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment