validmind 2.7.6__py3-none-any.whl → 2.7.7__py3-none-any.whl
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.
- validmind/__init__.py +2 -0
- validmind/__version__.py +1 -1
- validmind/api_client.py +8 -1
- validmind/datasets/credit_risk/lending_club.py +3 -4
- validmind/html_templates/content_blocks.py +1 -1
- validmind/tests/__types__.py +17 -0
- validmind/tests/data_validation/ACFandPACFPlot.py +6 -2
- validmind/tests/data_validation/AutoMA.py +2 -2
- validmind/tests/data_validation/BivariateScatterPlots.py +4 -2
- validmind/tests/data_validation/BoxPierce.py +2 -2
- validmind/tests/data_validation/ClassImbalance.py +2 -1
- validmind/tests/data_validation/DatasetDescription.py +11 -2
- validmind/tests/data_validation/DatasetSplit.py +2 -2
- validmind/tests/data_validation/DickeyFullerGLS.py +2 -2
- validmind/tests/data_validation/FeatureTargetCorrelationPlot.py +8 -2
- validmind/tests/data_validation/HighCardinality.py +9 -2
- validmind/tests/data_validation/HighPearsonCorrelation.py +6 -2
- validmind/tests/data_validation/IQROutliersBarPlot.py +9 -2
- validmind/tests/data_validation/LaggedCorrelationHeatmap.py +2 -2
- validmind/tests/data_validation/MissingValuesBarPlot.py +12 -9
- validmind/tests/data_validation/MutualInformation.py +6 -8
- validmind/tests/data_validation/PearsonCorrelationMatrix.py +2 -2
- validmind/tests/data_validation/ProtectedClassesCombination.py +6 -1
- validmind/tests/data_validation/ProtectedClassesDescription.py +1 -1
- validmind/tests/data_validation/ProtectedClassesDisparity.py +4 -5
- validmind/tests/data_validation/ProtectedClassesThresholdOptimizer.py +1 -4
- validmind/tests/data_validation/RollingStatsPlot.py +21 -10
- validmind/tests/data_validation/ScatterPlot.py +3 -5
- validmind/tests/data_validation/ScoreBandDefaultRates.py +2 -1
- validmind/tests/data_validation/SeasonalDecompose.py +12 -2
- validmind/tests/data_validation/Skewness.py +6 -3
- validmind/tests/data_validation/SpreadPlot.py +8 -3
- validmind/tests/data_validation/TabularCategoricalBarPlots.py +4 -2
- validmind/tests/data_validation/TabularDateTimeHistograms.py +2 -2
- validmind/tests/data_validation/TargetRateBarPlots.py +4 -3
- validmind/tests/data_validation/TimeSeriesFrequency.py +7 -2
- validmind/tests/data_validation/TimeSeriesMissingValues.py +14 -10
- validmind/tests/data_validation/TimeSeriesOutliers.py +1 -5
- validmind/tests/data_validation/WOEBinPlots.py +2 -2
- validmind/tests/data_validation/WOEBinTable.py +11 -9
- validmind/tests/data_validation/nlp/CommonWords.py +2 -2
- validmind/tests/data_validation/nlp/Hashtags.py +2 -2
- validmind/tests/data_validation/nlp/LanguageDetection.py +9 -6
- validmind/tests/data_validation/nlp/Mentions.py +9 -6
- validmind/tests/data_validation/nlp/PolarityAndSubjectivity.py +2 -2
- validmind/tests/data_validation/nlp/Punctuations.py +4 -2
- validmind/tests/data_validation/nlp/Sentiment.py +2 -2
- validmind/tests/data_validation/nlp/StopWords.py +5 -4
- validmind/tests/data_validation/nlp/TextDescription.py +2 -2
- validmind/tests/data_validation/nlp/Toxicity.py +2 -2
- validmind/tests/model_validation/BertScore.py +2 -2
- validmind/tests/model_validation/BleuScore.py +2 -2
- validmind/tests/model_validation/ClusterSizeDistribution.py +2 -2
- validmind/tests/model_validation/ContextualRecall.py +2 -2
- validmind/tests/model_validation/FeaturesAUC.py +2 -2
- validmind/tests/model_validation/MeteorScore.py +2 -2
- validmind/tests/model_validation/ModelPredictionResiduals.py +2 -2
- validmind/tests/model_validation/RegardScore.py +6 -2
- validmind/tests/model_validation/RegressionResidualsPlot.py +4 -3
- validmind/tests/model_validation/RougeScore.py +6 -5
- validmind/tests/model_validation/TimeSeriesPredictionWithCI.py +11 -2
- validmind/tests/model_validation/TokenDisparity.py +2 -2
- validmind/tests/model_validation/ToxicityScore.py +10 -2
- validmind/tests/model_validation/embeddings/ClusterDistribution.py +9 -3
- validmind/tests/model_validation/embeddings/CosineSimilarityComparison.py +16 -2
- validmind/tests/model_validation/embeddings/CosineSimilarityDistribution.py +5 -3
- validmind/tests/model_validation/embeddings/CosineSimilarityHeatmap.py +2 -2
- validmind/tests/model_validation/embeddings/DescriptiveAnalytics.py +14 -4
- validmind/tests/model_validation/embeddings/EmbeddingsVisualization2D.py +2 -2
- validmind/tests/model_validation/embeddings/EuclideanDistanceComparison.py +16 -2
- validmind/tests/model_validation/embeddings/EuclideanDistanceHeatmap.py +2 -2
- validmind/tests/model_validation/embeddings/PCAComponentsPairwisePlots.py +4 -5
- validmind/tests/model_validation/embeddings/StabilityAnalysisKeyword.py +4 -2
- validmind/tests/model_validation/embeddings/StabilityAnalysisRandomNoise.py +4 -2
- validmind/tests/model_validation/embeddings/StabilityAnalysisSynonyms.py +4 -2
- validmind/tests/model_validation/embeddings/StabilityAnalysisTranslation.py +4 -2
- validmind/tests/model_validation/embeddings/TSNEComponentsPairwisePlots.py +8 -6
- validmind/tests/model_validation/embeddings/utils.py +11 -1
- validmind/tests/model_validation/ragas/AnswerCorrectness.py +2 -1
- validmind/tests/model_validation/ragas/AspectCritic.py +11 -7
- validmind/tests/model_validation/ragas/ContextEntityRecall.py +2 -1
- validmind/tests/model_validation/ragas/ContextPrecision.py +2 -1
- validmind/tests/model_validation/ragas/ContextPrecisionWithoutReference.py +2 -1
- validmind/tests/model_validation/ragas/ContextRecall.py +2 -1
- validmind/tests/model_validation/ragas/Faithfulness.py +2 -1
- validmind/tests/model_validation/ragas/NoiseSensitivity.py +2 -1
- validmind/tests/model_validation/ragas/ResponseRelevancy.py +2 -1
- validmind/tests/model_validation/ragas/SemanticSimilarity.py +2 -1
- validmind/tests/model_validation/sklearn/CalibrationCurve.py +3 -2
- validmind/tests/model_validation/sklearn/ClassifierThresholdOptimization.py +2 -5
- validmind/tests/model_validation/sklearn/ClusterCosineSimilarity.py +5 -2
- validmind/tests/model_validation/sklearn/ConfusionMatrix.py +2 -2
- validmind/tests/model_validation/sklearn/FeatureImportance.py +1 -14
- validmind/tests/model_validation/sklearn/HyperParametersTuning.py +6 -3
- validmind/tests/model_validation/sklearn/KMeansClustersOptimization.py +2 -2
- validmind/tests/model_validation/sklearn/MinimumROCAUCScore.py +8 -4
- validmind/tests/model_validation/sklearn/ModelParameters.py +1 -0
- validmind/tests/model_validation/sklearn/OverfitDiagnosis.py +3 -3
- validmind/tests/model_validation/sklearn/PermutationFeatureImportance.py +2 -2
- validmind/tests/model_validation/sklearn/PopulationStabilityIndex.py +20 -16
- validmind/tests/model_validation/sklearn/PrecisionRecallCurve.py +4 -2
- validmind/tests/model_validation/sklearn/ROCCurve.py +1 -1
- validmind/tests/model_validation/sklearn/RegressionR2Square.py +7 -9
- validmind/tests/model_validation/sklearn/RegressionR2SquareComparison.py +1 -3
- validmind/tests/model_validation/sklearn/SHAPGlobalImportance.py +2 -1
- validmind/tests/model_validation/sklearn/ScoreProbabilityAlignment.py +2 -1
- validmind/tests/model_validation/sklearn/SilhouettePlot.py +5 -3
- validmind/tests/model_validation/sklearn/TrainingTestDegradation.py +9 -1
- validmind/tests/model_validation/sklearn/WeakspotsDiagnosis.py +1 -1
- validmind/tests/model_validation/statsmodels/CumulativePredictionProbabilities.py +11 -4
- validmind/tests/model_validation/statsmodels/DurbinWatsonTest.py +1 -3
- validmind/tests/model_validation/statsmodels/GINITable.py +7 -15
- validmind/tests/model_validation/statsmodels/Lilliefors.py +2 -2
- validmind/tests/model_validation/statsmodels/RegressionCoeffs.py +1 -1
- validmind/tests/model_validation/statsmodels/RegressionFeatureSignificance.py +2 -2
- validmind/tests/model_validation/statsmodels/RegressionModelForecastPlotLevels.py +5 -2
- validmind/tests/model_validation/statsmodels/RegressionModelSensitivityPlot.py +5 -2
- validmind/tests/model_validation/statsmodels/RegressionModelSummary.py +7 -7
- validmind/tests/model_validation/statsmodels/RegressionPermutationFeatureImportance.py +2 -2
- validmind/tests/ongoing_monitoring/CalibrationCurveDrift.py +3 -1
- validmind/tests/ongoing_monitoring/ClassDiscriminationDrift.py +4 -2
- validmind/tests/ongoing_monitoring/ClassImbalanceDrift.py +4 -2
- validmind/tests/ongoing_monitoring/ClassificationAccuracyDrift.py +3 -1
- validmind/tests/ongoing_monitoring/ConfusionMatrixDrift.py +3 -1
- validmind/tests/ongoing_monitoring/CumulativePredictionProbabilitiesDrift.py +3 -1
- validmind/tests/ongoing_monitoring/FeatureDrift.py +1 -0
- validmind/tests/ongoing_monitoring/PredictionCorrelation.py +1 -0
- validmind/tests/ongoing_monitoring/PredictionProbabilitiesHistogramDrift.py +3 -1
- validmind/tests/ongoing_monitoring/PredictionQuantilesAcrossFeatures.py +1 -0
- validmind/tests/ongoing_monitoring/ROCCurveDrift.py +3 -2
- validmind/tests/ongoing_monitoring/ScoreBandsDrift.py +4 -2
- validmind/tests/ongoing_monitoring/ScorecardHistogramDrift.py +3 -1
- validmind/tests/ongoing_monitoring/TargetPredictionDistributionPlot.py +4 -3
- validmind/tests/prompt_validation/Bias.py +13 -9
- validmind/tests/prompt_validation/Clarity.py +13 -9
- validmind/tests/prompt_validation/Conciseness.py +13 -9
- validmind/tests/prompt_validation/Delimitation.py +13 -9
- validmind/tests/prompt_validation/NegativeInstruction.py +14 -11
- validmind/tests/prompt_validation/Robustness.py +6 -2
- validmind/tests/prompt_validation/Specificity.py +13 -9
- validmind/tests/run.py +6 -0
- validmind/utils.py +7 -8
- {validmind-2.7.6.dist-info → validmind-2.7.7.dist-info}/METADATA +1 -2
- {validmind-2.7.6.dist-info → validmind-2.7.7.dist-info}/RECORD +147 -147
- {validmind-2.7.6.dist-info → validmind-2.7.7.dist-info}/WHEEL +1 -1
- {validmind-2.7.6.dist-info → validmind-2.7.7.dist-info}/LICENSE +0 -0
- {validmind-2.7.6.dist-info → validmind-2.7.7.dist-info}/entry_points.txt +0 -0
@@ -2,12 +2,14 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import pandas as pd
|
6
8
|
import plotly.graph_objs as go
|
7
|
-
|
9
|
+
|
8
10
|
from validmind import tags, tasks
|
9
|
-
from validmind.vm_models import VMDataset
|
10
11
|
from validmind.errors import SkipTestError
|
12
|
+
from validmind.vm_models import VMDataset
|
11
13
|
|
12
14
|
|
13
15
|
@tags("tabular_data", "binary_classification", "multiclass_classification")
|
@@ -2,10 +2,12 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import numpy as np
|
6
8
|
import pandas as pd
|
7
9
|
from sklearn.metrics import classification_report
|
8
|
-
|
10
|
+
|
9
11
|
from validmind import tags, tasks
|
10
12
|
from validmind.vm_models import VMDataset, VMModel
|
11
13
|
|
@@ -2,10 +2,12 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import numpy as np
|
6
8
|
import pandas as pd
|
7
9
|
from sklearn.metrics import confusion_matrix
|
8
|
-
|
10
|
+
|
9
11
|
from validmind import tags, tasks
|
10
12
|
from validmind.vm_models import VMDataset, VMModel
|
11
13
|
|
@@ -2,10 +2,12 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import numpy as np
|
6
8
|
import plotly.graph_objects as go
|
7
9
|
from plotly.subplots import make_subplots
|
8
|
-
|
10
|
+
|
9
11
|
from validmind import tags, tasks
|
10
12
|
from validmind.vm_models import VMDataset, VMModel
|
11
13
|
|
@@ -2,12 +2,14 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import numpy as np
|
6
8
|
import pandas as pd
|
7
9
|
import plotly.graph_objects as go
|
8
10
|
from plotly.subplots import make_subplots
|
9
11
|
from scipy import stats
|
10
|
-
|
12
|
+
|
11
13
|
from validmind import tags, tasks
|
12
14
|
from validmind.vm_models import VMDataset, VMModel
|
13
15
|
|
@@ -2,15 +2,16 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import numpy as np
|
6
8
|
import plotly.graph_objects as go
|
7
9
|
from sklearn.metrics import roc_auc_score, roc_curve
|
10
|
+
|
8
11
|
from validmind import tags, tasks
|
9
12
|
from validmind.errors import SkipTestError
|
10
13
|
from validmind.vm_models import VMDataset, VMModel
|
11
14
|
|
12
|
-
from typing import List
|
13
|
-
|
14
15
|
|
15
16
|
@tags(
|
16
17
|
"sklearn",
|
@@ -2,9 +2,11 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
import pandas as pd
|
6
|
-
import numpy as np
|
7
5
|
from typing import List
|
6
|
+
|
7
|
+
import numpy as np
|
8
|
+
import pandas as pd
|
9
|
+
|
8
10
|
from validmind import tags, tasks
|
9
11
|
from validmind.vm_models import VMDataset, VMModel
|
10
12
|
|
@@ -2,12 +2,14 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
+
from typing import List
|
6
|
+
|
5
7
|
import numpy as np
|
6
8
|
import pandas as pd
|
7
9
|
import plotly.graph_objects as go
|
8
10
|
from plotly.subplots import make_subplots
|
9
11
|
from scipy import stats
|
10
|
-
|
12
|
+
|
11
13
|
from validmind import tags, tasks
|
12
14
|
from validmind.vm_models import VMDataset
|
13
15
|
|
@@ -2,10 +2,11 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
import plotly.graph_objects as go
|
6
|
-
import plotly.figure_factory as ff
|
7
5
|
import pandas as pd
|
8
|
-
|
6
|
+
import plotly.figure_factory as ff
|
7
|
+
import plotly.graph_objects as go
|
8
|
+
from scipy.stats import kurtosis, skew
|
9
|
+
|
9
10
|
from validmind import tags, tasks
|
10
11
|
|
11
12
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
from validmind import tags, tasks
|
5
|
+
from validmind import RawData, tags, tasks
|
6
6
|
from validmind.errors import MissingRequiredTestInputError
|
7
7
|
|
8
8
|
from .ai_powered_test import (
|
@@ -107,11 +107,15 @@ def Bias(model, min_threshold=7):
|
|
107
107
|
|
108
108
|
passed = score > min_threshold
|
109
109
|
|
110
|
-
return
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
return (
|
111
|
+
[
|
112
|
+
{
|
113
|
+
"Score": score,
|
114
|
+
"Explanation": explanation,
|
115
|
+
"Threshold": min_threshold,
|
116
|
+
"Pass/Fail": "Pass" if passed else "Fail",
|
117
|
+
}
|
118
|
+
],
|
119
|
+
passed,
|
120
|
+
RawData(response=response),
|
121
|
+
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
from validmind import tags, tasks
|
5
|
+
from validmind import RawData, tags, tasks
|
6
6
|
from validmind.errors import MissingRequiredTestInputError
|
7
7
|
|
8
8
|
from .ai_powered_test import (
|
@@ -96,11 +96,15 @@ def Clarity(model, min_threshold=7):
|
|
96
96
|
|
97
97
|
passed = score > min_threshold
|
98
98
|
|
99
|
-
return
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
99
|
+
return (
|
100
|
+
[
|
101
|
+
{
|
102
|
+
"Score": score,
|
103
|
+
"Explanation": explanation,
|
104
|
+
"Threshold": min_threshold,
|
105
|
+
"Pass/Fail": "Pass" if passed else "Fail",
|
106
|
+
}
|
107
|
+
],
|
108
|
+
passed,
|
109
|
+
RawData(response=response),
|
110
|
+
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
from validmind import tags, tasks
|
5
|
+
from validmind import RawData, tags, tasks
|
6
6
|
from validmind.errors import MissingRequiredTestInputError
|
7
7
|
|
8
8
|
from .ai_powered_test import (
|
@@ -103,11 +103,15 @@ def Conciseness(model, min_threshold=7):
|
|
103
103
|
|
104
104
|
passed = score > min_threshold
|
105
105
|
|
106
|
-
return
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
106
|
+
return (
|
107
|
+
[
|
108
|
+
{
|
109
|
+
"Score": score,
|
110
|
+
"Threshold": min_threshold,
|
111
|
+
"Explanation": explanation,
|
112
|
+
"Pass/Fail": "Pass" if passed else "Fail",
|
113
|
+
}
|
114
|
+
],
|
115
|
+
passed,
|
116
|
+
RawData(response=response),
|
117
|
+
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
from validmind import tags, tasks
|
5
|
+
from validmind import RawData, tags, tasks
|
6
6
|
from validmind.errors import MissingRequiredTestInputError
|
7
7
|
|
8
8
|
from .ai_powered_test import (
|
@@ -89,11 +89,15 @@ def Delimitation(model, min_threshold=7):
|
|
89
89
|
|
90
90
|
passed = score > min_threshold
|
91
91
|
|
92
|
-
return
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
92
|
+
return (
|
93
|
+
[
|
94
|
+
{
|
95
|
+
"Score": score,
|
96
|
+
"Threshold": min_threshold,
|
97
|
+
"Explanation": explanation,
|
98
|
+
"Pass/Fail": "Pass" if passed else "Fail",
|
99
|
+
}
|
100
|
+
],
|
101
|
+
passed,
|
102
|
+
RawData(response=response),
|
103
|
+
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
from validmind import tags, tasks
|
5
|
+
from validmind import RawData, tags, tasks
|
6
6
|
from validmind.errors import MissingRequiredTestInputError
|
7
7
|
|
8
8
|
from .ai_powered_test import (
|
@@ -106,13 +106,16 @@ def NegativeInstruction(model, min_threshold=7):
|
|
106
106
|
explanation = get_explanation(response)
|
107
107
|
|
108
108
|
passed = score > min_threshold
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
109
|
+
|
110
|
+
return (
|
111
|
+
[
|
112
|
+
{
|
113
|
+
"Score": score,
|
114
|
+
"Threshold": min_threshold,
|
115
|
+
"Explanation": explanation,
|
116
|
+
"Pass/Fail": "Pass" if passed else "Fail",
|
117
|
+
}
|
118
|
+
],
|
119
|
+
passed,
|
120
|
+
RawData(model_response=response),
|
121
|
+
)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
import pandas as pd
|
6
6
|
|
7
|
-
from validmind import tags, tasks
|
7
|
+
from validmind import RawData, tags, tasks
|
8
8
|
from validmind.errors import MissingRequiredTestInputError, SkipTestError
|
9
9
|
|
10
10
|
from .ai_powered_test import call_model, missing_prompt_message
|
@@ -127,4 +127,8 @@ def Robustness(model, dataset, num_tests=10):
|
|
127
127
|
for generated_input, response in zip(generated_inputs, responses)
|
128
128
|
]
|
129
129
|
|
130
|
-
return
|
130
|
+
return (
|
131
|
+
results,
|
132
|
+
all(result["Pass/Fail"] == "Pass" for result in results),
|
133
|
+
RawData(generated_inputs=generated_inputs, responses=responses),
|
134
|
+
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# See the LICENSE file in the root of this repository for details.
|
3
3
|
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
|
4
4
|
|
5
|
-
from validmind import tags, tasks
|
5
|
+
from validmind import RawData, tags, tasks
|
6
6
|
from validmind.errors import MissingRequiredTestInputError
|
7
7
|
|
8
8
|
from .ai_powered_test import (
|
@@ -103,11 +103,15 @@ def Specificity(model, min_threshold=7):
|
|
103
103
|
|
104
104
|
passed = score > min_threshold
|
105
105
|
|
106
|
-
return
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
106
|
+
return (
|
107
|
+
[
|
108
|
+
{
|
109
|
+
"Score": score,
|
110
|
+
"Threshold": min_threshold,
|
111
|
+
"Explanation": explanation,
|
112
|
+
"Pass/Fail": "Pass" if passed else "Fail",
|
113
|
+
}
|
114
|
+
],
|
115
|
+
passed,
|
116
|
+
RawData(response=response),
|
117
|
+
)
|
validmind/tests/run.py
CHANGED
@@ -7,6 +7,7 @@ import subprocess
|
|
7
7
|
import time
|
8
8
|
from datetime import datetime
|
9
9
|
from inspect import getdoc
|
10
|
+
import pprint
|
10
11
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
11
12
|
from uuid import uuid4
|
12
13
|
|
@@ -396,3 +397,8 @@ def run_test( # noqa: C901
|
|
396
397
|
result.show()
|
397
398
|
|
398
399
|
return result
|
400
|
+
|
401
|
+
|
402
|
+
def print_env():
|
403
|
+
e = _get_run_metadata()
|
404
|
+
pprint.pp(e)
|
validmind/utils.py
CHANGED
@@ -23,7 +23,6 @@ import seaborn as sns
|
|
23
23
|
from IPython.core import getipython
|
24
24
|
from IPython.display import HTML
|
25
25
|
from IPython.display import display as ipy_display
|
26
|
-
from latex2mathml.converter import convert
|
27
26
|
from matplotlib.axes._axes import _log as matplotlib_axes_logger
|
28
27
|
from numpy import ndarray
|
29
28
|
from sklearn.exceptions import UndefinedMetricWarning
|
@@ -491,7 +490,7 @@ def display(widget_or_html, syntax_highlighting=True, mathjax=True):
|
|
491
490
|
ipy_display(HTML(widget_or_html))
|
492
491
|
# if html we can auto-detect if we actually need syntax highlighting or MathJax
|
493
492
|
syntax_highlighting = 'class="language-' in widget_or_html
|
494
|
-
mathjax = "
|
493
|
+
mathjax = "math/tex" in widget_or_html
|
495
494
|
else:
|
496
495
|
ipy_display(widget_or_html)
|
497
496
|
|
@@ -510,20 +509,20 @@ def md_to_html(md: str, mathml=False) -> str:
|
|
510
509
|
)(md)
|
511
510
|
|
512
511
|
if not mathml:
|
513
|
-
# return the html as is (with latex that will be rendered by MathJax)
|
514
512
|
return html
|
515
513
|
|
516
|
-
# convert the latex to
|
514
|
+
# convert the latex to mathjax
|
517
515
|
math_block_pattern = re.compile(r'<div class="math">\$\$([\s\S]*?)\$\$</div>')
|
518
516
|
html = math_block_pattern.sub(
|
519
|
-
lambda match: "
|
517
|
+
lambda match: '<script type="math/tex; mode=display">{}</script>'.format(
|
518
|
+
match.group(1)
|
519
|
+
),
|
520
|
+
html,
|
520
521
|
)
|
521
522
|
|
522
523
|
inline_math_pattern = re.compile(r'<span class="math">\\\((.*?)\\\)</span>')
|
523
524
|
html = inline_math_pattern.sub(
|
524
|
-
lambda match: "
|
525
|
-
convert(match.group(1), display="inline")
|
526
|
-
),
|
525
|
+
lambda match: '<script type="math/tex">{}</script>'.format(match.group(1)),
|
527
526
|
html,
|
528
527
|
)
|
529
528
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: validmind
|
3
|
-
Version: 2.7.
|
3
|
+
Version: 2.7.7
|
4
4
|
Summary: ValidMind Library
|
5
5
|
License: Commercial License
|
6
6
|
Author: Andres Rodriguez
|
@@ -26,7 +26,6 @@ Requires-Dist: ipywidgets
|
|
26
26
|
Requires-Dist: kaleido (>=0.2.1,!=0.2.1.post1)
|
27
27
|
Requires-Dist: langchain-openai (>=0.1.8) ; extra == "all" or extra == "llm"
|
28
28
|
Requires-Dist: langdetect
|
29
|
-
Requires-Dist: latex2mathml (>=3.77.0)
|
30
29
|
Requires-Dist: llvmlite ; python_version >= "3.8" and python_full_version <= "3.11.0"
|
31
30
|
Requires-Dist: matplotlib
|
32
31
|
Requires-Dist: mistune (>=3.0.2,<4.0.0)
|