Python Homework Help

Search for question

Questions & Answers

Submission Please read all the instructions carefully. Marks will be deducted if files are submitted in the wrong format or other instructions are not followed! You should submit precisely 3 files individually (do NOT zip them): 1. Two page report (only references may appear on a third page) in pdf format using either the latex Download latex or word Download word template provided. 2. Code (a version that will run - either an .ipynb notebook (preferred) or a .py script; do NOT submit any of the data you are provided with). 3. Class predictions for the test data. This must be in exactly the same format as the provided example file, sample_valid_predictions.csv and must be named predictions.csv. The Brief For this assignment, you will carry out a binary classification task, and write a report on this. Please read this brief carefully and also the Marking Criteria and Requirements below. The data come from photos, and your task is to come up with a machine learning method for classifying the photos according to whether their content is happy or sad. The data you are given for each photo consists of 4096 features. 3584 of these were extracted from a deep Convolutional Neural Network (CNN) [1], and the remaining 512 are GIST features [2]. (You are given all these features as a 1-dimensional array, so you will not be performing any feature extraction on raw images.) There are two files of training data. The first contains 512 samples with all the data present (no missing or null values). The second contains 2048 samples, which have some missing data, as indicated by a NaN (not a number). The training data have class labels, 1 for happy, and 0 for sad. In addition, there is also a confidence label for each sample. The class labels were assigned based on decisions from 3 people viewing the photos. When they all agreed, the class label could be considered certain, and a confidence of 1 was written down. If they didn't all agree, then the classification decided on by the majority was assigned, but with a confidence of only 0.66. There is one file of test data, containing 1024 samples. You must generate predictions for the class labels of these data. (Note that, as with the second training set, the samples in the test data set contain some missing features.) Your job is to obtain the best predictions you can, and to justify your methods. You should provide reasons for which classifier or combination of classifiers you use, how you do model selection (training-validation split or cross validation), and how you handle the specific issues with these data (large number of features, missing data, the presence of confidence labels for the classes of the training data). We value creative approaches! You may make use of any classifier, such as: single-layer perceptron, multi-layer perceptron, SVM, random forest, logistic regression, etc. You are not required to code classifiers from scratch, and you can use any machine learning toolbox you like, such as scikit-learnLinks to an external site .. The data can be obtained here Download data can be obtained here. (For those of you using ColabLinks to an external site., we recommend uploading the data to your Google Drive for quick and easy access.) And here is a link to some tips for getting started Download tips for getting started. Good luck! Marking criteria and requirements Your report must contain the following sections. 1. Approach (10 marks) Present a high-level description and explanation of the the machine learning approach you have used (e.g. multi-layer perceptron, logistic regression, etc. or a combination thereof). You should cover how the method(s) work(s) and the key assumptions on which the approach depends, justifying your choices. Pay close attention to characteristics of the data set, for example: high dimensionality. 2. Methods (30 marks) Describe in detail what you did, and include references to appropriate literature. - How did you train and test your classifier(s)? - How did you do model selection? - Did you rescale the data? (See preprocessing lecture, and https://scikit-learn.org/stable/modules/preprocessing.htmlLinks to an external site.) - Did you do feature selection? You are provided with two types of features: CNN features and gist features. Are they equally important? (See the lectures and e.g. https://en.wikipedia.org/wiki/Feature_selectionLinks to an external site.) - How did you deal with missing data? Did you do something with the confidence labels? 3. Results and Discussion (30 marks) Use graphs and/or tables to illustrate the results of your model selection. For example, - Show how the choice of classifier hyper-parameters affect the performance of the classifier, using a validation set. - Show changing performance for different training sets. How useful, relatively, are the incomplete training data? How useful is it to take account of the training label confidence? In the Discussion: - If you think that there might be ways of getting better performance, then explain how. - If you feel that you could have done a better job of evaluation, then explain how. - What lessons have been learned? 4. Coding (20 marks) and Accuracy of your predictions (10 marks) Please make sure we will be able to run your code as is. High quality code with good structure and comments will be marked favourably. We will compute the accuracy of your class predictions for the test data (as percentage correct), and give you a mark out of 10 for this. Those of you with the most accurate predictions will score 10/10. Those of you with the least accurate predictions will score 5/10. If you do not submit a class predictions file in the correct format, then you score 0/10. Footnotes: [1] Extracted from the fc7 activation layer of CaffeNet http://caffe.berkeleyvision.orgLinks to an external site. [2] http://people.csail.mit.edu/torralba/courses/6.870/papers/IJCV01-Oliva-Torralba.pdfLinks to an external site.


8:58 5GE 68 ‹ Back Assignment Details Python Programming - 2024Su CS 3080 001 import all of the libraries you are going to use final a database that is useable as research IE at least 100 tuples and a reasonable conclusion use python for all of your programming also turn in a preliminary 'plan' The turn-ins are as follows: Pick a data science or statistics algorithm to determine something about a real dataset you found in the world. This can be anything from saying the average is off, like with measuring global temperatures worldwide, or classifying data to either predict a yes or no or to classify it in more categories. (naive bayes, null hypothesis test) Have a proposal, one page maximum, that covers the following: What data are you analyzing? What algorithm are you using and why? What are you hoping to learn? Where did you get the data, does it seem accurate? Next, convert the data into a .csv file if you have not already done so, turn in with code Write the python program to process your information and print out a conclusion How accurate was your algorithm by %? If you use a z- test, how close was the actual mean to the calculated one? Was it bigger, smaller, different? Write a small, once again 1 page conclusion answering Submit Assignment 4 45 000 = Dashboard Calendar To Do Notifications Inbox 8:58 5GE 68 < Back Assignment Details Python Programming - 2024Su CS 3080 001 write the py tion program to process your mformation and print out a conclusion How accurate was your algorithm by %? If you use a z- test, how close was the actual mean to the calculated one? Was it bigger, smaller, different? Write a small, once again 1 page conclusion answering the following: Was your test accurate? What could have altered the results? Did it work or do we need to run a different test or get more data? And finally, make a separate .py file and write a function that does exactly what the imported functions do IE Naive Bayes or z-test. Run the test again and in your conclusions answer the following: Were the results between the written functions and the imported functions the same? Different? Why? Why are libraries so important but also dangerous? Extrapolate this to Al, sure we can get the correct answer but who interprets the data? Who knows its right? The movement of software developers to designers is underway, how can we use what we know to manipulate the data? Submit Assignment 4 45 000 0= = Dashboard Calendar To Do Notifications Inbox


Radio Tower Coverage Problem Description In ByteLand, there are n cities located along the x axis with the ith city located at (Aj, 0). In ByteLand, there is a telecommunications company that manufactures radio towers. The radio tower has a coverage of d units. More precisely, if the radio tower is placed at point (x, 0), then it provides ser- vice to all cities whose location is within d units from (x, 0); that is, the ith city is covered if |x-Ai| ≤ d. The citizens of ByteLand want to figure out where to place the radio tower so as to provide maximum coverage. To help them with this task, answer the following questions. . If a radio tower is placed inside city i, i.e., at (A;, 0), then how many cities does it cover? · What is the maximum number of cities that a single radio tower can cover? Note that for this question, it is not necessary for the tower to be located at a city. Print the answer to each question in one line. Input The input format is as shown below. n d A1 A2 ... An More precisely, the input consists of two lines: · The first line contains two space-separated integers n, d. · The second line contains n space-separated integers A1, A2, . . . An. It is guaranteed that the city locations are given in increasing order, i.e., A¡ > Ai-1 holds for 1 < < < n. Output Output n + 1 lines, where the ith line contains a single integer, the answer to the ith question. . For 1 ≤ i ≤n, print the number of cities covered by a tower located at (A;, 0). . For i = n + 1, print the maximum number of cities that can be covered by a single radio tower. Please ensure that the last line is ended with a newline character '\n'. Constraints . 1 ≤n≤105 · 1 ≤ d ≤109 . 1 ≤ Ai ≤ 109 and Ai ≥ Ai-1 for i > 1 . The time limit is 1 second for C/C++ and 3 seconds for Python. 1 Test Cases Your program will be evaluated on 5 visible test cases and 5 hidden test cases. Each test case is worth 0.6 points. Sample Input 1: 4 3 13 5 7 Sample Output 1: NM MN+ 2 3 2 4 Sample Explanation The x-coordinates of the cities are A = (1, 3, 5, 7). The radius of coverage is d = 3.The answers to the questions are as follows. . If a tower is placed at (1,0) then it covers all cities whose x coordinates are in the range [-2, 4]. Only the first two towers lie in this range. Hence the answer is 2. . A tower is placed at (3,0) covers all towers except the fourth tower. . A tower is placed at (5, 0) covers all towers except the first tower. . A tower is placed at (7,0) covers the third and fourth towers. . We can cover all four towers by placing a tower at (4,0). Hence the answer is 4. Note that it is not necessary to place the tower at one of the cities. Submission Guideline Write your program in either C, C++ or Python in a single file. Submit the file on Gradescope. The time limit on Gradescope is 1 second for C/C++ and 3 seconds for Python. You can make at most 10 submission attempts.


P3.2.1 A molecule, A, reacts to form either B or C with first-order rate constants k₁ and k₂, respectively. That is, and so d[A] dt = -(k₁ + k₂)[A], [A] = [A]oe (k+k2)1 where [A] is the initial concentration of A. The product concentrations (starting from 0) increase in the ratio [B]/[C] = k₁/k2 and conservation of matter requires [B] + [C] = [A] - [A]. Therefore, [B] = [C] = k₁ k₁ + k₂ k₂ [A]0 (1-e-(k₁+2)) - [A]0 (1 − e−(k₁+k2)1) k₁ + k₂ For a reaction with k₁ = 300 s¹ and k₂ = 100 s¹, plot the concentrations of A, B and C against time given an initial concentration of reactant [A] = 2.0 mol dm³.


P2.2.4 The World Geodetic System is a set of international standards for describing the shape of the Earth. In the latest WGS-84 revision, the Earth's geoid is approximated to a reference ellipsoid that takes the form of an oblate spheroid with semi-major and semi-minor axes a = 6378 137.0 m and c = 6356752.314245 m respectively. Use the formula for the surface area of an oblate spheroid, Subt = 27² (1+atanh(e)). where e² = 1 to calculate the surface area of this reference ellipsoid and compare it with the surface area of the Earth assumed to be a sphere with radius 6371 km.


10. Write a function that takes a string as an argument, and returns a dictionary that maps each character to its frequency in the given string. For example: freq('Star Wars') returns ('S':1, 1:1, 'a:2, Y:2, "":1,"W":1, 's':1}


8. If one character is one byte, how many characters would be printed by this code? filel-open("test.txt") for i in range(100): print(file.read(10)) file1.close()


5. What does the following code print? heaters ('oven', 'stove') print('microwave' in heaters)


4. What will be the output of the following Python code? a-("Check")*3 a) (Check CheckCheck) b) *Operator not valid for tuples c) ("CheckCheckCheck')


2. What will be the output of below Python code? tuple1=(5,1,7,6,2) tuple1.pop(2) print(tuple1) a) Error h(5,1,6,2) c) (5,1,7,6) d) (5,1,7,6,2)


1. Select the right way to access value 20 from the following tuple: Tuple ("Orange", [10, 20, 30], (5, 15, 25)) a) Tunle[1:2][1] b) Tuple [1:2](1) c) Tuple[1:2][:1] d) Tuple[1][1]


Assignment Problem Statement Assignment 3: Part 1 - Online Grocery An online grocery is a grocery store that allows the customers to order grocery items online and then the order can be either collected by the customer or delivered to the customer address. You are going to create a program that simulates the ordering system from an online grocery. Questions for Part 1: Q1- Create the items data structure: Create the (Grocery) data structure with at least 20 items. Each item is a separate data structure with its details: item number(id), item name, item price,** quantity** in stock. For example: [{"Milk":["001139801",10,20]}, {}, {}] OR [[001139802,"Milk”, 10,20], [ ], [ ]] (Note: the selection off the data structures is up to you, the above are just examples) Q2-Ordering: 1. ** Display** y** all items, each item with its price, to allow the customer to decide what to buy. 2. The customer has to enter the item name and the quantity of each item he/she wants to buy. And your code must validate that the item name is in the (Grocery) data structure and also validate the quantity. 3. The customer can continue ordering by typing the item name and quantity until he/she types pay. 4. If the customer orders an item; the quantity in the (Grocery) data structure must be reduced according to the user ordered quantity. 5. If the customer tries to order an item that is out of stock, display a message that the item is out of stock and DON'T add the item to the (Order) data structure. 6. If the item name entered and quantity entered by the customer are ok after all validations, then the item name, ** unit** price, entered** quantity and the calculated price** according to the entered quantity will be saved in the (Order) data structure. Q3 - Payment and Invoice: 1. The program must calculate the total bill amount. 2. The program will ask the customer to enter his/her name and **credit card **number (must be a number of 16 digit length). 3. The total bill amount will be updated according to the below delivery,** discount** and VAT options: Delivery: • If the customer needs delivery, then ask the customer to enter the emirate and **check if it is correct emirate **then charge **5 for Abu Dhabi**,** 10 for Al Ain **and** 20 for other emirates.** Discount: Only one discount can be applied to any total bill amount, confirm which one the customer wants to apply: ly 10% discount. 1. If the customer buys **more than 5 items**, app pply 20% discount. 2. If the total amount is **more than 200 AED** a 3. If the customer uses Fazza, apply 15% discount VAT: Apply a VAT of 5% to the total bill amount. 1. The (Payment) data structure must include the customer name, number**** total** bill amount. ** credit card 2. A new data structure (Invoice) must be created to include the (Payment) and the (Order). For example: Invoice = { order: [ ], payment: [ ] } (Note: the selection off the data structures is up to you, this is just an example) 6. Invoice:** Print the invoice with the order details and payment details.** Requirements for Part 1: 1. Your program should use appropriate user defined functions for all the processes like: ordering, updating the grocery items quantities, payment, discounts, delivery and printing the invoice. 2. Use two-dimensional data structure. Choose appropriate data structures such as a list, tuple, set or a dictionary to store data. 3. Print the invoice for the user, along with adding a VAT of 5% to the total bill amount. Part 2: Data analysis and Visualization: You are tasked to analyze and visualize data using python code and libraries. Choose one dataset from the datasets provided in this link, which also includes additional information on the datasets, and then write and comment on the code to answer the below question. 1. Write a code to Import a dataset selected from the link above into a pandas dataframe and provide a brief description of the dataset. 2. Write a code that will select a random sample of 100 from the original data set and save it as a new dataset.** (Use this sample to answer the remaining questions)** 3. Write a code to display the first 20 and last 20 rows of the dataset and display the number of columns and rows in the dataset. From what you can observe, report any insights revealed about the dataset. 4. Using the random sample dataframe from question 2, write a code that will select a column of interest from your dataset with string data type and arrange the data in alphabetical order, take note of the first value of the current sorting. Then rearrange the data in reverse alphabetical order and take note of the first value of the new sorting. 1. Using the same column generated by question 4, write a code that will summarize its content with a frequency table and create percentages. Observe the data and explain your findings. 5. Write a code to choose a specific numerical column and calculate the average of that column. Then write a code to find the maximum and minimum for that column. Observe the data and explain your findings. 6. Write a code that would create 2 new columns from a selected numerical column: The first new column is the result of multiplying by 3. The second new column should be** half the value of the original column**. 7. Using a column in your dataset with repeated values. Apply a dataframe function by writing a code to calculate the distribution of this column and create a bar chart to visualize the data. Customize the colors in the bar chart, ensure that x and y labels have appropriate titles, and a main title. Describe what you can observe from the created chart briefly. 8. Identify 2 numerical columns. Write a code that will create a line chart to visualize the data, customize the colors of each line, make sure to show x and y labels, provide a title and describe the shape of the chart. 9. Develop a specific question related to data filtering and analysis in your selected dataset. Write a code to answer your question and include a brief explanation of the results obtained. You may use **matplotlib library **for data visualisation, provided that you explain the functions used for this module, if it is not explained then it will negatively impact your grade. Instructions for Students: 1. You will be working on this assignment in a group. 2. Algorithm and Flowchart are required only for part 1. 3. You can not use AI tools (such as ChatGPT or Bard) to help answer the questions. You must only utilize the tools and programming structures that have been instructed in class thus far to receive complete credit. Code with advanced tools or programming structures not covered in the course will get a score of 0. In addition, you must understand every single line of code submitted. You must attend a technical interview on your assignment explaining your approach to coding if needed. 4. Make sure that you submit your original work. Suspected plagiarism cases will be treated as possible academic misconduct and will be reported to the College Academic Integrity Committee for formal investigation. As part of this procedure, your instructor may require you to meet with them for an oral exam on the assignment. 5. Failure to comply with the instructions will result in a 0 grade on the relevant portions of the assignment. Your instructor will grade your submission based on what you submitted on Forum within the allowed deadlines. Do not submit your assignment via email. Failure to submit an assignment or submitting an assignment for another student from the same class or another class will result in a 0 grade without the opportunity to resubmit. Submission: Primary Resource: A single PDF file of your ipynb workbook which includes separate cells for part 1 (online grocery) and part 2 (Data analysis and Visualization). A neat, clearly presented, and easy-to-read file should be submitted. The file should be submitted with the filename "student_name.pdf". The PDF file of your ipynb workbook should include the following as part of the solution to the problem given below. 1.** Algorithm**, which clearly describes all steps and sub-steps required to arrive at the solution, with clearly defined step numbers. 2.** Flowchart**, which is a picture that uses the standard notations of a flowchart and depicts the flow of control. 3.** Python code for part 1 and part 2**, which must NOT be a picture. The error-free code with all the proper documentation and indentations must be included. 4. **Test cases ** for part 1: include and explain at least 3 test cases to demonstrate that the program works correctly. One test case has to be a failure case. 5. A paragraph mentioning the individual contribution of each group member. 6.** References** (list any references used in APA format) Secondary Resource: A Zip folder. The folder should be submitted with the name "student_name.zip". The ZIP folder should include all additional files below to support your solution to the problem. 1. The .ipynb** file** 2. 2.** Flowchart (if not included in the workbook)** Note: If the PDF is not submitted as a primary resource, i.e., if the PDF as is submitted as a secondary resource, the final grade will be no more than 2. If the ipynb file is not submitted (as secondary resource), the final grade will be no more than 2. Assignment Guidelines: As you solve each part of the problem, follow the steps of algorithmic thinking as outlined below. Step 1:** Algorithm Description**. Use an algorithm and a flow chart to develop and express your algorithm that accomplishes the given task. Remember, you must be very explicit and clear to ensure one can achieve the required solution following the steps of your algorithm. Describe the input(s), output(s), and the process of the algorithm. Follow the flowchart shape conventions reading, available here. Step 2:** Python Code.** You can use Anaconda or Colab to work on the Jupyter Notebook you will submit as your final project on Forum. 1 – You may download this Jupyter Notebook to your local machine. 2 - Open a tab in your browser and type https://colab.research.google.com/. 3 - This will open a small window. Choose the last option, Show notebooks in Drive on the upper menu, "Upload". Then, choose the Jupyter Notebook you have saved. 4 - You can start working on your assignment by answering the questions in the corresponding cells. 5 - If you have any questions, please get in touch with your instructors or the CIS tutors. Implementation: Implement the algorithm in Python using the basic concepts and structures we covered in class (IMPORTANT: ONLY USE CONCEPTS COVERED IN CLASS). • User input • Variables • · Logical, Relational and Arithmetic Operators


1. Write a Python function that accepts a list of strings as an argument (list_1). The function should process the list of strings to determine which list element is the longest string (made up of the most characters). The longest string found in the list should be sent back as a return value to the calling code. For example, if the list ['Cat', 'dog', 'Hello Python', 'zebra', 'abcd'] was sent as an argument to the function, the string 'Hello Python' should be sent back as a return value to the calling code. Make sure to test your function from the main program of your Python file and print the result to ensure it works correctly.


/n Instructions Need help with a monte carlo simulation Need the Python Code And produce two histograms for each task (1-10) then an overall project histrogram duration and overall cost. Complete all task mentioned In Assignment File Note: No Need Of MS Project File


KAPLAN Assessment Task Information Key details: Assessment title: Module Name: Module Code: Tutor's Name: Assessment will be set on: Feedback opportunities: Assessment is due on: Assessment weighting: INTERNATIONAL PATHWAYS Programming Assignment Part 2 Information Technology FC308 Peer feedback on class, tutor feedback 40% Assessment Instructions What do you need to do for this assessment? In this assessment you are required to develop and test a Python program and then write up a report about your solution. This document contains two scenarios, but the student only needs to provide a program and essay about one of the scenarios. Students can choose either Scenario A or Scenario B, but not both. You are encouraged to speak with your tutor about which of these Scenarios you are best suited to solve, and how best to progress. Students should complete the task based on the scenario chosen and provide evidence to meet all the criteria. Evidence must be provided to show key elements of this assessment: • Analysis of the scenario and the application of computational thinking skills. • Technical understanding of the data structures, algorithms, functions, and data types. • Development of a programming solution in Python. The testing and evaluation of the solution during the development process and at the end of the development. The following sections should be included in the report submitted: 1. Analysis 2. Design (Using an algorithm) 3. Technical Overview 4. Developing the Codded Solution 5. Testing to Inform Development 6. Testing to Inform Evaluation 7. Evaluation of Solution 8. References Kaplan International Pathways 1 kaplanpathways.com The sections are described on the following page. It is recommended that you consult the marking rubric and marking check list to identify the weighting that goes with each of the categories and the scores for each category. This page and the following page contain a short description of what each of the sections. 1. Analysis The analysis section should contain an analysis of the scenario which is being worked on. In this section students should identify what is important about the scenario. It is important that this section contain a set of success criteria which indicate what features the solution should have and can be used later in the report to assess how well the final program fulfils the success criteria. In this section students should consider the requirements that all stakeholders have and anticipate any likely features that are complimentary to the ones identified in the scenario. The analysis can also draw upon research into other applications and into the needs of the stakeholders. 2. Design (Using an algorithm) The design section should include a description and representation of the algorithms that are going to be used in the making of the final project. The algorithms that are designed should be represented using either flowcharts or pseudocode, and the correctness and completion of these representations will be considered in the awarding of marks. If there are elements that are key for the final program missing from the representations of the algorithms this will negatively impact this section. Hence, it is recommended that these algorithms be as complete as possible and contain comments where appropriate. 3. Technical Overview The technical overview section should contain a detailed description of the data structures, programming techniques and methods used in programming the final solution. This means that students should identify and describe the use of things like iteration, selection, and the use of sub functions in the code (built in Python functions or ones that are defined in the code). It also means that students should describe the nature of the data structures that are used in the project. In other words, the variable 'name' should be identified, and the type of data should be given (i.e., a string) and the purpose of that variable should be identified. The same should be done for complex data structures. It is also recommended to include a justification for the use of the type of variable for storing the data in the program. 4. Developing the codded solution This section should contain a complete list of the final python code, and that code should contain comments which describe that code. If there are elements in the final Python project which are not planned in the design section or technical overview, this will likely reduce the grade awarded. The omission of an explanation for the use of programming techniques indicates that the student may not fully understand the reason for using such programming techniques. If the student has used code from other sources such as the internet or a textbook, the code should be cited, and a reference should be included at the end of the report. A note about data storage: Students are reminded that only data storage methods that have been taught on the module should be used in the development of the program. If you are in doubt about whether the storage type that you have chosen is on the course, please speak with your tutor. Kaplan International Pathways 2 kaplanpathways.com 5. Testing to inform development This section should contain a description of the testing that went on during the development of the solution. Testing is an important part of the development process. For example, if data is to be stored in a text file for use in the program, the function for storing and retrieving the data from the file needs to be tested for it to work within the program as expected. It is also recommended that this section contain a description of how any code was changed to fix any problems encountered. Therefore, it is important that students record the changes that they have made to the code. 6. Testing to inform evaluation This section should contain a description of the systematic testing of the final project that is produced. It is recommended that the students use the success requirements identified in the analysis part of the report to direct their testing, although testing should not be limited to those areas identified in the analysis. Through the testing it is important that students assume that the user will not always input the required information or the required type of information into the program. The program should not fail or stop if the user does not enter the required data in the correct format so it is important for the student to test for edge cases and type errors etc that would raise exceptions or stop the program running as expected. 7. Evaluation of Solution In this section the final solution should be evaluated against the scenario that was presented to the student and against the success criteria that was identified in the analysis section of the report. The evaluation should draw upon the analysis section and consider the needs of all the stakeholders. The evaluation should also consider possible additions to the program that would add additional features or functionality that would be complementary to the program. 8. References A list of references that are in the Harvard referencing style should be provided along with citations in the text of the report to reference the materials used in the project. Guidance: For this assessment you should make use of the following formative activities and summative assessments that you have already completed. These activities have been designed to support this summative assessment: • Programming Assignment Part 1 Feedback • Formative Assessments for topics in the Programming and Computational Thinking Themes. Please note: This is an individual assessment so you should not work with any other student. Your tutor will also ask for a draft copy of your report and provide written feedback. Before you submit this assessment, you will have an opportunity to receive feedback from Kaplan International Pathways 3 kaplanpathways.com your peers (other students in the class). Your tutor will arrange a time for you to share and discuss your progress with your classmates. You do not have to act on their feedback, but you may find it useful to enhance your final submission. The task has been designed to encourage you to develop more sophisticated programs which can showcase your programming skills and allow you to develop more complex algorithms. The complexity and originality of your work will be considered in the awarding of a grade for this piece of work. The following pages contain Scenario A and Scenario B Scenario A: Vocabulary Builder Program Specification Introduction Abdullah works for an educational company that produces books and other materials to help school children study for their school subjects. Abdullah has been asked to produce a program in Python that helps children develop their vocabulary and learn the definitions of the words they learn in their classroom. The skills that Abdullah has been asked to quiz are remembering words, as well as their definitions, and the subjects that he can draw upon could be any subject that student's study in school such as Maths, Science, History, Art, Computer Science etc. INNOVATE to make changes in something established, especially by introducing new methods, ideas, or products. It has been suggested to Abdullah that he try to make a word game in which the user guesses the letters in a word and is then given a chance to guess what that word is or can simple guess the word given the number of characters it contains. Other suggestions include, testing to see if students can match the definitions of words with the words themselves. Abdullah thinks that it will be engaging to award points to students, or to keep track of the progress users make using the completion of tasks. Abdullah wants to create a user interface that allows students to login to the system and to do quizzes or word games that are designed to engage students in learning vocabulary, and to keep track of her progress through small quizzes or games that can be completed over a short time. Keeping track of the progress of that the user is making can be done through the awarding of points for completion of tasks, and these points can be shared or displayed in a high score list. Storage It is recommended that the vocabulary builder program should store: • A username and password for each user. . • • Either the score of the user or the progress the user is making with the games (or both). A comprehensive word list alongside their definitions that should be stored in an appropriate file. Student level or difficulty setting to tailor the learning experience to different levels or stages. Personalisation of the application can be achieved through the storage of incorrect guesses, or a list of mastered words to avoid repetition. Minimal Requirements You have been asked to analyse the requirements for this system and to design, develop, test and evaluate a program that Sophie to at least: • Login with a username and password. Access a menu system that allows the user to pick a game. The user should be able to play a game that is suited to their level or learning. Kaplan International Pathways 4 kaplanpathways.com • The user's progress should be stored either through the scores or through the record of the completion of games. • At least two types of vocabulary games (Suggestions include word guessing or definition matching). As the designer of the application, it is your responsibility to add functionality to the program which you can justify according to the scenario. In other words, this specification page details the minimum requirements for the programming project. The final solution will be awarded marks based on the complexity and the use of programming techniques that are developed on the course. You are recommended to go beyond this specification and try to showcase your programming skills and technical understanding. Scenario B: Budget Tracker Program Specification Introduction Sophie works for a bank committed to helping customers achieve their financial goals. She's tasked with developing a simple budget tracking application to encourage responsible saving habits. This app will be promoted to bank customers of all ages and technical backgrounds. Sophie's project is all about making budgeting easy. She wants to create an application that allows users to track their income, categorize their expenses (like bills, groceries, entertainment, etc.), and visualize their spending patterns. The goal is to help users understand where their money goes and identify areas where they could potentially save more. Sophie is thinking about including features like setting up savings goals, providing tips on cutting down unnecessary expenses, and maybe even incorporating some fun challenges that encourage users to save more. Sophie wants to create a user interface that is welcoming and easy to use. Users should be able to easily create an account and input their financial information. The application should provide clear visualizations of spending habits and offer insights to empower users to make informed financial decisions. Morning, Sophie! Bank Accounts: Mortgage: -£120,000 Savings Account: £500 Outgoings: Gas and Electricity: £120 per month Council Tax: £128 per month like to do? What would I you a) Add a purchase. b) Add a bill. Storage It is recommended that the vocabulary builder program should store: • A username and password for each user. • • The income or allowances of the user (amount and frequency - e.g. weekly, monthly etc) Expenses (broken down by category, e.g., housing, food, transportation, entertainment) with their amounts and dates. Current balance. Savings goals (for example target amounts to be saved and the desired time frame to save it.) Minimal Requirements You have been asked to analyse the requirements for this system and to design, develop, test, and evaluate a program that Sophie to at least: Login with a username and password. • . • Access a menu system that allows the user to: add income, add expense entries, view current balance and recent transactions, and set up a simple savings goal. A savings overview which shows the current balance after subtracting the expenses from income. This could display how much is potentially available for saving. A way of displaying the spending habits of the user either according to the categories, or the Kaplan International Pathways 5 kaplanpathways.com


ELEC 4806/5806 Introduction to Deep Learning and PyTorch/TensorFlow Lab 6 LSTM -Twitter Emoji Prediction Model 1. Experiment goal: Understand RNN • Understand LSTM. • • Understand data preprocessing and cleaning. For this lab only use framework PyTorch to demonstrate your logical understanding of the concept. 2. Introduction: Theory Problem: Long short-term memory (LSTM) is a variation of an RNN model. An RNN can only memorize short-term information, but LSTM can handle long time-series data. Code Problem: In this lab, you will implement LSTM using glove word embedding(glove. 6B.100d.txt ) algorithm with mapping .csv, train.csv,test.csv and Outformat.csv Please refer to the LSTM modules to complete this lab. But you need to pay attention to the following: • Import the libraries. • Import the input files. mapping = pd.read_csv("/Mapping.csv") train = pd.read_csv("/Train.csv") test = pd.read_csv("/Test.csv") out = pd.read_csv("/OutputFormat.csv") • train data. • Test data • • Plagiarizing code directly from other websites is not allowed. Please try to use Google Colab to complete this Lab. Without GPU, the training process may become unacceptably long. Submission requirements (all team members need to submit): 1. Please submit the .ipynb file and make sure i can easily run your code. If you use google colab, you can download the .ipynb file by clicking “File→Download→Download .ipynb". Please include the names of all team members in the file name. 2. Please submit a pdf version as well. You can use this website (https://htmtopdf.herokuapp.com/ipynbviewer/) to convert your .ipynb file to pdf. 3. Please record a video to demo your work. Especially the code problem 4. When you are recording a video, if you just read the comments you wrote in the code, or read according to a script, then you will not be able to prove that the work was done independently by you. Therefore, the lab will be judged as plagiarism.


Question 2. (simulation.py): Develop a program that generates raw material arrival time for a job shop simulation system. There are different material types, and they could arrive at a random time between 0 and 5 (float value) minutes after the previous item. Develop a function called simulate that accepts two arguments, a list of job types and number of arrival times to generate. The function should generate arrival times for randomly selected job types. Each job arrives in a randomly generated time after the previous job. Generation always starts at time 0. For example, assume we have 3 types of jobs, "A", "B", and "C", and we need to generate 3 random arrivals. First, we pick a random job type. Assume we randomly pick type "C". To generate the first arrival, we generate a random value between 0 and 5, for example 0.556. Since we start at time 0, arrival time for the first job (which is of type "C") becomes 0.556. Next, we select another random job type, for instance, "C". Then, we generate a random time between 0 and 5, for instance 1.375. This means the arrival time for the second job becomes 1.931 (0.556 + 1.375). Next, we pick a random type for the last job, for instance "A". Finally, we generate a random number between 0 and 5 to determine the arrival time for the last job. Assume 0.698 is generated. This makes the arrival time for the last job 2.629 (1.931 +0.698). The simulate function should return a list of these generated arrival times and job types. Each list member should be a tuple with two values, first the arrival time and second the job type. This function should also print this information in the following format. Each arrival entry should be written in a separate line with arrival time as the first value and job type as the second. The two values should be separated using a comma (,) Next, develop a function called process arrivals that receives the generated arrival times and service times for each job type and determines how long it takes to process all these jobs. This function should accept two parameters, a dictionary of service times and a list of arrivals, which is structured the same as the return value of the "simulate" function. The service times dictionary should be a dictionary, where keys are job types (e.g., "A", "B") and values are associated service times. An example of the service times dictionary (first input parameter) is shown below. {"A": 2, "B": 3, "C": 1} This function should go over all the jobs and find their processing start time considering when the previous job's processing ended. It should process jobs in the order of arrival. For instance, if the processor finishes processing a job at time 10 and the next job had arrived at time 9, its processing will start at time 10. The above example indicates that a job of type "A" takes two-time units to process, type "B" takes 3-time units, and type "C" takes 1 time unit. This function should return a single number, which is the total time it takes to process all these jobs.


Question 3 (product_class.py): Develop a class called 'Product' that is initialized using the following values: 'id', 'price', 'inventory', and 'condition'. During the initialization, the value for 'condition' should be checked and if it is anything other than "New", "Used", or "Refurbished", the constructor should raise a 'ValueError'. The class should have two main methods; 'sell' and 'stock'. Both methods accept one argument, which is the quantity. The 'sell' method is called whenever a specific quantity of the product is sold. It must update the inventory and print the new inventory on the screen. If the sold quantity is greater than the inventory, a 'ValueError' should be raised. The 'stock' function is called whenever a specific quantity of the product is added to the inventory. This method must update the inventory and print the new inventory on the screen. For example, if you create a product called 'product a' with the initial inventory of 5, calling following methods should result in the following messages. product_a = Product(123, 45.88, 5, 'New') product_a.sell(3) # Available inventory: 2 product_a.stock(1) # Available inventory: 3 product_a.sell(3) # Available inventory: 0 product_a.sell(1) # ValueError: Ordered quantity cannot be greater than inventory


No Question Found for“Python”

we will make sure available to you as soon as possible.