Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
Write code for a machine learning prediction model
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
Write code for a machine learning prediction model
- Assistant
Certainly! Keep in mind that machine learning is a vast subject, but to get started I can provide a simple python decision tree example that can be helpful to understand subject when you are just starting out:
import matplotlib.pyplot as plt from sklearn.tree import DecisionTreeClassifier, plot_tree from sklearn.datasets import load_iris # Load flower iris dataset to use as an example data = load_iris() # Split training and testing inputs (X) and labels (y) X_train = train[['sepal_length','sepal_width','petal_length','petal_width']] y_train = train.species X_test = test[['sepal_length','sepal_width','petal_length','petal_width']] y_test = test.species # Train a decision tree classifier mod_dt = DecisionTreeClassifier(max_depth = 3, random_state = 1) mod_dt.fit(X_train,y_train) # Visualize the fitted decision tree plt.figure(figsize = (10,8)) fn = ["sepal_length", "sepal_width", "petal_length", "petal_width"] cn = ['setosa', 'versicolor', 'virginica'] plot_tree(mod_dt, feature_names = fn, class_names = cn, filled = True) # Get predictions for the test set prediction=mod_dt.predict(X_test)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →