Skip to content
Open

dfg #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Boosting.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
class Boosting extends Model{

}
14 changes: 14 additions & 0 deletions Dao.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.others;

/**
*
* @author Вика
*/
public interface Dao {

}
14 changes: 14 additions & 0 deletions DaoImplementation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.others;

/**
*
* @author Вика
*/
public class DaoImplementation {

}
43 changes: 43 additions & 0 deletions EmptyArrayException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package src.result.exceptions;

/**
*
* @author Вика
*/
public class EmptyArrayException extends Exception{
public EmptyArrayException(){
super();
}
public EmptyArrayException(String message){
super(message);
}
public EmptyArrayException(String message, Throwable cause){
super(message, cause);
}
public EmptyArrayException(Throwable cause){
super(cause);
}
public static void dotProduct(double[] a, double[] b) throws EmptyArrayException{

if ((b.length == 0) || (a.length == 0) ) {
throw new EmptyArrayException("Нулевые массивы");
}
}
public static void main(String[] args) {
double[] a = {};
double[] b = {1};
EmptyArrayException sed = new EmptyArrayException();
try { sed.dotProduct(a,b);


} catch(EmptyArrayException e){
System.out.println("Мы поймали ошибку!");
}

}
}
14 changes: 14 additions & 0 deletions FileReader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.workwithfiles;

/**
*
* @author Вика
*/
public interface FileReader extends FileWorker {

}
14 changes: 14 additions & 0 deletions FileWorker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.workwithfiles;

/**
*
* @author Вика
*/
public interface FileWorker {

}
14 changes: 14 additions & 0 deletions FileWriter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.workwithfiles;

/**
*
* @author Вика
*/
public interface FileWriter extends FileWorker{

}
44 changes: 44 additions & 0 deletions InconveninentShapeException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package src.result.exceptions;

/**
*
* @author Вика
*/
class InconveninentShapeException extends Exception{
public InconveninentShapeException(){
super();
}
public InconveninentShapeException(String message){
super(message);
}
public InconveninentShapeException(String message, Throwable cause){
super(message, cause);
}
public InconveninentShapeException(Throwable cause){
super(cause);
}

public static void dotProduct(double[] a, double[] b) throws InconveninentShapeException{
if (a.length != b.length) {
throw new InconveninentShapeException("Разные размеры массивов");
}
}
public static void main(String[] args) {
double[] a = {1, 2, 3, 4};
double[] b = {1, 1, 1, 1, 2};
InconveninentShapeException sed = new InconveninentShapeException();
try { sed.dotProduct(a,b);


} catch(InconveninentShapeException e){
System.out.println("Мы поймали ошибку!");
}

}
}

14 changes: 14 additions & 0 deletions KNeighbourhood.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
class KNeighbourhood extends Model{

}
14 changes: 14 additions & 0 deletions LinearKernel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
class LinearKernel extends KNeighbourhood{

}
14 changes: 14 additions & 0 deletions LogisticRegression.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
class LogisticRegression extends Model{

}
58 changes: 58 additions & 0 deletions MathService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package src.result.others;

/**
*
* @author Вика
*/
public class MathService {
public static double dotProduct(double[] a, double[] b){
double result = 0;
for (int i = 0; i < a.length; i++) {
result += a[i]*b[i];
}


return result;
}


public static double sigmoid(double x){

double d = Math.exp(-x);

double result = 1/(1+d);

return result;
}
public static double sigmoid(double[] p, double[] w){
double k = 0;
for (int i = 0; i < p.length; i++) {
k += p[i]*w[i];
}
double f = Math.exp(-k);

double result = 1/(1+f);

return result;
}

public static void main(String[] args) {
double x = 2;
double[] a = {1, 2, 3, 4};
double[] b = {1, 1, 1, 1};
double[] p = {1, 1, 1, 1};
double[] w = {1, 1, 1, 1};

System.out.println(MathService.dotProduct(a,b));
System.out.println(MathService.sigmoid(x));
System.out.println(MathService.sigmoid(p,w));
}

}


14 changes: 14 additions & 0 deletions Model.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
abstract class Model {

}
14 changes: 14 additions & 0 deletions ModelSelectionHibernateEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.others;

/**
*
* @author Вика
*/
public class ModelSelectionHibernateEntity {

}
14 changes: 14 additions & 0 deletions NaiveBayes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
class NaiveBayes extends Model{

}
14 changes: 14 additions & 0 deletions NormalKernel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.machinelearning.models;

/**
*
* @author Вика
*/
class NormalKernel extends KNeighbourhood{

}
14 changes: 14 additions & 0 deletions ReviewHibernateEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.others;

/**
*
* @author Вика
*/
public class ReviewHibernateEntity {

}
14 changes: 14 additions & 0 deletions SwingModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.others;

/**
*
* @author Вика
*/
public class SwingModel {

}
14 changes: 14 additions & 0 deletions SwingTraining.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ru.caf82.result.others;

/**
*
* @author Вика
*/
public class SwingTraining {

}