<jupyter_start><jupyter_text>Each row consists of 13 weights,where each weight is multiplied by the respective feature in the 13-dimensionalWine dataset to calculate the net input:![title](img/logistic.jpg) we will vary the regularizationstrength and plot the regularization path—the weight coefficients of the differentfeatures for different regularization strengths<jupyter_code>fig= plt.figure()
ax = plt.subplot(111)
colors = ['blue','green','red','cyan','magenta','yellow','black','pink','lightgreen','lightblue','gray','indigo','orange','pink']
weights, params = [],[]
for c in np.arange(-4,6):
    lr = LogisticRegression(penalty='l1',C=10.**c,solver = 'liblinear',multi_class='ovr',random_state=0)
    lr.fit(X_train_std,y_train)
    weights.append(lr.coef_[1])
    params.append(10.**c)
weights = np.array(weights)
for column, color in zip(range(weights.shape[1]), colors):
    plt.plot(params, weights[:,column],label = df_wine.columns[column+1],color = color)
plt.axhline(0, color='black', linestyle='--', linewidth=3)
plt.xlim([10**(-5), 10**(5)])
plt.ylabel('weights coeffitient')
plt.xlabel('C')
plt.xscale('log')
plt.legend(loc = 'upper left')
ax.legend(loc = 'upper center',
         bbox_to_anchor=(1.38, 1.03),
            ncol=1, fancybox=True)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17177914110429449, 'fraction_numerical': 0.02530674846625767, 'mean_word_length': 6.5, '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': '51518', 'license': 'Apache-2.0', 'n_tokens_mistral': 465, 'n_tokens_neox': 431, 'n_words': 92, 'path': 'Wine Dataset.ipynb', 'repo_name': 'AshishSinha5/mlAlgos', 'size': '1304'}