Surveys
In [1]:
Copied!
import pandas as pd
best_practices = pd.read_csv("Best practices assessment.csv")
best_practices
import pandas as pd
best_practices = pd.read_csv("Best practices assessment.csv")
best_practices
Out[1]:
| How many years of software engineering experience do you have? | How many years of data science experience do you have? | Write reusable scripts for data cleaning and merging | Make datasets available on shared infrastructure | Use versioning for data, model, configurations and training scripts | Continuously monitor the behaviour of deployed models | Log production predictions with the model’s version and input data | Store models in a single format for ease of use | Equip with web interface, package image, provide REST API | Provide simple API for serving batch and real-time requests | Integration with existing data infrastructure | Querying, visualising and understanding metrics and event logging | Allow experimentation with the inference code | Keep the model’s API and documentation together | Parallelise feature extraction | Cache predictions | Async support for top-down chaining models | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3 | 1 | Strongly agree | Agree | Strongly agree | Neither agree nor disagree | Strongly agree | Strongly agree | Strongly agree | Strongly agree | Strongly agree | Strongly agree | Strongly agree | Strongly agree | Strongly agree | Neither agree nor disagree | Strongly agree |
| 1 | 6 | 2 | Neither agree nor disagree | Agree | Neither agree nor disagree | Agree | Agree | Neither agree nor disagree | Disagree | Strongly disagree | Disagree | Strongly disagree | Disagree | Strongly disagree | Disagree | Strongly agree | Strongly disagree |
| 2 | 1 | 5 | Strongly disagree | Disagree | Disagree | Strongly disagree | Disagree | Strongly disagree | Strongly disagree | Neither agree nor disagree | Strongly disagree | Disagree | Neither agree nor disagree | Agree | Strongly disagree | Strongly disagree | Disagree |
| 3 | 3 | 3 | Agree | Agree | Disagree | Neither agree nor disagree | Agree | Not applicable | Not applicable | Neither agree nor disagree | Agree | Disagree | Agree | Strongly agree | Not applicable | Neither agree nor disagree | Agree |
| 4 | 1 | 7 | Neither agree nor disagree | Disagree | Neither agree nor disagree | Disagree | Strongly disagree | Not applicable | Not applicable | Disagree | Strongly disagree | Disagree | Disagree | Neither agree nor disagree | Strongly disagree | Strongly agree | Not applicable |
| 5 | 6 | 0 | Strongly agree | Strongly agree | Agree | Neither agree nor disagree | Agree | Strongly agree | Agree | Strongly agree | Agree | Strongly agree | Disagree | Strongly agree | Agree | Strongly agree | Not applicable |
| 6 | 2 | 2 | Disagree | Neither agree nor disagree | Agree | Strongly agree | Neither agree nor disagree | Disagree | Strongly agree | Disagree | Disagree | Agree | Neither agree nor disagree | Neither agree nor disagree | Not applicable | Disagree | Strongly agree |
| 7 | 1 | 2 | Disagree | Neither agree nor disagree | Disagree | Agree | Disagree | Strongly disagree | Strongly agree | Strongly agree | Strongly disagree | Disagree | Agree | Strongly disagree | Not applicable | Strongly disagree | Strongly disagree |
| 8 | 0 | 1 | Strongly disagree | Disagree | Strongly disagree | Disagree | Strongly disagree | Disagree | Agree | Strongly disagree | Disagree | Strongly disagree | Disagree | Strongly disagree | Disagree | Disagree | Strongly disagree |
| 9 | 7 | 1 | Strongly agree | Strongly agree | Agree | Strongly agree | Agree | Agree | Strongly agree | Strongly disagree | Strongly agree | Not applicable | Agree | Agree | Strongly agree | Strongly agree | Agree |
In [2]:
Copied!
m = {
"Strongly agree": 4 / 4,
"Agree": 3 / 4,
"Neither agree nor disagree": 2 / 4,
"Disagree": 1 / 4,
"Strongly disagree": 0 / 4,
}
best_practices_dicts = [v.to_dict() for _, v in best_practices.iterrows()]
best_practice_score_ds = []
best_practice_score_se = []
for d in best_practices_dicts:
ds_experience = int(d["How many years of data science experience do you have?"])
del d["How many years of data science experience do you have?"]
se_experience = int(
d["How many years of software engineering experience do you have?"]
)
del d["How many years of software engineering experience do you have?"]
scores = [m[v] for v in d.values() if v != "Not applicable"]
score = sum(scores) / len(scores)
best_practice_score_ds.append((ds_experience, score))
best_practice_score_se.append((se_experience, score))
best_practices[
"How many years of software engineering experience do you have?"
].median(), best_practices[
"How many years of data science experience do you have?"
].median()
m = {
"Strongly agree": 4 / 4,
"Agree": 3 / 4,
"Neither agree nor disagree": 2 / 4,
"Disagree": 1 / 4,
"Strongly disagree": 0 / 4,
}
best_practices_dicts = [v.to_dict() for _, v in best_practices.iterrows()]
best_practice_score_ds = []
best_practice_score_se = []
for d in best_practices_dicts:
ds_experience = int(d["How many years of data science experience do you have?"])
del d["How many years of data science experience do you have?"]
se_experience = int(
d["How many years of software engineering experience do you have?"]
)
del d["How many years of software engineering experience do you have?"]
scores = [m[v] for v in d.values() if v != "Not applicable"]
score = sum(scores) / len(scores)
best_practice_score_ds.append((ds_experience, score))
best_practice_score_se.append((se_experience, score))
best_practices[
"How many years of software engineering experience do you have?"
].median(), best_practices[
"How many years of data science experience do you have?"
].median()
Out[2]:
(2.5, 2.0)
In [3]:
Copied!
import matplotlib.pyplot as plt
from scipy import stats
best_practice_score_ds = sorted(best_practice_score_ds)
plt.scatter(
[x for x, y in best_practice_score_ds], [y for x, y in best_practice_score_ds]
)
stats.pearsonr(
[x for x, y in best_practice_score_ds], [y for x, y in best_practice_score_ds]
)
import matplotlib.pyplot as plt
from scipy import stats
best_practice_score_ds = sorted(best_practice_score_ds)
plt.scatter(
[x for x, y in best_practice_score_ds], [y for x, y in best_practice_score_ds]
)
stats.pearsonr(
[x for x, y in best_practice_score_ds], [y for x, y in best_practice_score_ds]
)
Out[3]:
(-0.5440527060340572, 0.10399880919437814)
In [4]:
Copied!
import re
best_practice_score_se = sorted(best_practice_score_se)
%matplotlib inline
plt.rcParams["figure.facecolor"] = "white"
plt.rcParams["font.size"] = 24
plt.rcParams["figure.figsize"] = (14, 10)
X = [x for x, y in best_practice_score_se]
Y = [y for x, y in best_practice_score_se]
print(sum(Y) / len(Y))
sc = plt.scatter(X, Y, c="black", s=[x * 50 for x, y in best_practice_score_ds])
plt.ylabel("Ratio of implemented deployment best practices")
plt.xlabel("Years of professional software engineering experience")
def best_fit(X, Y):
xbar = sum(X) / len(X)
ybar = sum(Y) / len(Y)
n = len(X)
numer = sum([xi * yi for xi, yi in zip(X, Y)]) - n * xbar * ybar
denum = sum([xi**2 for xi in X]) - n * xbar**2
b = numer / denum
a = ybar - b * xbar
return a, b
a, b = best_fit(X, Y)
yfit = [a + b * xi for xi in X]
plt.plot(X, yfit, "b", label="Best fit")
plt.legend(
sc.legend_elements("sizes", num=5)[0],
[
re.sub(r"[^\d]*(\d+)[^\d]*", lambda v: f"{int(v.group(1)) // 40} years (DS)", t)
for t in sc.legend_elements("sizes", num=5)[1]
],
)
plt.tight_layout()
plt.savefig("best-practices", dpi=150)
stats.pearsonr(
[x for x, y in best_practice_score_se], [y for x, y in best_practice_score_se]
)
import re
best_practice_score_se = sorted(best_practice_score_se)
%matplotlib inline
plt.rcParams["figure.facecolor"] = "white"
plt.rcParams["font.size"] = 24
plt.rcParams["figure.figsize"] = (14, 10)
X = [x for x, y in best_practice_score_se]
Y = [y for x, y in best_practice_score_se]
print(sum(Y) / len(Y))
sc = plt.scatter(X, Y, c="black", s=[x * 50 for x, y in best_practice_score_ds])
plt.ylabel("Ratio of implemented deployment best practices")
plt.xlabel("Years of professional software engineering experience")
def best_fit(X, Y):
xbar = sum(X) / len(X)
ybar = sum(Y) / len(Y)
n = len(X)
numer = sum([xi * yi for xi, yi in zip(X, Y)]) - n * xbar * ybar
denum = sum([xi**2 for xi in X]) - n * xbar**2
b = numer / denum
a = ybar - b * xbar
return a, b
a, b = best_fit(X, Y)
yfit = [a + b * xi for xi in X]
plt.plot(X, yfit, "b", label="Best fit")
plt.legend(
sc.legend_elements("sizes", num=5)[0],
[
re.sub(r"[^\d]*(\d+)[^\d]*", lambda v: f"{int(v.group(1)) // 40} years (DS)", t)
for t in sc.legend_elements("sizes", num=5)[1]
],
)
plt.tight_layout()
plt.savefig("best-practices", dpi=150)
stats.pearsonr(
[x for x, y in best_practice_score_se], [y for x, y in best_practice_score_se]
)
0.5157738095238095
Out[4]:
(0.6722543326178704, 0.03321124881554773)
In [5]:
Copied!
tam = pd.read_csv("Technology acceptance model questionnaire.csv")
tam
tam = pd.read_csv("Technology acceptance model questionnaire.csv")
tam
Out[5]:
| I believe the use of GreatAI improves the quality of AI deployments. | I believe the use of GreatAI would increase my productivity. | I believe the use of GreatAI can lead to robust and trustworthy deployments. | Overall, I found GreatAI useful when working with AI. | I found the GreatAI easy to learn. | I found it is easy to employ GreatAI in practice. | I found it is easy to integrate GreatAI into an existing project. | Overall, I found GreatAI easy to use. | Assuming GreatAI is applicable to my task, I predict that I will use it on a regular basis in the future. | Overall, I intend to use the GreatAI in my personal or professional projects. | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 7 |
| 1 | 7 | 7 | 6 | 7 | 5 | 6 | 7 | 6 | 7 | 7 |
| 2 | 4 | 4 | 5 | 6 | 6 | 5 | 4 | 4 | 5 | 4 |
| 3 | 6 | 7 | 6 | 7 | 7 | 6 | 7 | 6 | 7 | 6 |
| 4 | 7 | 7 | 6 | 7 | 4 | 5 | 5 | 5 | 6 | 6 |
| 5 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 |
| 6 | 6 | 6 | 6 | 4 | 5 | 7 | 6 | 6 | 7 | 7 |
| 7 | 7 | 6 | 6 | 6 | 4 | 5 | 3 | 5 | 5 | 6 |
| 8 | 4 | 5 | 5 | 5 | 7 | 2 | 3 | 3 | 3 | 3 |
| 9 | 7 | 7 | 7 | 7 | 5 | 6 | 5 | 6 | 7 | 7 |
In [6]:
Copied!
import pingouin
pu = [
"I believe the use of GreatAI improves the quality of AI deployments.",
"I believe the use of GreatAI would increase my productivity.",
"I believe the use of GreatAI can lead to robust and trustworthy deployments.",
"Overall, I found GreatAI useful when working with AI.",
]
pingouin.cronbach_alpha(tam[pu])
import pingouin
pu = [
"I believe the use of GreatAI improves the quality of AI deployments.",
"I believe the use of GreatAI would increase my productivity.",
"I believe the use of GreatAI can lead to robust and trustworthy deployments.",
"Overall, I found GreatAI useful when working with AI.",
]
pingouin.cronbach_alpha(tam[pu])
Out[6]:
(0.8813771517996869, array([0.688, 0.967]))
In [7]:
Copied!
peou = [
"I found the GreatAI easy to learn.",
"I found it is easy to employ GreatAI in practice.",
"I found it is easy to integrate GreatAI into an existing project.",
"Overall, I found GreatAI easy to use.",
]
pingouin.cronbach_alpha(tam[peou])
peou = [
"I found the GreatAI easy to learn.",
"I found it is easy to employ GreatAI in practice.",
"I found it is easy to integrate GreatAI into an existing project.",
"Overall, I found GreatAI easy to use.",
]
pingouin.cronbach_alpha(tam[peou])
Out[7]:
(0.7729220222793487, array([0.403, 0.937]))
In [8]:
Copied!
itu = [
"Assuming GreatAI is applicable to my task, I predict that I will use it on a regular basis in the future.",
"Overall, I intend to use the GreatAI in my personal or professional projects.",
]
pingouin.cronbach_alpha(tam[itu])
itu = [
"Assuming GreatAI is applicable to my task, I predict that I will use it on a regular basis in the future.",
"Overall, I intend to use the GreatAI in my personal or professional projects.",
]
pingouin.cronbach_alpha(tam[itu])
Out[8]:
(0.9538950715421304, array([0.814, 0.989]))
In [9]:
Copied!
tam["pu"] = tam[pu].mean(1)
tam["peou"] = tam[peou].mean(1)
tam["itu"] = tam[itu].mean(1)
tam[["pu", "peou", "itu"]]
tam["pu"] = tam[pu].mean(1)
tam["peou"] = tam[peou].mean(1)
tam["itu"] = tam[itu].mean(1)
tam[["pu", "peou", "itu"]]
Out[9]:
| pu | peou | itu | |
|---|---|---|---|
| 0 | 7.00 | 7.00 | 7.0 |
| 1 | 6.75 | 6.00 | 7.0 |
| 2 | 4.75 | 4.75 | 4.5 |
| 3 | 6.50 | 6.50 | 6.5 |
| 4 | 6.75 | 4.75 | 6.0 |
| 5 | 6.00 | 6.00 | 6.0 |
| 6 | 5.50 | 6.00 | 7.0 |
| 7 | 6.25 | 4.25 | 5.5 |
| 8 | 4.75 | 3.75 | 3.0 |
| 9 | 7.00 | 5.50 | 7.0 |
In [10]:
Copied!
tam[["pu", "peou", "itu"]].mean()
tam[["pu", "peou", "itu"]].mean()
Out[10]:
pu 6.125 peou 5.450 itu 5.950 dtype: float64
In [11]:
Copied!
tam[["pu", "peou", "itu"]].median()
tam[["pu", "peou", "itu"]].median()
Out[11]:
pu 6.375 peou 5.750 itu 6.250 dtype: float64
In [12]:
Copied!
tam[["pu", "peou", "itu"]].std()
tam[["pu", "peou", "itu"]].std()
Out[12]:
pu 0.859990 peou 1.039498 itu 1.321825 dtype: float64
In [13]:
Copied!
stats.pearsonr(tam["peou"], tam["pu"])
stats.pearsonr(tam["peou"], tam["pu"])
Out[13]:
(0.5515422017785757, 0.09838124227663879)
In [14]:
Copied!
stats.pearsonr(tam["peou"], tam["itu"])
stats.pearsonr(tam["peou"], tam["itu"])
Out[14]:
(0.8066270322592023, 0.004809023073123024)
In [15]:
Copied!
stats.pearsonr(tam["pu"], tam["itu"])
stats.pearsonr(tam["pu"], tam["itu"])
Out[15]:
(0.7880605510627579, 0.006774486564715021)
Last update:
August 19, 2022