Skip to content

analytics-club-iitm/DC-Task-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

DC Task 1

There’s 2 questions in the task to help you get comfortable with Python, do try both of them out.

  1. Python Tasks:
  • Check the above recording out to get started with Python.

  • A. Create two vectors 𝑦 and 𝑦̂ having the same dimensions, where 𝑦̂ should consist of random numbers between [0,1) and 𝑦 should contain 0𝑠 and 1𝑠, for example, 𝑦=[0,1,1,0,1,0,0,1,...,1]. Compute the given expression:

    loss

    Where n = 100, is the total number of elements in y and 𝑦̂

    Note: The expression O, which you have computed is actually a Cross-Entropy loss function used in machine learning for classification tasks which tells us how bad or good the model is performing, if O is large then the model is performing worst and vice versa.

  • B. Write a Python class to find a pair of elements (indices of the two numbers) from a given array whose sum equals a specific target number. Note: There will be multiple solutions, so create a dictionary where the keys represent just [S.No] (1,2,3,4.....) and the value corresponding to the key represents the indices of the two numbers

    For example:

    Input: numbers= [10,20,10,40,50,60,70], target=50

    Output: {1: [0, 3], 2: [2, 3], 3: [3, 0], 4: [3, 2]}

  1. Git Tasks:
  • Fork and clone this Github repository.
  • Create a new branch and set its name to your “Name”.
  • Create a folder named "Name" (or Handle) in which you have all the contents of the code you want to submit. (solutions to question A and B).
  • Merge your branch with the master branch.
  • Pull origin & add files, commit and push to fork.
  • Create pull request on main repo.
  • Create Issue.(optional)

Extra resources for Getting Started with Git:

About

Introductory task on python and Git

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published