http://www.linfo.org/touch.html
As it is very new to me. I am sharing that with you all.
Posted in Bash/Shell Scripting
Code:
Student.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class Student{ //variable declaration int id; String name; String gender; //method deinitions boolean updateProfile(String newName){ name=newName; return true; } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
class StudentTest{ public static void main(String[] args){ //Creating a new student object Student s = new Student(); //setting student state s.id =1000; s.name="Zaki"; s.gender="male"; //3. Update your profile with correct name s.updateProfile("John"); } } |
Posted in Java, Java, OO Analysis and Design, OOP, Python
Need to revise everything.
Posted in Java, OOP, Programming, Python
https://www.quora.com/Is-there-any-good-online-course-on-Object-Oriented-Analysis-and-Design
https://www.codeproject.com/Articles/1137299/Object-Oriented-Analysis-and-Design
Posted in OO Analysis and Design, OOP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
using System; using Polymorphism; namespace Polymorphism { public static class CalCc { public static int add(int a, int b) { return a + b; } public static int add(int a, int b, int c) { return a + b + c; } public static float add(float a, float b) { return (a + b); } } } class ProgramTest { static void Main(string[] args) { Console.WriteLine(CalCc.add(12,23)); Console.WriteLine(CalCc.add(12,23,25)); Console.WriteLine(CalCc.add(5.6f,7.8f)); Console.ReadKey(); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
using System; using Polymorphism; namespace Polymorphism { public static class CalCc { public static int add(int a, int b) { return a + b; } public static int add(int a, int b, int c) { return a + b + c; } public static float add(float a, float b) { return (a + b); } } } class ProgramTest { static void Main(string[] args) { Console.WriteLine(CalCc.add(12,23)); Console.WriteLine(CalCc.add(12,23,25)); Console.WriteLine(CalCc.add(5.6f,7.8f)); Console.ReadKey(); } } |
Method Overriding:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
//override mane ektar opor arekta chore bosha //mane ekta method er opor arekta method chore boshakei bole method overriding //eta runtime ei hoy //jei method tay override hoy setay override use korte hoy //jei method tar opor override hoy seake virtual sombodhon korte hoy //in this example we are overriding the eat method using System; namespace MethodOverride { class Program { static void Main(string[] args) { Dog d=new Dog(); d.eat(); Console.ReadKey(); } } public class Animal { public virtual void eat() { Console.WriteLine("Eating Food."); } } public class Dog : Animal { public override void eat() { Console.WriteLine("Eating bread"); } } } |
another good exmple:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
using System; namespace MethodOverrideExample { class Program { static void Main(string[] args) { Cars[] c = new Cars[2]; c[0]=new newCars(); c[1]=new oldCars(); foreach (Cars key in c) { key.printInfo(); } Console.ReadKey(); } } class Cars { public virtual void printInfo() { Console.WriteLine("This is the base class"); } } class newCars : Cars { public override void printInfo() { Console.WriteLine("This is new cars class"); } } class oldCars : Cars { public override void printInfo() { Console.WriteLine("This is the old cars"); } } } |
this video is good for learning overriding:
Method Hiding:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
using System; namespace Method_Hiding { class FC { public virtual void Display() { Console.WriteLine("FC: Display"); } } class SC : FC { public new void Display() { //base.Display(); Console.WriteLine("SC: Display"); } } class TC : SC { public new void Display() { //base.Display(); Console.WriteLine("TC: Display"); } } class Program { static void Main(string[] args) { SC p1=new SC(); p1.Display(); //((FC) p1).Display(); oobject casting FC p2=new FC(); p2.Display(); // SC pp = new FC(); it is not possible Console.ReadKey(); } } } |
Posted in .NET, C#, OO Analysis and Design, OOP
Posted in OO Analysis and Design, OOP
Posted in OO Analysis and Design, OOP
Posted in OO Analysis and Design, OOP
Calculator.cs
1 2 3 4 5 6 7 8 9 10 11 |
namespace ConsoleApp6.Math { public class Calculator { public int Add(int a,int b) { return a + b; } } } |
Program.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
using ConsoleApp6.Math; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp6 { class Program { static void Main(string[] args) { Person john = new Person(); john.FirstName = "John"; john.LastName = "Smith"; john.Introduce(); Calculator calculator = new Calculator(); var result = calculator.Add(1, 2); System.Console.WriteLine(result); } } } |
Person.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
using System; namespace ConsoleApp6 { public class Person { public string FirstName; public string LastName; public void Introduce() { Console.WriteLine("My name is:"+FirstName+" "+LastName); } } } |
Training Set is a subset of the dataset used to build predictive models.
Validation Set is a subset of the dataset used to assess the performance of model built in the training phase
– It provides a test platform for fine-tuning model’s parameters and selecting the best performing model
– Not all modeling algorithms need a validation set
Test set or unseen examples is a subset of the dataset to assess the likely future performance of a model.
– If a model fits the training set much better than it fits the test set. Overfitting is probably the cause
Binary Classification(two class classification)
true|false, 1|0, -1|+1, male|female
Multi-class classification problems can be seen as binary classification problems.
Model Evaluation: