arize-phoenix 0.0.36__py3-none-any.whl → 0.0.38__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.
Potentially problematic release.
This version of arize-phoenix might be problematic. Click here for more details.
- arize_phoenix-0.0.38.dist-info/METADATA +445 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/RECORD +23 -22
- phoenix/__init__.py +1 -1
- phoenix/server/api/schema.py +4 -6
- phoenix/server/api/types/DataQualityMetric.py +1 -10
- phoenix/server/api/types/ExportEventsMutation.py +1 -4
- phoenix/server/api/types/Segments.py +6 -5
- phoenix/server/api/types/Span.py +20 -2
- phoenix/server/api/types/TimeSeries.py +1 -8
- phoenix/server/static/index.js +498 -471
- phoenix/session/session.py +5 -2
- phoenix/trace/fixtures.py +22 -1
- phoenix/trace/langchain/__init__.py +3 -0
- phoenix/{experimental/callbacks/langchain_tracer.py → trace/langchain/tracer.py} +102 -2
- phoenix/trace/llama_index/__init__.py +3 -0
- phoenix/{experimental/callbacks/llama_index_trace_callback_handler.py → trace/llama_index/callback.py} +35 -16
- phoenix/trace/semantic_conventions.py +2 -2
- phoenix/trace/span_json_decoder.py +0 -12
- phoenix/trace/trace_dataset.py +6 -1
- phoenix/trace/utils.py +1 -1
- arize_phoenix-0.0.36.dist-info/METADATA +0 -219
- phoenix/experimental/callbacks/__init__.py +0 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/WHEEL +0 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-0.0.36.dist-info → arize_phoenix-0.0.38.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: arize-phoenix
|
|
3
|
+
Version: 0.0.38
|
|
4
|
+
Summary: ML Observability in your notebook
|
|
5
|
+
Project-URL: Documentation, https://docs.arize.com/phoenix/
|
|
6
|
+
Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
|
|
7
|
+
Project-URL: Source, https://github.com/Arize-ai/phoenix
|
|
8
|
+
Author-email: Arize AI <phoenix-devs@arize.com>
|
|
9
|
+
License-Expression: Elastic-2.0
|
|
10
|
+
License-File: IP_NOTICE
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: Explainability,Monitoring,Observability
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Requires-Python: <3.12,>=3.8
|
|
19
|
+
Requires-Dist: hdbscan<1.0.0,>=0.8.33
|
|
20
|
+
Requires-Dist: numpy
|
|
21
|
+
Requires-Dist: pandas
|
|
22
|
+
Requires-Dist: protobuf<5.0,>=3.20
|
|
23
|
+
Requires-Dist: psutil
|
|
24
|
+
Requires-Dist: pyarrow
|
|
25
|
+
Requires-Dist: scikit-learn<1.3.0
|
|
26
|
+
Requires-Dist: scipy
|
|
27
|
+
Requires-Dist: sortedcontainers
|
|
28
|
+
Requires-Dist: starlette
|
|
29
|
+
Requires-Dist: strawberry-graphql==0.208.2
|
|
30
|
+
Requires-Dist: typing-extensions
|
|
31
|
+
Requires-Dist: umap-learn
|
|
32
|
+
Requires-Dist: uvicorn
|
|
33
|
+
Requires-Dist: wrapt
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: arize[autoembeddings,llm-evaluation]; extra == 'dev'
|
|
36
|
+
Requires-Dist: black[jupyter]; extra == 'dev'
|
|
37
|
+
Requires-Dist: gcsfs; extra == 'dev'
|
|
38
|
+
Requires-Dist: hatch; extra == 'dev'
|
|
39
|
+
Requires-Dist: jupyter; extra == 'dev'
|
|
40
|
+
Requires-Dist: nbqa; extra == 'dev'
|
|
41
|
+
Requires-Dist: pandas-stubs<=2.0.2.230605; extra == 'dev'
|
|
42
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest-lazy-fixture; extra == 'dev'
|
|
46
|
+
Requires-Dist: ruff==0.0.290; extra == 'dev'
|
|
47
|
+
Requires-Dist: strawberry-graphql[debug-server]==0.208.2; extra == 'dev'
|
|
48
|
+
Provides-Extra: experimental
|
|
49
|
+
Requires-Dist: openai; extra == 'experimental'
|
|
50
|
+
Requires-Dist: tenacity; extra == 'experimental'
|
|
51
|
+
Provides-Extra: langchain
|
|
52
|
+
Requires-Dist: langchain>=0.0.293; extra == 'langchain'
|
|
53
|
+
Provides-Extra: llama-index
|
|
54
|
+
Requires-Dist: llama-index>=0.8.29; extra == 'llama-index'
|
|
55
|
+
Description-Content-Type: text/markdown
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<a target="_blank" href="https://phoenix.arize.com" style="background:none">
|
|
59
|
+
<img alt="phoenix logo" src="https://storage.googleapis.com/arize-assets/phoenix/assets/phoenix-logo-light.svg" width="auto" height="200"></img>
|
|
60
|
+
</a>
|
|
61
|
+
<br/>
|
|
62
|
+
<br/>
|
|
63
|
+
<a href="https://docs.arize.com/phoenix/">
|
|
64
|
+
<img src="https://img.shields.io/static/v1?message=Docs&logo=data:image/png;base64,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&labelColor=grey&color=blue&logoColor=white&label=%20"/>
|
|
65
|
+
</a>
|
|
66
|
+
<a target="_blank" href="https://join.slack.com/t/arize-ai/shared_invite/zt-1px8dcmlf-fmThhDFD_V_48oU7ALan4Q">
|
|
67
|
+
<img src="https://img.shields.io/static/v1?message=Community&logo=slack&labelColor=grey&color=blue&logoColor=white&label=%20"/>
|
|
68
|
+
</a>
|
|
69
|
+
<a target="_blank" href="https://twitter.com/ArizePhoenix">
|
|
70
|
+
<img src="https://img.shields.io/badge/-ArizePhoenix-blue.svg?color=blue&labelColor=gray&logo=twitter">
|
|
71
|
+
</a>
|
|
72
|
+
<a target="_blank" href="https://pypi.org/project/arize-phoenix/">
|
|
73
|
+
<img src="https://img.shields.io/pypi/v/arize-phoenix?color=blue">
|
|
74
|
+
</a>
|
|
75
|
+
<a target="_blank" href="https://anaconda.org/conda-forge/arize-phoenix">
|
|
76
|
+
<img src="https://img.shields.io/conda/vn/conda-forge/arize-phoenix.svg?color=blue">
|
|
77
|
+
</a>
|
|
78
|
+
<a target="_blank" href="https://pypi.org/project/arize-phoenix/">
|
|
79
|
+
<img src="https://img.shields.io/pypi/pyversions/arize-phoenix">
|
|
80
|
+
</a>
|
|
81
|
+
</p>
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
Phoenix provides MLOps and LLMOps insights at lightning speed with zero-config observability. Phoenix provides a notebook-first experience for monitoring your models and LLM Applications by providing:
|
|
86
|
+
|
|
87
|
+
- **LLM App Tracing** - Trace through the execution of your LLM Application to understand the internals of your LLM Application and to troubleshoot problems related to things like retrieval and tool execution.
|
|
88
|
+
- **LLM Evals** - Leverage the power of large language models to evaluate your generative model or application's relevance, toxicity, and more.
|
|
89
|
+
- **Embedding Analysis** - Explore embedding point-clouds and identify clusters of high drift and performance degradation.
|
|
90
|
+
- **RAG Introspection** - Visualize your generative application's search and retrieval process to solve improve your retrieval augmented generation.
|
|
91
|
+
- **Structured Data Analysis** - Statistically analyze your structured data by performing A/B analysis, temporal drift analysis, and more.
|
|
92
|
+
|
|
93
|
+
**Table of Contents**
|
|
94
|
+
|
|
95
|
+
- [Installation](#installation)
|
|
96
|
+
- [LLM App Tracing](#llm-app-tracing)
|
|
97
|
+
- [Tracing with LlamaIndex](#tracing-with-llamaindex)
|
|
98
|
+
- [Tracing with LangChain](#tracing-with-langchain)
|
|
99
|
+
- [LLM Evals](#llm-evals)
|
|
100
|
+
- [Embedding Analysis](#embedding-analysis)
|
|
101
|
+
- [UMAP-based Exploratory Data Analysis](#umap-based-exploratory-data-analysis)
|
|
102
|
+
- [Cluster-driven Drift and Performance Analysis](#cluster-driven-drift-and-performance-analysis)
|
|
103
|
+
- [Exportable Clusters](#exportable-clusters)
|
|
104
|
+
- [RAG Introspection](#rag-introspection)
|
|
105
|
+
- [Structured Data Analysis](#structured-data-analysis)
|
|
106
|
+
- [Community](#community)
|
|
107
|
+
- [Thanks](#thanks)
|
|
108
|
+
- [Copyright, Patent, and License](#copyright-patent-and-license)
|
|
109
|
+
|
|
110
|
+
## Installation
|
|
111
|
+
|
|
112
|
+
Install Phoenix via `pip` or or `conda` as well as any of its subpackages.
|
|
113
|
+
|
|
114
|
+
```shell
|
|
115
|
+
pip install arize-phoenix
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Some functionality such as LLM evals are under the `experimental` subpackage.
|
|
119
|
+
|
|
120
|
+
```shell
|
|
121
|
+
pip install arize-phoenix[experimental]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## LLM App Tracing
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+
With the advent of powerful LLMs, it is now possible to build LLM Applications that can perform complex tasks like summarization, translation, question and answering, and more. However, these applications are often difficult to debug and troubleshoot as they have an extensive surface area: search and retrieval via vector stores, embedding generation, usage of external tools and so on. Phoenix provides a tracing framework that allows you to trace through the execution of your LLM Application hierarchically. This allows you to understand the internals of your LLM Application and to troubleshoot the complex components of your applicaition. Phoenix is built on top of the OpenInference tracing standard and uses it to trace, export, and collect critical information about your LLM Application in the form of `spans`. For more details on the OpenInference tracing standard, see the [OpenInference Specification](https://github.com/Arize-ai/open-inference-spec)
|
|
129
|
+
|
|
130
|
+
### Tracing with LlamaIndex
|
|
131
|
+
|
|
132
|
+
[](https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/tracing/llama_index_tracing_tutorial) [](https://github.com/Arize-ai/phoenix/blob/main/tutorials/tracing/llama_index_tracing_tutorial)
|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
To extract traces from your LlamaIndex application, you will have to add Phoenix's `OpenInferenceTraceCallback` to your LlamaIndex application. A callback (in this case an OpenInference `Tracer`) is a class that automatically accumulates `spans` that trac your application as it executes. The OpenInference `Tracer` is a tracer that is specifically designed to work with Phoenix and by default exports the traces to a locally running phoenix server.
|
|
137
|
+
|
|
138
|
+
```shell
|
|
139
|
+
# Install phoenix as well as llama_index and your LLM of choice
|
|
140
|
+
pip install arize-phoenix llama-index openai
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Launch Phoenix in a notebook and view the traces of your LlamaIndex application in the Phoenix UI.
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
import phoenix as px
|
|
148
|
+
|
|
149
|
+
# To view traces in Phoenix, you will first have to start a Phoenix server. You can do this by running the following:
|
|
150
|
+
session = px.launch_app()
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
# Once you have started a Phoenix server, you can start your LlamaIndex application with the `OpenInferenceTraceCallback` as a callback. To do this, you will have to add the callback to the initialization of your LlamaIndex application:
|
|
154
|
+
|
|
155
|
+
from phoenix.trace.llama_index import (
|
|
156
|
+
OpenInferenceTraceCallbackHandler,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
# Initialize the callback handler
|
|
160
|
+
callback_handler = OpenInferenceTraceCallbackHandler()
|
|
161
|
+
|
|
162
|
+
# LlamaIndex application initialization may vary
|
|
163
|
+
# depending on your application
|
|
164
|
+
service_context = ServiceContext.from_defaults(
|
|
165
|
+
llm_predictor=LLMPredictor(llm=ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0)),
|
|
166
|
+
embed_model=OpenAIEmbedding(model="text-embedding-ada-002"),
|
|
167
|
+
callback_manager=CallbackManager(handlers=[callback_handler]),
|
|
168
|
+
)
|
|
169
|
+
index = load_index_from_storage(
|
|
170
|
+
storage_context,
|
|
171
|
+
service_context=service_context,
|
|
172
|
+
)
|
|
173
|
+
query_engine = index.as_query_engine()
|
|
174
|
+
|
|
175
|
+
# Query your LlamaIndex application
|
|
176
|
+
query_engine.query("What is the meaning of life?")
|
|
177
|
+
query_engine.query("Why did the cow jump over the moon?")
|
|
178
|
+
|
|
179
|
+
# View the traces in the Phoenix UI
|
|
180
|
+
px.active_session().url
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Tracing with LangChain
|
|
184
|
+
|
|
185
|
+
[](https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/tracing/langchain_tracing_tutorial) [](https://github.com/Arize-ai/phoenix/blob/main/tutorials/tracing/langchain_tracing_tutorial)
|
|
186
|
+
|
|
187
|
+
To extract traces from your LangChain application, you will have to add Phoenix's OpenInference Tracer to your LangChain application. A tracer is a class that automatically accumulates traces as your application executes. The OpenInference Tracer is a tracer that is specifically designed to work with Phoenix and by default exports the traces to a locally running phoenix server.
|
|
188
|
+
|
|
189
|
+
```shell
|
|
190
|
+
# Install phoenix as well as langchain and your LLM of choice
|
|
191
|
+
pip install arize-phoenix langchain openai
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Launch Phoenix in a notebook and view the traces of your LangChain application in the Phoenix UI.
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import phoenix as px
|
|
199
|
+
import pandas as pd
|
|
200
|
+
|
|
201
|
+
# Launch phoenix
|
|
202
|
+
session = px.launch_app()
|
|
203
|
+
|
|
204
|
+
# Once you have started a Phoenix server, you can start your LangChain application with the OpenInference Tracer as a callback. To do this, you will have to add the tracer to the initialization of your LangChain application:
|
|
205
|
+
|
|
206
|
+
from phoenix.trace.langchain import OpenInferenceTracer
|
|
207
|
+
|
|
208
|
+
# If no exporter is specified, the tracer will export to the locally running Phoenix server
|
|
209
|
+
tracer = OpenInferenceTracer()
|
|
210
|
+
|
|
211
|
+
# Initialize your LangChain application
|
|
212
|
+
from langchain.chains import RetrievalQA
|
|
213
|
+
from langchain.chat_models import ChatOpenAI
|
|
214
|
+
from langchain.embeddings import OpenAIEmbeddings
|
|
215
|
+
from langchain.retrievers import KNNRetriever
|
|
216
|
+
|
|
217
|
+
embeddings = OpenAIEmbeddings(model="text-embedding-ada-002")
|
|
218
|
+
documents_df = pd.read_parquet(
|
|
219
|
+
"http://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/llm/context-retrieval/langchain-pinecone/database.parquet"
|
|
220
|
+
)
|
|
221
|
+
knn_retriever = KNNRetriever(
|
|
222
|
+
index=np.stack(df["text_vector"]),
|
|
223
|
+
texts=documents_df["text"].tolist(),
|
|
224
|
+
embeddings=OpenAIEmbeddings(),
|
|
225
|
+
)
|
|
226
|
+
chain_type = "stuff" # stuff, refine, map_reduce, and map_rerank
|
|
227
|
+
chat_model_name = "gpt-3.5-turbo"
|
|
228
|
+
llm = ChatOpenAI(model_name=chat_model_name)
|
|
229
|
+
chain = RetrievalQA.from_chain_type(
|
|
230
|
+
llm=llm,
|
|
231
|
+
chain_type=chain_type,
|
|
232
|
+
retriever=knn_retriever,
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
# Instrument the execution of the runs with the tracer. By default the tracer uses an HTTPExporter
|
|
236
|
+
query = "What is euclidean distance?"
|
|
237
|
+
response = chain.run(query, callbacks=[tracer])
|
|
238
|
+
|
|
239
|
+
# By adding the tracer to the callbacks of LangChain, we've created a one-way data connection between your LLM application and Phoenix.
|
|
240
|
+
|
|
241
|
+
# To view the traces in Phoenix, simply open the UI in your browser.
|
|
242
|
+
session.url
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## LLM Evals
|
|
246
|
+
|
|
247
|
+
🚧 LLM Evals is still under construction under a sub-module `arize-phoenix[experimental]`
|
|
248
|
+
|
|
249
|
+
[](https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/evals/evaluate_relevance_classifications.ipynb) [](https://github.com/Arize-ai/phoenix/blob/main/tutorials/evals/evaluate_relevance_classifications.ipynb)
|
|
250
|
+
|
|
251
|
+
Phoenix provides tooling to evaluate LLM applications, including tools to determine the relevance or irrelevance of documents retrieved by retrieval-augmented generation (RAG) application, whether or not the response is toxic, and much more.
|
|
252
|
+
|
|
253
|
+
Phoenix's approach to LLM evals is notable for the following reasons:
|
|
254
|
+
|
|
255
|
+
- Includes pre-tested templates and convenience functions for a set of common Eval “tasks”
|
|
256
|
+
- Data science rigor applied to the testing of model and template combinations
|
|
257
|
+
- Designed to run as fast as possible on batches of data
|
|
258
|
+
- Includes benchmark datasets and tests for each eval function
|
|
259
|
+
|
|
260
|
+
Here is an example of running the RAG relevance eval on a dataset of Wikipedia questions and answers:
|
|
261
|
+
|
|
262
|
+
```shell
|
|
263
|
+
# Install phoenix as well as the experimental subpackage
|
|
264
|
+
pip install -qq arize-phoenix[experimental] ipython matplotlib openai pycm scikit-learn
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
from phoenix.experimental.evals import (
|
|
269
|
+
RAG_RELEVANCY_PROMPT_TEMPLATE_STR,
|
|
270
|
+
RAG_RELEVANCY_PROMPT_RAILS_MAP,
|
|
271
|
+
OpenAIModel,
|
|
272
|
+
download_benchmark_dataset,
|
|
273
|
+
llm_eval_binary,
|
|
274
|
+
)
|
|
275
|
+
from sklearn.metrics import precision_recall_fscore_support, confusion_matrix, ConfusionMatrixDisplay
|
|
276
|
+
|
|
277
|
+
# Download the benchmark golden dataset
|
|
278
|
+
df = download_benchmark_dataset(
|
|
279
|
+
task="binary-relevance-classification", dataset_name="wiki_qa-train"
|
|
280
|
+
)
|
|
281
|
+
# Sample and re-name the columns to match the template
|
|
282
|
+
df = df.sample(100)
|
|
283
|
+
df = df.rename(
|
|
284
|
+
columns={
|
|
285
|
+
"query_text": "query",
|
|
286
|
+
"document_text": "reference",
|
|
287
|
+
},
|
|
288
|
+
)
|
|
289
|
+
model = OpenAIModel(
|
|
290
|
+
model_name="gpt-4",
|
|
291
|
+
temperature=0.0,
|
|
292
|
+
)
|
|
293
|
+
rails =list(RAG_RELEVANCY_PROMPT_RAILS_MAP.values())
|
|
294
|
+
df["eval_relevance"] = llm_eval_binary(df, RAG_RELEVANCY_PROMPT_TEMPLATE_STR, model, rails)
|
|
295
|
+
#Golden dataset has True/False map to -> "irrelevant" / "relevant"
|
|
296
|
+
#we can then scikit compare to output of template - same format
|
|
297
|
+
y_true = df["relevant"].map({True: "relevant", False: "irrelevant"})
|
|
298
|
+
y_pred = df["eval_relevance"]
|
|
299
|
+
|
|
300
|
+
# Compute Per-Class Precision, Recall, F1 Score, Support
|
|
301
|
+
precision, recall, f1, support = precision_recall_fscore_support(y_true, y_pred)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
To learn more about LLM Evals, see the [LLM Evals documentation](https://docs.arize.com/phoenix/concepts/llm-evals/).
|
|
305
|
+
|
|
306
|
+
## Embedding Analysis
|
|
307
|
+
|
|
308
|
+
[](https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/image_classification_tutorial.ipynb) [](https://github.com/Arize-ai/phoenix/blob/main/tutorials/image_classification_tutorial.ipynb)
|
|
309
|
+
|
|
310
|
+
Explore UMAP point-clouds at times of high drift and performance degredation and identify clusters of problematic data.
|
|
311
|
+
|
|
312
|
+

|
|
313
|
+
|
|
314
|
+
Embedding analysis is critical for understanding the behavior of you NLP, CV, and LLM Apps that use embeddings. Phoenix provides an A/B testing framework to help you understand how your embeddings are changing over time and how they are changing between different versions of your model (`prod` vs `train`, `champion` vs `challenger`).
|
|
315
|
+
|
|
316
|
+
```python
|
|
317
|
+
# Import libraries.
|
|
318
|
+
from dataclasses import replace
|
|
319
|
+
import pandas as pd
|
|
320
|
+
import phoenix as px
|
|
321
|
+
|
|
322
|
+
# Download curated datasets and load them into pandas DataFrames.
|
|
323
|
+
train_df = pd.read_parquet(
|
|
324
|
+
"https://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/cv/human-actions/human_actions_training.parquet"
|
|
325
|
+
)
|
|
326
|
+
prod_df = pd.read_parquet(
|
|
327
|
+
"https://storage.googleapis.com/arize-assets/phoenix/datasets/unstructured/cv/human-actions/human_actions_production.parquet"
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
# Define schemas that tell Phoenix which columns of your DataFrames correspond to features, predictions, actuals (i.e., ground truth), embeddings, etc.
|
|
331
|
+
train_schema = px.Schema(
|
|
332
|
+
prediction_id_column_name="prediction_id",
|
|
333
|
+
timestamp_column_name="prediction_ts",
|
|
334
|
+
prediction_label_column_name="predicted_action",
|
|
335
|
+
actual_label_column_name="actual_action",
|
|
336
|
+
embedding_feature_column_names={
|
|
337
|
+
"image_embedding": px.EmbeddingColumnNames(
|
|
338
|
+
vector_column_name="image_vector",
|
|
339
|
+
link_to_data_column_name="url",
|
|
340
|
+
),
|
|
341
|
+
},
|
|
342
|
+
)
|
|
343
|
+
prod_schema = replace(train_schema, actual_label_column_name=None)
|
|
344
|
+
|
|
345
|
+
# Define your production and training datasets.
|
|
346
|
+
prod_ds = px.Dataset(prod_df, prod_schema)
|
|
347
|
+
train_ds = px.Dataset(train_df, train_schema)
|
|
348
|
+
|
|
349
|
+
# Launch Phoenix.
|
|
350
|
+
session = px.launch_app(prod_ds, train_ds)
|
|
351
|
+
|
|
352
|
+
# View the Phoenix UI in the browser
|
|
353
|
+
session.url
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### UMAP-based Exploratory Data Analysis
|
|
357
|
+
|
|
358
|
+
Color your UMAP point-clouds by your model's dimensions, drift, and performance to identify problematic cohorts.
|
|
359
|
+
|
|
360
|
+

|
|
361
|
+
|
|
362
|
+
### Cluster-driven Drift and Performance Analysis
|
|
363
|
+
|
|
364
|
+
Break-apart your data into clusters of high drift or bad performance using HDBSCAN
|
|
365
|
+
|
|
366
|
+

|
|
367
|
+
|
|
368
|
+
### Exportable Clusters
|
|
369
|
+
|
|
370
|
+
Export your clusters to `parquet` files or dataframes for further analysis and fine-tuning.
|
|
371
|
+
|
|
372
|
+
## RAG Introspection
|
|
373
|
+
|
|
374
|
+
[](https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/llama_index_search_and_retrieval_tutorial.ipynb) [](https://github.com/Arize-ai/phoenix/blob/main/tutorials/llama_index_search_and_retrieval_tutorial.ipynb)
|
|
375
|
+
|
|
376
|
+

|
|
377
|
+
|
|
378
|
+
Search and retrieval is a critical component of many LLM Applications as it allows you to extend the LLM's capabilities to encompass knowledge about private data. This process is known as RAG (retrieval augmented generation) and often times a vector store is leveraged to store chunks of documents encoded as embeddings so that they can be retrieved at inference time.
|
|
379
|
+
|
|
380
|
+
To help you better understand your RAG application, Phoenix allows you to upload a corpus of your knowledge base along with your LLM application's inferences to help you troubleshoot hard to find bugs with retrieval.
|
|
381
|
+
|
|
382
|
+
## Structured Data Analysis
|
|
383
|
+
|
|
384
|
+
[](https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/cc_fraud_tutorial.ipynb) [](https://github.com/Arize-ai/phoenix/blob/main/tutorials/cc_fraud_tutorial.ipynb)
|
|
385
|
+
|
|
386
|
+
Phoenix provides a suite of tools for analyzing structured data. These tools allow you to perform A/B analysis, temporal drift analysis, and more.
|
|
387
|
+
|
|
388
|
+

|
|
389
|
+
|
|
390
|
+
```python
|
|
391
|
+
import pandas as pd
|
|
392
|
+
import phoenix as px
|
|
393
|
+
|
|
394
|
+
# Perform A/B analysis on your training and production datasets
|
|
395
|
+
train_df = pd.read_parquet(
|
|
396
|
+
"http://storage.googleapis.com/arize-assets/phoenix/datasets/structured/credit-card-fraud/credit_card_fraud_train.parquet",
|
|
397
|
+
)
|
|
398
|
+
prod_df = pd.read_parquet(
|
|
399
|
+
"http://storage.googleapis.com/arize-assets/phoenix/datasets/structured/credit-card-fraud/credit_card_fraud_production.parquet",
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
# Describe the data for analysis
|
|
403
|
+
schema = px.Schema(
|
|
404
|
+
prediction_id_column_name="prediction_id",
|
|
405
|
+
prediction_label_column_name="predicted_label",
|
|
406
|
+
prediction_score_column_name="predicted_score",
|
|
407
|
+
actual_label_column_name="actual_label",
|
|
408
|
+
timestamp_column_name="prediction_timestamp",
|
|
409
|
+
feature_column_names=feature_column_names,
|
|
410
|
+
tag_column_names=["age"],
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
# Define your production and training datasets.
|
|
414
|
+
prod_ds = px.Dataset(dataframe=prod_df, schema=schema, name="production")
|
|
415
|
+
train_ds = px.Dataset(dataframe=train_df, schema=schema, name="training")
|
|
416
|
+
|
|
417
|
+
# Launch Phoenix for analysis
|
|
418
|
+
session = px.launch_app(primary=prod_ds, reference=train_ds)
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Community
|
|
422
|
+
|
|
423
|
+
Join our community to connect with thousands of machine learning practitioners and ML observability enthusiasts.
|
|
424
|
+
|
|
425
|
+
- 🌍 Join our [Slack community](https://join.slack.com/t/arize-ai/shared_invite/zt-1px8dcmlf-fmThhDFD_V_48oU7ALan4Q).
|
|
426
|
+
- 💡 Ask questions and provide feedback in the _#phoenix-support_ channel.
|
|
427
|
+
- 🌟 Leave a star on our [GitHub](https://github.com/Arize-ai/phoenix).
|
|
428
|
+
- 🐞 Report bugs with [GitHub Issues](https://github.com/Arize-ai/phoenix/issues).
|
|
429
|
+
- 🐣 Follow us on [twitter](https://twitter.com/ArizePhoenix).
|
|
430
|
+
- 💌️ Sign up for our [mailing list](https://phoenix.arize.com/#updates).
|
|
431
|
+
- 🗺️ Check out our [roadmap](https://github.com/orgs/Arize-ai/projects/45) to see where we're heading next.
|
|
432
|
+
- 🎓 Learn the fundamentals of ML observability with our [introductory](https://arize.com/ml-observability-fundamentals/) and [advanced](https://arize.com/blog-course/) courses.
|
|
433
|
+
|
|
434
|
+
## Thanks
|
|
435
|
+
|
|
436
|
+
- [UMAP](https://github.com/lmcinnes/umap) For unlocking the ability to visualize and reason about embeddings
|
|
437
|
+
- [HDBSCAN](https://github.com/scikit-learn-contrib/hdbscan) For providing a clustering algorithm to aid in the discovery of drift and performance degradation
|
|
438
|
+
|
|
439
|
+
## Copyright, Patent, and License
|
|
440
|
+
|
|
441
|
+
Copyright 2023 Arize AI, Inc. All Rights Reserved.
|
|
442
|
+
|
|
443
|
+
Portions of this code are patent protected by one or more U.S. Patents. See [IP_NOTICE](https://github.com/Arize-ai/phoenix/blob/main/IP_NOTICE).
|
|
444
|
+
|
|
445
|
+
This software is licensed under the terms of the Elastic License 2.0 (ELv2). See [LICENSE](https://github.com/Arize-ai/phoenix/blob/main/LICENSE).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
phoenix/__init__.py,sha256=
|
|
1
|
+
phoenix/__init__.py,sha256=6M-W6FTH8hB2ENNvRPJHoA-2dYbKSx4GdJWjyKAS3xU,1255
|
|
2
2
|
phoenix/config.py,sha256=TdMKmU7V490I38x_hvB1s14Y8pV3ldLSpJTKq6crzBY,1952
|
|
3
3
|
phoenix/datetime_utils.py,sha256=D955QLrkgrrSdUM6NyqbCeAu2SMsjhR5rHVQEsVUdng,2773
|
|
4
4
|
phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
@@ -16,9 +16,6 @@ phoenix/datasets/fixtures.py,sha256=0_PacL3dw49zulKpFpPdhvxJxeGmHTguqIyf2VXkBkk,
|
|
|
16
16
|
phoenix/datasets/schema.py,sha256=bF1d2Md6NyqQZuC4Ym5A52f2_IcazkyxGFZ11HPqSg0,6668
|
|
17
17
|
phoenix/datasets/validation.py,sha256=dZ9lCFUV0EY7HCkQkQBrs-GLAEIZdpOqUxwD5l4dp88,8294
|
|
18
18
|
phoenix/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
phoenix/experimental/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
phoenix/experimental/callbacks/langchain_tracer.py,sha256=nOsOGqHkEfsjsy4gWVv4g0VZmOW3oA6zltTK7ck942U,7987
|
|
21
|
-
phoenix/experimental/callbacks/llama_index_trace_callback_handler.py,sha256=KFFs3hhz1izwjQ2KeZimYeU5OYEVFhHpc32xOhzS7yc,13885
|
|
22
19
|
phoenix/experimental/evals/__init__.py,sha256=mwenceVtegsXNSQlFRdrceRLQ6wHFL8Nhf3C9AfQ_40,1088
|
|
23
20
|
phoenix/experimental/evals/retrievals.py,sha256=B5M2OUXDNpRa6n-QSVXDiRmmJp8YODTff1XPMBTprp4,3822
|
|
24
21
|
phoenix/experimental/evals/utils.py,sha256=ivrYuX5Xotjh12BWOpYk9O7TgOt8uGDfdnRpYfrybmQ,1102
|
|
@@ -56,7 +53,7 @@ phoenix/server/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
56
53
|
phoenix/server/api/context.py,sha256=wjCzq4QlszKG1iN-xgu5rRLYPqdvTFqX02aFYPipNoQ,512
|
|
57
54
|
phoenix/server/api/helpers.py,sha256=_V1eVkchZmTkhOfRC4QqR1sUB2xtIxdsMJkDouZq_IE,251
|
|
58
55
|
phoenix/server/api/interceptor.py,sha256=do_J4HjPPQ_C7bMmqe1YpTmt_hoxcwC2I8P3n5sZBo4,1302
|
|
59
|
-
phoenix/server/api/schema.py,sha256=
|
|
56
|
+
phoenix/server/api/schema.py,sha256=mJDes7_z-Rpv1sJeJuxQnf1yoBNqaZ0YNEwmV0s5L4s,9230
|
|
60
57
|
phoenix/server/api/input_types/ClusterInput.py,sha256=EL4ftvZxQ8mVdruUPcdhMhByORmSmM8S-X6RPqU6GX0,179
|
|
61
58
|
phoenix/server/api/input_types/Coordinates.py,sha256=meTwbIjwTfqx5DGD2DBlH9wQzdQVNM5a8x9dp1FfIgA,173
|
|
62
59
|
phoenix/server/api/input_types/DataQualityMetricInput.py,sha256=LazvmQCCM5m9SDZTpyxQXO1rYF4cmsc3lsR2S9S65X4,1292
|
|
@@ -68,7 +65,7 @@ phoenix/server/api/input_types/SpanSort.py,sha256=YVymSc6iEVWj9E5jUgnugJDcz65XKF
|
|
|
68
65
|
phoenix/server/api/input_types/TimeRange.py,sha256=yzx-gxj8mDeGLft1FzU_x1MVEgIG5Pt6-f8PUVDgipQ,522
|
|
69
66
|
phoenix/server/api/input_types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
67
|
phoenix/server/api/types/Cluster.py,sha256=R08ZKrLl1KK8colxHU57N5XIOTMUwg5ZI50ofPoxxSM,5618
|
|
71
|
-
phoenix/server/api/types/DataQualityMetric.py,sha256=
|
|
68
|
+
phoenix/server/api/types/DataQualityMetric.py,sha256=zRKsNvHBu-NdcsunuLhqFpZhi6ks-HMqA1PJD27jTak,590
|
|
72
69
|
phoenix/server/api/types/Dataset.py,sha256=sqfsJm10SSjXqTAfP8uoQV737hldU6Hj0lrH3KZFiSM,3102
|
|
73
70
|
phoenix/server/api/types/DatasetInfo.py,sha256=S8mkmt85GUJoNQOhFuNWboQcpdV7gdwVCcXcJbEKTgw,346
|
|
74
71
|
phoenix/server/api/types/DatasetRole.py,sha256=UA8ecelVWfa9BVi--4A9fGhKFQ-jAaNHm7H5BpmZBPw,564
|
|
@@ -82,7 +79,7 @@ phoenix/server/api/types/EmbeddingDimension.py,sha256=GHGpx4D9TSpcdaQ7FMmKMtCu2M
|
|
|
82
79
|
phoenix/server/api/types/EmbeddingMetadata.py,sha256=fJvNNYCbkf3SJalArLy9rcBq9Uj1SNac60zjqe1PFnM,461
|
|
83
80
|
phoenix/server/api/types/Event.py,sha256=5ohMNtXxE7Oy4xrDIl6ngFxT44chv0XnRUV1NNt_-9Y,3900
|
|
84
81
|
phoenix/server/api/types/EventMetadata.py,sha256=-J0tYF9eZTHwCjwxQHY7Gckr2_MNW5OoWT1mydweZNM,635
|
|
85
|
-
phoenix/server/api/types/ExportEventsMutation.py,sha256=
|
|
82
|
+
phoenix/server/api/types/ExportEventsMutation.py,sha256=PYqazKSx-S3uMLLXVlBmGSOxUhDb990dzZ4xNrRRiCw,3812
|
|
86
83
|
phoenix/server/api/types/ExportedFile.py,sha256=e3GTn7B5LgsTbqiwjhMCQH7VsiqXitrBO4aCMS1lHsg,163
|
|
87
84
|
phoenix/server/api/types/Functionality.py,sha256=tzV9xdhB8zqfsjWxP66NDC7EZsplYkYO7jRbLWJIeeg,382
|
|
88
85
|
phoenix/server/api/types/MimeType.py,sha256=eQzVj_KYb4Vm29u8T1tfogwWbEt_ZXjlicezCRcBK04,368
|
|
@@ -92,10 +89,10 @@ phoenix/server/api/types/PerformanceMetric.py,sha256=W92B7OghEOgzFvmY0LCqpgavHaQ
|
|
|
92
89
|
phoenix/server/api/types/PromptResponse.py,sha256=Q8HKtpp8GpUOcxPCzZpkkokidDd6u0aZOv_SuPZZd5Q,630
|
|
93
90
|
phoenix/server/api/types/Retrieval.py,sha256=OhMK2ncjoyp5h1yjKhjlKpoTbQrMHuxmgSFw-AO1rWw,285
|
|
94
91
|
phoenix/server/api/types/ScalarDriftMetricEnum.py,sha256=IUAcRPpgL41WdoIgK6cNk2Te38SspXGyEs-S1fY23_A,232
|
|
95
|
-
phoenix/server/api/types/Segments.py,sha256=
|
|
92
|
+
phoenix/server/api/types/Segments.py,sha256=zogJI9MdmctBL7J-fDSR_8tUJLvuISlVYgCLnTaigKE,2937
|
|
96
93
|
phoenix/server/api/types/SortDir.py,sha256=OUpXhlCzCxPoXSDkJJygEs9Rw9pMymfaZUG5zPTrw4Y,152
|
|
97
|
-
phoenix/server/api/types/Span.py,sha256=
|
|
98
|
-
phoenix/server/api/types/TimeSeries.py,sha256=
|
|
94
|
+
phoenix/server/api/types/Span.py,sha256=DPFFyM6oalAV_V7NvYkD77EDQ6svC6UPAAEpsPNLjGk,7472
|
|
95
|
+
phoenix/server/api/types/TimeSeries.py,sha256=QbLfxHnwYsMsirpq4tx9us6ha7YtAVzK4m8mAL3fMt0,5200
|
|
99
96
|
phoenix/server/api/types/UMAPPoints.py,sha256=8l9RJXi308qty4MdHb2pBbiU6ZuLbrRRxXNbPhXoxKI,1639
|
|
100
97
|
phoenix/server/api/types/VectorDriftMetricEnum.py,sha256=etiJM5ZjQuD-oE7sY-FbdIKY050jk3IU49IMwmfJbEc,188
|
|
101
98
|
phoenix/server/api/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -112,26 +109,30 @@ phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZV
|
|
|
112
109
|
phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
|
|
113
110
|
phoenix/server/static/index.css,sha256=KKGpx4iwF91VGRm0YN-4cn8oC-oIqC6HecoPf0x3ZM8,1885
|
|
114
111
|
phoenix/server/static/index.html,sha256=xPZZH-y4dWlbDutPEV1k0rhmWJtIV-Db9aYP-dEc7wM,703
|
|
115
|
-
phoenix/server/static/index.js,sha256=
|
|
112
|
+
phoenix/server/static/index.js,sha256=r_1aB5IJsIrjc_2thLrHkpOwPrv4ImBB1Vxld6N-9Zc,3025905
|
|
116
113
|
phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
|
|
117
114
|
phoenix/session/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
118
|
-
phoenix/session/session.py,sha256=
|
|
115
|
+
phoenix/session/session.py,sha256=PRRw4tsbII0d09P-guRKzh9VY3pPoj2m_hAuQWSGR_s,12451
|
|
119
116
|
phoenix/trace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
120
117
|
phoenix/trace/exporter.py,sha256=Q1Gxw6vDW1quuv2qeHWvzCsfxoO9s-iFsWlZYXOON8s,2007
|
|
121
118
|
phoenix/trace/filter.py,sha256=-UqIr9DT9IQLNGBWCvNe8nAlK8KGHgoj8wUWEWmOzZA,6313
|
|
122
|
-
phoenix/trace/fixtures.py,sha256=
|
|
119
|
+
phoenix/trace/fixtures.py,sha256=Fmv2ASYZ3-FjlBpsu0S6_G2raLj_d3tazegsiEKw5QM,3069
|
|
123
120
|
phoenix/trace/schemas.py,sha256=XDtwisCiQvcAZbi81HBaWxaJXXQ97r6b2y7H4nvpktc,5183
|
|
124
|
-
phoenix/trace/semantic_conventions.py,sha256=
|
|
125
|
-
phoenix/trace/span_json_decoder.py,sha256=
|
|
121
|
+
phoenix/trace/semantic_conventions.py,sha256=RNfFIH6pwzVyNkAryqbm6jqb7gZuenkfoSPUROIimRo,4592
|
|
122
|
+
phoenix/trace/span_json_decoder.py,sha256=pc6KtjleTf13blMm9dNCm7rXLXjZMY8jCQhqZ_gxwQ8,3089
|
|
126
123
|
phoenix/trace/span_json_encoder.py,sha256=C5y7rkyOcV08oJC5t8TZqVxsKCZMJKad7bBQzAgLoDs,1763
|
|
127
|
-
phoenix/trace/trace_dataset.py,sha256
|
|
124
|
+
phoenix/trace/trace_dataset.py,sha256=-Cr7XeUfncNwn67RqAM2u-JgJiYXyE0gXSkmmKttkao,4684
|
|
128
125
|
phoenix/trace/tracer.py,sha256=R2bY3gAP2VaimCtKSrPLcvgsYZ9p76j1LzKukMTJijk,3524
|
|
129
|
-
phoenix/trace/utils.py,sha256=
|
|
126
|
+
phoenix/trace/utils.py,sha256=PZGJV17aHCz6f0Wq0rPBIsJOCisEkCSawX0h23Ok4Pw,466
|
|
127
|
+
phoenix/trace/langchain/__init__.py,sha256=WMMjaFrzaucL6MM5V3c54Wo54X-Qws1oMyv6JLmKnHY,75
|
|
128
|
+
phoenix/trace/langchain/tracer.py,sha256=gE9PjWz65MGGgSoQTbMMCWTFYH15qp-U739dv9oM6aU,11194
|
|
129
|
+
phoenix/trace/llama_index/__init__.py,sha256=4fpR5702Qh2t5TaXIx584EkA-BveCPftXPOKvI0Oi3I,105
|
|
130
|
+
phoenix/trace/llama_index/callback.py,sha256=ZpB7l3_pJYj9mL8uu3PGHA-H7WdcyVoClMu3vDK0XFE,14954
|
|
130
131
|
phoenix/trace/v1/__init__.py,sha256=FYL2u6f5prFtbQohQf_x-yR0hVflm7OAunO1fvo2KXg,17032
|
|
131
132
|
phoenix/trace/v1/trace_pb2.py,sha256=DPDwoF4HOa3T2R-Qi7c2uXkbypOXcrOkCysMB-yrKXw,5580
|
|
132
133
|
phoenix/trace/v1/trace_pb2.pyi,sha256=2JpgiYz3s8HrxnVIi5Brk7c3RJB4LqDGzwRYonhliRA,16258
|
|
133
|
-
arize_phoenix-0.0.
|
|
134
|
-
arize_phoenix-0.0.
|
|
135
|
-
arize_phoenix-0.0.
|
|
136
|
-
arize_phoenix-0.0.
|
|
137
|
-
arize_phoenix-0.0.
|
|
134
|
+
arize_phoenix-0.0.38.dist-info/METADATA,sha256=8McrM1efscgDpKEV7maLgcE6Lre_cHglh4owneeWJ_s,25504
|
|
135
|
+
arize_phoenix-0.0.38.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
|
|
136
|
+
arize_phoenix-0.0.38.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
|
|
137
|
+
arize_phoenix-0.0.38.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
|
|
138
|
+
arize_phoenix-0.0.38.dist-info/RECORD,,
|
phoenix/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ from .session.session import Session, active_session, close_app, launch_app
|
|
|
5
5
|
from .trace.fixtures import load_example_traces
|
|
6
6
|
from .trace.trace_dataset import TraceDataset
|
|
7
7
|
|
|
8
|
-
__version__ = "0.0.
|
|
8
|
+
__version__ = "0.0.38"
|
|
9
9
|
|
|
10
10
|
# module level doc-string
|
|
11
11
|
__doc__ = """
|
phoenix/server/api/schema.py
CHANGED
|
@@ -177,12 +177,10 @@ class Query:
|
|
|
177
177
|
+ grouped_event_ids[AncillaryDatasetRole.corpus]
|
|
178
178
|
)
|
|
179
179
|
stacked_coordinates = np.stack(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
)
|
|
185
|
-
) # type: ignore
|
|
180
|
+
grouped_coordinates[DatasetRole.primary]
|
|
181
|
+
+ grouped_coordinates[DatasetRole.reference]
|
|
182
|
+
+ grouped_coordinates[AncillaryDatasetRole.corpus]
|
|
183
|
+
)
|
|
186
184
|
|
|
187
185
|
clusters = Hdbscan(
|
|
188
186
|
min_cluster_size=min_cluster_size,
|
|
@@ -3,16 +3,7 @@ from functools import partial
|
|
|
3
3
|
|
|
4
4
|
import strawberry
|
|
5
5
|
|
|
6
|
-
from phoenix.metrics.metrics import
|
|
7
|
-
Cardinality,
|
|
8
|
-
Count,
|
|
9
|
-
Max,
|
|
10
|
-
Mean,
|
|
11
|
-
Min,
|
|
12
|
-
PercentEmpty,
|
|
13
|
-
Quantile,
|
|
14
|
-
Sum,
|
|
15
|
-
)
|
|
6
|
+
from phoenix.metrics.metrics import Cardinality, Count, Max, Mean, Min, PercentEmpty, Quantile, Sum
|
|
16
7
|
|
|
17
8
|
|
|
18
9
|
@strawberry.enum
|
|
@@ -11,10 +11,7 @@ import phoenix.core.model_schema as ms
|
|
|
11
11
|
from phoenix.server.api.context import Context
|
|
12
12
|
from phoenix.server.api.input_types.ClusterInput import ClusterInput
|
|
13
13
|
from phoenix.server.api.types.DatasetRole import AncillaryDatasetRole, DatasetRole
|
|
14
|
-
from phoenix.server.api.types.Event import
|
|
15
|
-
parse_event_ids_by_dataset_role,
|
|
16
|
-
unpack_event_id,
|
|
17
|
-
)
|
|
14
|
+
from phoenix.server.api.types.Event import parse_event_ids_by_dataset_role, unpack_event_id
|
|
18
15
|
from phoenix.server.api.types.ExportedFile import ExportedFile
|
|
19
16
|
|
|
20
17
|
|
|
@@ -6,6 +6,7 @@ import numpy as np
|
|
|
6
6
|
import pandas as pd
|
|
7
7
|
import strawberry
|
|
8
8
|
from strawberry import UNSET
|
|
9
|
+
from typing_extensions import Annotated
|
|
9
10
|
|
|
10
11
|
from .DatasetValues import DatasetValues
|
|
11
12
|
from .NumericRange import NumericRange
|
|
@@ -61,14 +62,14 @@ class GqlBinFactory:
|
|
|
61
62
|
class Segment:
|
|
62
63
|
"""A segment of the parent's data, split out using a heuristic"""
|
|
63
64
|
|
|
64
|
-
bin:
|
|
65
|
-
|
|
66
|
-
types=(
|
|
65
|
+
bin: Annotated[
|
|
66
|
+
Union[
|
|
67
67
|
NominalBin,
|
|
68
68
|
IntervalBin,
|
|
69
69
|
MissingValueBin,
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
],
|
|
71
|
+
strawberry.union("Bin"),
|
|
72
|
+
]
|
|
72
73
|
counts: DatasetValues = strawberry.field(
|
|
73
74
|
default_factory=DatasetValues,
|
|
74
75
|
)
|