Add: Return outlier deals in analysis responses
Feature: - New parameter `include_outlier_deals` (default=True) in: - filter_deals_for_analysis() - calculate_deal_statistics() - get_valuation_comparables() MCP tool - get_deal_statistics() MCP tool Behavior: - When ON: response includes `outlier_deals` field with removed deals - LLM can see what was filtered out, answer questions about it - Maintains full transparency on outlier removal Terminology fixed: - "outlier_deals" = deals removed as outliers (clearer than "filtered_deals") - "filtered deals" = deals that PASSED filtering - Added to OutlierReport model All 311 tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -874,7 +874,10 @@ class GovmapClient:
|
||||
|
||||
# Statistics methods (delegate to statistics module)
|
||||
def calculate_deal_statistics(
|
||||
self, deals: List[Deal], iqr_multiplier: Optional[float] = None
|
||||
self,
|
||||
deals: List[Deal],
|
||||
iqr_multiplier: Optional[float] = None,
|
||||
include_outlier_deals: bool = True,
|
||||
) -> DealStatistics:
|
||||
"""
|
||||
Calculate statistical aggregations on deal data.
|
||||
@@ -884,11 +887,14 @@ class GovmapClient:
|
||||
Args:
|
||||
deals: List of Deal model instances
|
||||
iqr_multiplier: Override IQR multiplier for outlier detection (optional)
|
||||
include_outlier_deals: If True (default), include removed outliers in report
|
||||
|
||||
Returns:
|
||||
DealStatistics model with comprehensive metrics
|
||||
"""
|
||||
return statistics.calculate_deal_statistics(deals, iqr_multiplier=iqr_multiplier)
|
||||
return statistics.calculate_deal_statistics(
|
||||
deals, iqr_multiplier=iqr_multiplier, include_outlier_deals=include_outlier_deals
|
||||
)
|
||||
|
||||
def _calculate_std_dev(self, values: List[float]) -> float:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user