Hi Phoenix team, I鈥檓 trying out the experiment feature and I uploaded a toy dataset per documentation.
import phoenix as px
import pandas as pd
# Create a pandas DataFrame with examples
df = pd.DataFrame({
"question": ["Which team won the most games?", "Which team won the most games in 2015?", "Who led the league in 3 point shots?"],
"answer": ["Team A", "Team B", "Player X"]
})
# Upload the dataset to Phoenix
client = px.Client()
dataset = client.upload_dataset(
dataframe=df,
input_keys=["question"],
output_keys=["answer"],
dataset_name="nba-questions-v1"
)And when I run experiment, I get AttributeError: 'DataFrame' object has no attribute 'examples'
from phoenix.experiments import run_experiment
run_experiment(df, task=task, evaluators=[no_error, has_results])The error occurs because the run_experiment function expects a Dataset object, not a DataFrame. You should pass the dataset object returned by client.upload_dataset to run_experiment.Here is the corrected code: ```from phoenix.experiments import run_experiment# Ensure you have defined your task and evaluators
async def task(input): # Your task implementation here passdef no_error(output): return 1.0 if output.get("error") is None else 0.0def has_results(output): results = output.get("results") has_results = results is not None and len(results) > 0 return 1.0 if has_results else 0.0# Run the experiment with the correct dataset object run_experiment(dataset, task=task, evaluators=[no_error, has_results])```Would you like more detail on defining tasks and evaluators?Sources: - Run Experiments - Phoenix API Reference
馃挕聽Hint: Mention RunLLM in the thread for followups.
