-
Notifications
You must be signed in to change notification settings - Fork 0
/
Explore Machine Learning Models with Explainable AI: Challenge Lab
35 lines (28 loc) · 1.68 KB
/
Explore Machine Learning Models with Explainable AI: Challenge Lab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FIRST MODEL ----------------------------------------------------------------------------------------------------------
model = Sequential()
model.add(layers.Dense(200, input_shape=(input_size,), activation='relu'))
model.add(layers.Dense(50, activation='relu'))
model.add(layers.Dense(20, activation='relu'))
model.add(layers.Dense(1, activation='sigmoid'))
model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
model.fit(train_data, train_labels, epochs=10, batch_size=2048, validation_split=0.1)
SECOND MODEL ----------------------------------------------------------------------------------------------------------
limited_model = Sequential()
limited_model.add(layers.Dense(200, input_shape=(input_size,), activation='relu'))
limited_model.add(layers.Dense(50, activation='relu'))
limited_model.add(layers.Dense(20, activation='relu'))
limited_model.add(layers.Dense(1, activation='sigmoid'))
limited_model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
limited_model.fit(limited_train_data, limited_train_labels, epochs=10, batch_size=2048, validation_split=0.1)
LAST CODE ---------------------------------------------------------------------------------------------------------------
config_builder = (WitConfigBuilder(
examples_for_wit[:num_datapoints],feature_names=column_names)
.set_custom_predict_fn(limited_custom_predict)
.set_target_feature('loan_granted')
.set_label_vocab(['denied', 'accepted'])
.set_compare_custom_predict_fn(custom_predict)
.set_model_name('limited')
.set_compare_model_name('complete'))
WitWidget(config_builder, height=800)
FOLLOW MY INSTUCTIONS WHILE FOLLOWING FROM THIS FILE!
Thank you!