Skip to main content

Posts

Showing posts from 2017

Ensemble Learning

In ensemble learning we combine the output of multiple classifiers in order to on better prediction on classification accuracy. The classifcation of resultant classifer is better then the resultant classifier. We need a way to combine the output of multiple classifiers. First we generate a group of base learners. These learners will be using different algorithms.(say learner which uses a Dicision Tree,Neural Network, Support Vector Machine etc..), they could be same algorithms with different hyperparameters, could have different representations or may use different training sets. Muliple learner will give different classifications. 

Uniqueness of Scala

* The declared type of a symbol is given after the symbol and a colon. The declared type can often be omitted, because the compiler can infer it from the context. * A mixin is a class that provides certain functionality to be inherited by a subclass and isn’t meant for instantiation by itself. A mixin could also be viewed as an interface with implemented methods. * Array types are written Array[T] rather than T[], and array selections are written a(i) rather than a[i]. * Functions can be nested inside other functions. Nested functions can access parameters and local variables of enclosing functions. For instance, the name of the array xs is visible in functions swap and sort1, and therefore need not be passed as a parameter to them.

Why Scala

1. Type Inference : Uses type inference to allow the compiler to infer the type of variables from the instances bound to them. We would write the equivalent line in Scala as follows: val myInstance = new Example() The Scala compiler infers that myInstance has the Example type at compile time. A lot of the time, it is enough to specify the types of the arguments and of the return value of a function. The compiler can then infer types for all the variables defined in the body of the function. Scala code is usually much more concise and readable than the equivalent Java code, without compromising any of the type safety. 2. Immutable objects : Scala encourages the use of immutable objects. val rollnos = List("720", "729") // List is immutable rollnos(1) = "5" // Compile-time error Knowing that some objects cannot be changed once instantiated reduces the number of places bugs can creep in. 3.Functional Programming : Scala encourages functio

GoLang from Programming Template

About Memory: 1. How do I get memory, i.e how are variables declared. Any specific facts and constrains about variables ? Basic data types are here .Declare the variables which you'll need outside the entry point of main function. Something like : var ( ToBe   bool       = false MaxInt uint64     = 1<<64 - 1 z      complex128 = cmplx.Sqrt(-5 + 12i) ) local variables can be declared as shown as example in explanation of FOR loop. 2. How do we get the entry point for the program execution ? [ Example : main() in the C program ] func main() --> is the entry point of the program execution. 3. How does dynamic memory handled ? Is it supported in first place ? Yes dynamic memory is supported.  new  allocates zeroed storage for a new item or type whatever and then returns a pointer to it. Go has garbage collection. This means the Go runtime checks in the background if an object or any other variable is not used anymore and if this is the case, frees the memory

Git --CheetSheet=4

Interactive Rebase : 1. git rebase -i HEAD~4  #Interactive rebase to edit last 4 commits 2. Plot : You notice a critical error on your part. The commit where you wrote tests comes after the commit where you made the actual changes. Let's swap these 2 commits so that it looks like you wrote the tests first. Swap the 'Add tests' commit so that it comes before the 'Implement poodles' commit. pick b3f1649 Add unicorn pick 4b65a5a Add tests pick f239187 Implement poodles pick c3f863f Added a title to the homepage 3.Plot : As you're editing your commits, you notice that the commit that says 'Add tests' is a little vague, maybe you should change it to something more specific. Use the reword command to change the message of this commit. pick b3f1649 Add unicorn reword 4b65a5a Add tests to commit pick f239187 Implement poodles pick c3f863f Added a title to the homepage 4.Plot : You remember that the 'Add unicorn' commit also contai

Git --CheetSheet 2

Cloning and Branching : 1. git clone git@example.com/exmaple/petshop.git 2. git remote - show # verbose list of remote connections 3. git branch grooming # create a branch name "grooming" 4. git checkout grooming #switch to branch "grooming" #say some work was done on branch "grooming" #next merge to master 5. git checkout master # switch to master branch 6. git merge grooming # merge the changes of grooming into master 7. git checkout -b octopus #branch named "octopus" is created and checked out. 8. git remote update origin --prune #local branches will be updated. 9. You can check them out as local branches with: git checkout -b LocalName origin/remotebranchname Collaboration Basics : 1. git push -u origin hamsters #push the change to remote brach "hamsters" 2. git fetch # retrieve remote brach 3. git branch -d weasel # delete local brach 4. git push -u origin :weasel #delete the brach remotely. 5. git

Git --CheetSheet=3

Rebase Plot:   There is brach named "kennel", this needs to be merged on to master without merge conflicts. So go to branch "kennel" and rebase "master" on it. Then go to "master" and merge "kennel" into "master". Strategy : 1.git checkout kennel 2.git rebase master 3.git checkout master ________________________________________________________________________________ For no merge conflicts : 1. git fetch #retrieve changes from remote without merging into current branch. 2. git rebase #put the fetched remote commits beneath the present commits. 4.git merge kennel _______________________________________________________________________________ History 1. git log --pretty=oneline 2. git diff 3. git diff master elephant #compare one brachn with another. 4. git diff HEAD~2 HEAD 5. git log -p 6. git blame <file_name> ____________________________________________________________________________

Git --CheetSheet=1

1. git help config #shows the usage details of "config" 2. git config --global user.name "yeshsurya"    #add name to configuration 3. git init  #initialize the git repository 4. git status #get the staus of the git repository 5. git add *.html  #add the files using wild card 6. git commit -m "First commit" # make a commit 7. git add css #all the files in directory "css" is added to staging. 8. git log # shows the commit history. 9. git diff HEAD  #difference of the top most commit 10.git diff --staged  #difference of the staged commit 11.git reset ostrich.html #unstage the staged changes 12.git commit -a -m "the commit message" index.html #stage and commit in a single line. 13.git commit --ament -m "will be added to the second commit" #amends last commit by addding files in the staging 14.git reset --soft HEAD^  #undoes the last commit and puts the changes back to stagin

Changing Icon of a Cocoa Application

1. Get to the taget that is being created   1.a. Click on the root of the project file.This should show up list to tagets available.   1.b. Select the target for which you got to change the icon file 2.Click on "info" tab. 3.Put the name of the icon file in the project file.ICNS file should be listed in the file. 4.Add the icns file in the project "Copy bundle files" section of "Build Phases".

"Swift" from Programming Template

About Memory: 1. How do I get memory, i.e how are variables declared. Any specific facts and constrains about variables ? If type annotation like var Varb:Float ; is not used then it is mandatory to assign the initial value to the variable. "Var" keyword should get you the required memory. 2. How do we get the entry point for the program execution ? [ Example : main() in the C program ] Script based. There is no particular entry point. 3. How does dynamic memory handled ? Is it supported in first place ? Instances for the classes can be created. Automatic Reference counting mechanism has the strong reference to one of the variable. Till there is strong reference to the variable it'll be there in the memory. Once there is no strong reference it'll be de-initialized. [ Ref : https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AutomaticReferenceCounting.html ] 4. What are the datatypes which are supported an

"Action Script" from Programming Template

How do I get memory, i.e how are variables declared ? And specific facts and constraints about variables ? Ex : var food:String; food=”pizza”; Var : keyword, needed by syntax Food: user specific name String: data type, it can be class name or interface name. trace("My favorite food is " + food); // displays "My favorite food is pizza" ________________________________________________________________ How do we get the entry point for the program execution ? Select File > New. In the New Document dialog box, select Flash Document, and click OK. A new Flash window is displayed. Select File > Save. Select the same folder that contains the Greeter.as class file, name the Flash document HelloWorld.fla, and click OK. * In the Flash Tools palette, select the Text tool, and drag across the Stage to define a new text field, approximately 300 pixels wide and 100 pixels high. * In the Properties panel, with the text field still selected on the St