1,
model_l1 = tf.estimator.LinearClassifier(
feature_columns=base_columns + crossed_columns, optimizer=tf.train.FtrlOptimizer( learning_rate=0.1, l1_regularization_strength=10.0, l2_regularization_strength=0.0))model_l1.train(train_inpf)
results = model_l1.evaluate(test_inpf)
clear_output()for key in sorted(results): print('%s: %0.2f' % (key, results[key]))
2,
model_l2 = tf.estimator.LinearClassifier(
feature_columns=base_columns + crossed_columns, optimizer=tf.train.FtrlOptimizer( learning_rate=0.1, l1_regularization_strength=0.0, l2_regularization_strength=10.0))model_l2.train(train_inpf)
results = model_l2.evaluate(test_inpf)
clear_output()for key in sorted(results): print('%s: %0.2f' % (key, results[key]))