3 ms·
I promise you that anyone voting in this poll couldn't differentiate between what does and does not use "AI." Do people trust this code less now than they did
by AndrewKemendo 3y ago
I promise you that anyone voting in this poll couldn't differentiate between what does and does not use "AI."
Do people trust this code less now than they did a decade ago when it was written in 2017:
from numpy import loadtxt
from xgboost import XGBClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
dataset = loadtxt('pima-indians-diabetes.csv', delimiter=",")
X = dataset[:,0:8]
Y = dataset[:,8]
seed = 7
test_size = 0.33
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=test_size, random_state=seed)
model = XGBClassifier()
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
predictions = [round(value) for value in y_pred]
predictionsaccuracy = accuracy_score(y_test, predictions)
print("Accuracy: %.2f%%" % (accuracy * 100.0))
Data: https://github.com/npradaschnor/Pima-Indians-Diabetes-Dataset/blob/master/diabetes.csv https://github.com/npradaschnor/Pima-Indians-Diabetes-Datase...
It's all just vibes man...
- Euphorbium 3y agoDepends. Is the size of pima-indians-diabetes.csv less than a terabyte? Then trust is the same. Else, less.
- AndrewKemendo 3y agoWhat if I have 40TB of tabular data? XGB still beats Attention networks, CNNs, VisionTransformers etc... Again, point being that "AI" doesn't mean anything so making broad sweeping statements about trust or whatever is nonsensical
- eesmith 3y agoIf the choices are "it worked in 2017" and "it was written by AI" then clearly it was AI: 1) The program is invalid. The "predictionsaccuracy" should be "accuracy". Therefore it cannot be working code from 2017. Furthermore, 2) The loadtxt() does not read the linked-to CSV file because of the header line. NumPy reports: 'ValueError: could not convert string 'Pregnancies' to float64 at row 0, column 1.' The fix is to add skiprows=1 to the loadtxt(). As a couple of style notes: 3) Modern Python prefers f-strings, f"Accuracy: {accuracy*100.0:.2f}") 4) The y_pred contains only 0s or 1s so the following is unneeded predictions = [round(value) for value in y_pred] and y_pred can be passed directly to accuracy_score().
- AndrewKemendo 3y agoWhat? It was written by a human in 2017 and worked then The code is from: https://machinelearningmastery.com/xgboost-with-python/ https://machinelearningmastery.com/xgboost-with-python/ Point being, this was firmly "AI" in 2017. It is still widely useful today. Is it no longer AI? If so why? Do people believe in the code above less now? If so, why? If not, then the title is wrong if it's AI.
- eesmith 3y agoThe code you posted does not work. Try it out. One of these two lines is incorrect: predictionsaccuracy = accuracy_score(y_test, predictions) print("Accuracy: %.2f%%" % (accuracy * 100.0)) Either the first line should be: accuracy = accuracy_score(y_test, predictions) or the second line should be: print("Accuracy: %.2f%%" % (predictionsaccuracy * 100.0)) I tried the corrected code against the CSV data file you pointed to, and got: ValueError: could not convert string 'Pregnancies' to float64 at row 0, column 1. You linked to a course that costs US$37. I don't see the code, though one of the images shows it uses that data set. Still, 1) tells me there's a copy&paste error, and 2) tells me that the dataset was somehow massaged. > Is it no longer AI? If so why? Okay, so I misunderstood your point. I thought your 'I promise you that anyone voting in this poll couldn't differentiate between what does and does not use "AI."' was in regards to the modern wave of using AI (typically LLM models) as a code assistant. Could someone tell if the code you posted was generated by an AI? I could tell that the code you posted was not working code, so if the choices were "working code written by human" and "output from an AI model", it clearly belongs to the latter. That is not your point, and I was wrong. However, the point of the article is not "what is AI?" but more like "how much should you trust the results of everything described as AI"? XGBoost was not generating false court citations. XGBoost was not generating images where the only scientists were white men. XGBoost was not submitting Stackoverflow answers. XGBoost was not classifying black men as gorillas. XGBoost is not the sort of AI that most people are thinking of when you say "AI". FWIW, I'm of the classical school, and I consider alpha–beta pruning to be part of AI.