baconnier commited on
Commit
8e3aecb
·
verified ·
1 Parent(s): 179691f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -17
app.py CHANGED
@@ -58,34 +58,21 @@ class DataAnalyzer:
58
  if len(df) > 5000:
59
  df = df.sample(n=5000, random_state=42)
60
 
61
- # Ensure all columns are properly formatted
62
- df = df.copy()
63
- # Convert numeric columns that might be stored as strings
64
- for col in df.columns:
65
- if df[col].dtype == 'object':
66
- try:
67
- df[col] = pd.to_numeric(df[col], errors='ignore')
68
- except:
69
- pass
70
-
71
  plt.close('all') # Close any existing plots
72
 
73
- # Configure AutoViz with more specific parameters
74
  dfte = self.AV.AutoViz(
75
  filename='',
76
  sep=',',
77
- depVar='',
78
- dfte=df,
79
  header=0,
80
  verbose=1, # Set to 1 to see progress
81
  lowess=False,
82
  chart_format='html',
83
  max_rows_analyzed=5000,
84
  max_cols_analyzed=30,
85
- save_plot_dir=viz_temp_dir,
86
- ignore_warnings=True,
87
- sampling=True, # Enable sampling
88
- sample_size=5000
89
  )
90
 
91
  # Collect and combine HTML files
@@ -147,6 +134,7 @@ class DataAnalyzer:
147
  if os.path.exists(viz_temp_dir):
148
  shutil.rmtree(viz_temp_dir)
149
 
 
150
  def create_interface():
151
  analyzer = DataAnalyzer()
152
 
 
58
  if len(df) > 5000:
59
  df = df.sample(n=5000, random_state=42)
60
 
 
 
 
 
 
 
 
 
 
 
61
  plt.close('all') # Close any existing plots
62
 
63
+ # Configure AutoViz with correct parameters
64
  dfte = self.AV.AutoViz(
65
  filename='',
66
  sep=',',
67
+ depVar='', # No target variable
68
+ dfte=df, # Pass the dataframe directly
69
  header=0,
70
  verbose=1, # Set to 1 to see progress
71
  lowess=False,
72
  chart_format='html',
73
  max_rows_analyzed=5000,
74
  max_cols_analyzed=30,
75
+ save_plot_dir=viz_temp_dir
 
 
 
76
  )
77
 
78
  # Collect and combine HTML files
 
134
  if os.path.exists(viz_temp_dir):
135
  shutil.rmtree(viz_temp_dir)
136
 
137
+
138
  def create_interface():
139
  analyzer = DataAnalyzer()
140