multimodel-analysis 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multimodel_analysis
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A Python Package for Automatic Multi-Model Analysis (Classification & Regression)
5
5
  Author: Uditya Narayan Tiwari
6
6
  Author-email: tiwarimerit@gmail.com
@@ -152,9 +152,9 @@ class MultiModelClassifier:
152
152
  # Sort by Accuracy
153
153
  df = df.sort_values(by='Accuracy', ascending=False).reset_index(drop=True)
154
154
 
155
- # print(f"\n{'='*60}\n 📊 MODEL COMPARISON TABLE \n{'='*60}")
156
- # print(df)
157
- # print(f"{'='*60}\n")
155
+ print(f"\n{'='*60}\n 📊 MODEL COMPARISON TABLE \n{'='*60}")
156
+ print(df)
157
+ print(f"{'='*60}\n")
158
158
 
159
159
  # Recommend Best Model
160
160
  best_model = df.iloc[0]
@@ -162,7 +162,7 @@ class MultiModelClassifier:
162
162
  print(f" Accuracy: {best_model['Accuracy']:.4f} | F1 Score: {best_model['F1 Score']:.4f}")
163
163
  print(f"{'='*60}\n")
164
164
 
165
- return df
165
+ return None
166
166
 
167
167
  def plot_confusion_matrices(self, models):
168
168
  """Plots confusion matrices for all models with different colors."""
@@ -233,7 +233,7 @@ class MultiModelClassifier:
233
233
 
234
234
  plt.figure(figsize=(14, 8))
235
235
  ax = sns.barplot(x='Model', y='Score', hue='Metric', data=df_plot, palette="viridis")
236
- plt.title("Comprehensive Model Comparison", fontsize=18, pad=20)
236
+ plt.title("Comprehensive Model Comparison", fontsize=18, pad=20, fontweight='bold')
237
237
  plt.ylim(0, 1.1)
238
238
  plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
239
239
  plt.xticks(rotation=45, ha='right')
@@ -312,7 +312,7 @@ class MultiModelRegressior:
312
312
  print(f" R2 Score: {best_model['R2 Score']:.4f} | RMSE: {best_model['RMSE']:.4f}")
313
313
  print(f"{'='*60}\n")
314
314
 
315
- return df
315
+ return None
316
316
 
317
317
  def plot_true_vs_predicted(self, models):
318
318
  """Plots True vs Predicted values for all models (Regression equivalent of Confusion Matrix)."""
@@ -337,7 +337,7 @@ class MultiModelRegressior:
337
337
  p2 = min(min(y_pred), min(self.y_test))
338
338
  axes[idx].plot([p1, p2], [p1, p2], 'k--', lw=2)
339
339
 
340
- axes[idx].set_title(f'{name}\nR2: {r2:.2f} | RMSE: {rmse:.2f}', fontsize=14)
340
+ axes[idx].set_title(f'{name}\nR2: {r2:.2f} | RMSE: {rmse:.2f}', fontsize=14, fontweight='bold')
341
341
  axes[idx].set_xlabel('True Values')
342
342
  axes[idx].set_ylabel('Predicted Values')
343
343
  axes[idx].legend()
@@ -355,15 +355,22 @@ class MultiModelRegressior:
355
355
  self.plot_comparison(models)
356
356
 
357
357
  def plot_comparison(self, models):
358
- model_names = [m[0] for m in models]
359
- r2_scores = [m[4] for m in models]
360
- plt.figure(figsize=(10, 6))
361
- sns.barplot(x=model_names, y=r2_scores, palette='viridis')
362
- plt.title("Regressor R2 Score Comparison")
363
- plt.ylabel("R2 Score")
364
- plt.xticks(rotation=45)
365
- plt.tight_layout()
366
- plt.show()
358
+ """Plots comparison bar charts with values on top for Regression."""
359
+ model_names = [m[0] for m in models]
360
+ r2_scores = [m[4] for m in models]
361
+
362
+ plt.figure(figsize=(10, 6))
363
+ ax = sns.barplot(x=model_names, y=r2_scores, palette='viridis')
364
+ plt.title("Regressor R2 Score Comparison", pad=20, fontweight='bold')
365
+ plt.ylabel("R2 Score")
366
+ plt.xticks(rotation=45)
367
+
368
+ # Add values on top of bars
369
+ for container in ax.containers:
370
+ ax.bar_label(container, fmt='%.2f', padding=3, fontsize=10)
371
+
372
+ plt.tight_layout()
373
+ plt.show()
367
374
 
368
375
  # =============================================================================
369
376
  # SMART MAIN BLOCK: AUTOMATIC DETECTION
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multimodel_analysis
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A Python Package for Automatic Multi-Model Analysis (Classification & Regression)
5
5
  Author: Uditya Narayan Tiwari
6
6
  Author-email: tiwarimerit@gmail.com
@@ -9,7 +9,7 @@ with open('requirements.txt') as fp:
9
9
 
10
10
  setuptools.setup(
11
11
  name='multimodel_analysis', # Package name
12
- version='0.0.2', # Initial version
12
+ version='0.0.3', # Initial version
13
13
  author='Uditya Narayan Tiwari',
14
14
  author_email='tiwarimerit@gmail.com',
15
15
  description='A Python Package for Automatic Multi-Model Analysis (Classification & Regression)',