<jupyter_start><jupyter_text>Using L1 Regularization For L1, set `elasticNetParam = 1` and for L2, set `elasticNetParam = 0`<jupyter_code>lr = LogisticRegression(featuresCol='features', labelCol='y', elasticNetParam=1, regParam=0.001)
model = lr.fit(xdf)
result = model.evaluate(xdf)
result.recallByLabel
lr = LogisticRegression(featuresCol='features', labelCol='y', elasticNetParam=1, regParam=0.0001)
model = lr.fit(xdf)
result = model.evaluate(xdf)
result.recallByLabel
lr = LogisticRegression(featuresCol='features', labelCol='y', elasticNetParam=1, regParam=0.01)
model = lr.fit(xdf)
result = model.evaluate(xdf)
result.recallByLabel
test = stratifiedSample(xdf, 100)
test_results = model.evaluate(test)
test_results.predictions.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13246753246753246, 'fraction_numerical': 0.02987012987012987, 'mean_word_length': 9.012987012987013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '211855', 'license': 'MIT', 'n_tokens_mistral': 295, 'n_tokens_neox': 273, 'n_words': 49, 'path': 'classification/lr-improv-final.ipynb', 'repo_name': 'tejaswiniallikanti/upgrad-mlcloud', 'size': '770'}