Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ombhojane committed Sep 12, 2024
1 parent e7c7f53 commit cf50d52
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tests/test_xai_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import pytest
from explainableai import XAIWrapper
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier

@pytest.fixture
def sample_data():
# Create a simple dataset for testing
df = pd.DataFrame({
'feature1': np.random.rand(100),
'feature2': np.random.rand(100),
'target': np.random.randint(0, 2, 100)
})
X = df.drop('target', axis=1)
y = df['target']
df = pd.read_csv('datasets/cancer.csv')
X = df.drop('Cancer', axis=1)
y = df['Cancer']
return X, y

def test_xai_wrapper_initialization():
Expand All @@ -36,4 +30,4 @@ def test_xai_wrapper_analyze(sample_data):
xai.fit(model, X, y)
results = xai.analyze()
assert 'model_performance' in results
assert 'feature_importance' in results
assert 'feature_importance' in results

0 comments on commit cf50d52

Please sign in to comment.