Tutor profile: Janice G.
Subject: SQL Programming
Apply the TRANSLATION, CLEANUP and SQL steps for the design of the following sql query “Provide a list of all staff ids, staff first name, staff last name, and salaries from the staff table.”
TRANSLATION: SELECT FROM THE STAFF TABLE A LIST WITH THE IDENTIFIER OF EACH STAFF, THE FIRST NAME, LAST NAME AND SALARY. CLEANUP: SELECT STAFF IDENTIFIER STAFF, FIRST NAME, LAST NAME SALARY. SQL: Select StaffID,StfFirstName,StflastName,Salary from staff;
Subject: Machine Learning
How can you determine the optimal number of clusters in the K-Means clustering algorithm?
One of the approaches to determine the optimal number of clusters in the K-Means clustering algorithm is the "Elbow method", in which the K-Means clustering is run for different values of K, and cost function (distortion) is computed. The cost decreases rapidly in the beginning range of K, but the rate of decrease reduces later, and cost remains almost constant. We would then chose that value of K where increasing K further doesn't give a significant reduction in cost.
Subject: Java Programming
How would you reverse a String?
An efficient way to reverse a String is to do so recursively. I would make a class using string.length() and string.substring() to continually narrow the string and the base case, or the way the code would stop performing the reverse, would be when the length of the string equals 1. At each occurrence of the class an empty string would have the new letter from the end of the old string concatenated to it. Also if the length equals one the string is already reversed technically.
needs and Janice will reply soon.