Accuracy is a useless statistic: give us precision and recall.
Useless is perhaps a but harsh. It tells you something.
It is pretty easy to get 99.99% accuracy on a dataset that is 99.99% a single class for example.
61–69 of 69 posts
2. Heat moves in different ways. It can move when things touch it or when air moves. It can also move in waves, like the sun's heat. Good insulators stop this from happening. Materials like wool and cotton are good because they have lots of tiny air pockets. Air is bad at moving heat. Bubble wrap is good for the same reason. Each little bubble holds air inside, which keeps heat from moving around much. Foil is different. It is shiny, so it reflects heat. This can stop heat from going out or coming in, but it's not good at stopping heat that touches it. The foil will go around the bottle to see if that helps. Recycled paper is also good because the tiny paper bits can trap air. I will see if paper works as good as the other materials that trap air.
3. I will be careful with the hot water so I don't get burned. An adult will help me pour the water. I will use gloves to handle the hot bottle. I will be careful with the thermometer so it doesn't break. At the end, I will just dump the water and put the other stuff in the trash. I will clean up everything when I am done.
It told me my ~10 year old js project was 50% AI generated. Yeah, this is more or less the same as "AI text detector" stuff that won't work reliably (but people who don't understand LLMs will still use it to blame others)
It told me my ~10 year old js project was 50% AI generated. Yeah, this is more or less the same as "AI text detector" stuff that won't work reliably (but people who don't understand LLMs will still use it to blame others)
Maybe unrelated, but do you have trouble completing CAPTCHAs?
public class Main { public static void main(String[] args) { LinkList linkedList = new LinkList(); Scanner scanner = new Scanner(System.in);
System.out.print("Enter input filename: ");
String filename = scanner.nextLine();
File file = new File(filename);
if (!file.exists() || !file.canRead())
{
System.out.println("Error: Cannot open the file.");
System.exit(1);
}
Scanner fileScanner = new Scanner(System.in);
try
{
fileScanner = new Scanner(file);
}
catch (Exception e)
{
System.out.println("Unexpected error opening file.");
System.exit(1);
}
while (fileScanner.hasNextLine())
{
String line = fileScanner.nextLine();
if (line.isEmpty()) continue;
int spaceIndex = line.indexOf(' ');
if (spaceIndex == -1) continue;
String name = line.substring(0, spaceIndex);
String battingRecord = line.substring(spaceIndex + 1);
processPlayer(linkedList, name, battingRecord);
}
fileScanner.close();
displayPlayers(linkedList);
scanner.close();
}
public static void processPlayer(LinkList linkedList, String name, String battingRecord)
{
Node curNode = linkedList.search(name);
if (curNode != null)
{
updateStats(curNode.getPlayer(), battingRecord);
}
else
{
Player newPlayer = new Player(name);
updateStats(newPlayer, battingRecord);
linkedList.insert(newPlayer);
}
}
public static void updateStats(Player player, String battingRecord)
{
char[] characters = battingRecord.toCharArray();
for (int i = 0; i # load the dataset using the the given url iris = fetch_ucirepo(id=53) X = iris.data.features y = iris.data.targets df = pd.concat([X, y], axis=1)
# Keep only Setosa and Versicolor df = df[df['class'].isin(['Iris-setosa', 'Iris-versicolor'])]
# Separate features and labels df['class'] = df['class'].map({'Iris-setosa': 0, 'Iris-versicolor': 1}) X = df.iloc[:, :-1].values y = df['class'].values.reshape(-1, 1)
# intercept X = np.c_[np.ones((X.shape[0], 1)), X]
# train test split (80/20) X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42, shuffle=True )
# Logistic Regression (Gradient Descent) def sigmoid(z): return 1 / (1 + np.exp(-z))
def compute_loss(y, y_pred): m = len(y) return - (1/m) * np.sum(ynp.log(y_pred + 1e-9) + (1 - y)np.log(1 - y_pred + 1e-9))
# weights and parameters theta = np.zeros((X_train.shape[1], 1)) lr = 0.01 # learning rate iteration = 10000 # iterations
# Gradient Descent Loop for epoch in range(iteration): z = np.dot(X_train, theta) y_pred = sigmoid(z) error = y_pred - y_train gradient = (1 / len(y_train)) * np.dot(X_train.T, error) theta -= lr * gradient
if epoch % 1000 == 0:
loss = compute_loss(y_train, y_pred)
print(f"Epoch {epoch}: Loss = {loss:.4f}")
# Predictions and Metrics
y_test_pred = sigmoid(np.dot(X_test, theta))
y_test_class = (y_test_pred >= 0.5).astype(int)# Accuracy accuracy = np.mean(y_test_class == y_test) * 100 print("RESULTS") print(f"Classification Accuracy on Test Data: {accuracy:.2f}%")
# Confusion Matrix cm = confusion_matrix(y_test, y_test_class) print("\nConfusion Matrix for Test data:") print(cm)
print("\n--- Predict for a new flower sample ---") print("Please enter the feature values:")
# Ask user for input sepal_length = float(input("Enter Sepal Length (cm): ")) sepal_width = float(input("Enter Sepal Width (cm): ")) petal_length = float(input("Enter Petal Length (cm): ")) petal_width = float(input("Enter Petal Width (cm): "))
# Create feature array with bias term new_sample = np.array([[1, sepal_length, sepal_width, petal_length, petal_width]])
# Predict probability and class new_pred_prob = sigmoid(np.dot(new_sample, theta)) new_pred_class = (new_pred_prob >= 0.5).astype(int)
print(f"Predicted probability of being 'Iris-versicolor': {new_pred_prob[0][0]:.4f}") if new_pred_class[0][0] == 1: print("Predicted Class: Iris-versicolor") else: print("Predicted Class: Iris-setosa")