Skip to content

Commit faab0f9

Browse files
author
Test User
committed
Day 5 (04:00): revert session changes (could not fix build)
1 parent ba413c2 commit faab0f9

File tree

89 files changed

+1502
-3880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1502
-3880
lines changed

src/backend/api/chat.py

Lines changed: 72 additions & 237 deletions
Large diffs are not rendered by default.

src/backend/api/data.py

Lines changed: 43 additions & 124 deletions
Large diffs are not rendered by default.

src/backend/api/deploy.py

Lines changed: 74 additions & 172 deletions
Large diffs are not rendered by default.

src/backend/api/features.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
# Helpers
3939
# ---------------------------------------------------------------------------
4040

41-
4241
def _load_dataset(dataset_id: str, session: Session) -> tuple[Dataset, pd.DataFrame]:
4342
dataset = session.get(Dataset, dataset_id)
4443
if not dataset:
@@ -54,7 +53,6 @@ def _load_dataset(dataset_id: str, session: Session) -> tuple[Dataset, pd.DataFr
5453
# 1. Suggestions
5554
# ---------------------------------------------------------------------------
5655

57-
5856
@router.get("/{dataset_id}/suggestions")
5957
def get_suggestions(dataset_id: str, session: Session = Depends(get_session)):
6058
"""Return AI-generated feature transformation suggestions for a dataset."""
@@ -82,7 +80,6 @@ def get_suggestions(dataset_id: str, session: Session = Depends(get_session)):
8280
# 2. Apply transformations
8381
# ---------------------------------------------------------------------------
8482

85-
8683
class ApplyRequest(BaseModel):
8784
transformations: list[dict] # list of {column, transform_type, params?}
8885

@@ -120,7 +117,9 @@ def apply_feature_transforms(
120117
session.refresh(feature_set)
121118

122119
preview = transformed_df.head(5).to_dict(orient="records")
123-
new_columns = sorted(set(transformed_df.columns) - set(df.columns))
120+
new_columns = sorted(
121+
set(transformed_df.columns) - set(df.columns)
122+
)
124123

125124
return {
126125
"feature_set_id": feature_set.id,
@@ -135,7 +134,6 @@ def apply_feature_transforms(
135134
# 3. Preview a feature set
136135
# ---------------------------------------------------------------------------
137136

138-
139137
@router.get("/{feature_set_id}/preview")
140138
def preview_feature_set(feature_set_id: str, session: Session = Depends(get_session)):
141139
"""Return a preview of the transformed dataset for a given FeatureSet."""
@@ -162,7 +160,6 @@ def preview_feature_set(feature_set_id: str, session: Session = Depends(get_sess
162160
# 4. Set target variable
163161
# ---------------------------------------------------------------------------
164162

165-
166163
class TargetRequest(BaseModel):
167164
target_column: str
168165
feature_set_id: str | None = None # update an existing FeatureSet if provided
@@ -211,7 +208,6 @@ def set_target(
211208
# 6. List pipeline steps for a FeatureSet
212209
# ---------------------------------------------------------------------------
213210

214-
215211
@router.get("/{feature_set_id}/steps")
216212
def list_pipeline_steps(feature_set_id: str, session: Session = Depends(get_session)):
217213
"""Return the ordered list of transformation steps in the pipeline."""
@@ -230,7 +226,6 @@ def list_pipeline_steps(feature_set_id: str, session: Session = Depends(get_sess
230226
# 7. Append a single step to the pipeline
231227
# ---------------------------------------------------------------------------
232228

233-
234229
class AddStepRequest(BaseModel):
235230
column: str
236231
transform_type: str
@@ -264,7 +259,6 @@ def add_pipeline_step(
264259
df = pd.read_csv(file_path)
265260

266261
from core.feature_engine import apply_transformations
267-
268262
transformed_df, column_mapping = apply_transformations(df, steps)
269263

270264
feature_set.transformations = json.dumps(steps)
@@ -287,7 +281,6 @@ def add_pipeline_step(
287281
# 8. Remove (undo) a step by index
288282
# ---------------------------------------------------------------------------
289283

290-
291284
@router.delete("/{feature_set_id}/steps/{step_index}", status_code=200)
292285
def remove_pipeline_step(
293286
feature_set_id: str,
@@ -318,7 +311,6 @@ def remove_pipeline_step(
318311
df = pd.read_csv(file_path)
319312

320313
from core.feature_engine import apply_transformations
321-
322314
transformed_df, column_mapping = apply_transformations(df, steps)
323315

324316
feature_set.transformations = json.dumps(steps)
@@ -341,7 +333,6 @@ def remove_pipeline_step(
341333
# 9. Feature importance
342334
# ---------------------------------------------------------------------------
343335

344-
345336
@router.get("/{dataset_id}/importance")
346337
def get_feature_importance(
347338
dataset_id: str,
@@ -355,9 +346,7 @@ def get_feature_importance(
355346
type_result = detect_problem_type(df, target_column)
356347
problem_type = type_result.get("problem_type", "regression")
357348

358-
importance = compute_feature_importance(
359-
df, target_column, problem_type, column_stats
360-
)
349+
importance = compute_feature_importance(df, target_column, problem_type, column_stats)
361350

362351
return {
363352
"dataset_id": dataset_id,

0 commit comments

Comments
 (0)