Барам / Имам потреба од програмер, работа, часови, итн

Член од
24 август 2009
Мислења
17
Поени од реакции
0
Mi treba programa vo C++ ili Java za Hufmanovo kodiranje.

Ako ima nekoj ili moze da mi napravi, neka pise. Ke si platam kolku treba.
 

igor108367

Dark Lord Sauron
Член од
25 јануари 2009
Мислења
2.516
Поени од реакции
113
Потребен ми е изворен код за ID3 алгоритамот. Ако знае некој нека пише.
 

SkyDriver

Would like my bananna ?
Член од
31 јули 2008
Мислења
2.140
Поени од реакции
221
Потребен ми е изворен код за ID3 алгоритамот. Ако знае некој нека пише.
Еве ти го во Java :)

Код:
import java.io.*;

import java.util.*;

public class ID3

{

int numAttributes;

String []attributeNames;

Vector []domains;


class DataPoint {

public int []attributes;

public DataPoint(int numattributes) {

attributes = new int[numattributes];

}

};


class TreeNode {

public double entropy;

public Vector data;

public int decompositionAttribute;

public int decompositionValue;

public TreeNode []children;

public TreeNode parent;

public TreeNode() {

data = new Vector();

}

};

TreeNode root = new TreeNode();

public int getSymbolValue(int attribute, String symbol) {

int index = domains[attribute].indexOf(symbol);

if (index < 0) {

domains[attribute].addElement(symbol);

return domains[attribute].size() -1;

}

return index;

}

 

public int []getAllValues(Vector data, int attribute) {

Vector values = new Vector();

int num = data.size();

for (int i=0; i< num; i++) {

DataPoint point = (DataPoint)data.elementAt(i);

String symbol =

(String)domains[attribute].elementAt(point.attributes[attribute] );

int index = values.indexOf(symbol);

if (index < 0) {

values.addElement(symbol);

}

}

int []array = new int[values.size()];

for (int i=0; i< array.length; i++) {

String symbol = (String)values.elementAt(i);

array[i] = domains[attribute].indexOf(symbol);

}

values = null;

return array;

}
 

public Vector getSubset(Vector data, int attribute, int value) {

Vector subset = new Vector();

int num = data.size();

for (int i=0; i< num; i++) {

DataPoint point = (DataPoint)data.elementAt(i);

if (point.attributes[attribute] == value) subset.addElement(point);

}

return subset;

}
 

public double calculateEntropy(Vector data) {

int numdata = data.size();

if (numdata == 0) return 0;

int attribute = numAttributes-1;

int numvalues = domains[attribute].size();

double sum = 0;

for (int i=0; i< numvalues; i++) {

int count=0;

for (int j=0; j< numdata; j++) {

DataPoint point = (DataPoint)data.elementAt(j);

if (point.attributes[attribute] == i) count++;

}

double probability = 1.*count/numdata;

if (count > 0) sum += -probability*Math.log(probability);

}

return sum;

}

public boolean alreadyUsedToDecompose(TreeNode node, int attribute) {

if (node.children != null) {

if (node.decompositionAttribute == attribute )

return true;

}

if (node.parent == null) return false;

return alreadyUsedToDecompose(node.parent, attribute);

}

public void decomposeNode(TreeNode node) {

double bestEntropy=0;

boolean selected=false;

int selectedAttribute=0;

int numdata = node.data.size();

int numinputattributes = numAttributes-1;

node.entropy = calculateEntropy(node.data);

if (node.entropy == 0) return;

 

for (int i=0; i< numinputattributes; i++) {

int numvalues = domains[i].size();

if ( alreadyUsedToDecompose(node, i) ) continue;

double averageentropy = 0;

for (int j=0; j< numvalues; j++) {

Vector subset = getSubset(node.data, i, j);

if (subset.size() == 0) continue;

double subentropy = calculateEntropy(subset);

averageentropy += subentropy *

subset.size();

}

averageentropy = averageentropy / numdata; 

if (selected == false) {

selected = true;

bestEntropy = averageentropy;

selectedAttribute = i;

} else {

if (averageentropy < bestEntropy) {

selected = true;

bestEntropy = averageentropy;

selectedAttribute = i;

}

}

}

if (selected == false) return;

int numvalues = domains[selectedAttribute].size();

node.decompositionAttribute = selectedAttribute;

node.children = new TreeNode [numvalues];

for (int j=0; j< numvalues; j++) {

node.children[j] = new TreeNode();

node.children[j].parent = node;

node.children[j].data = getSubset(node.data,

selectedAttribute, j);

node.children[j].decompositionValue = j;

}

 

for (int j=0; j< numvalues; j++) {

decomposeNode(node.children[j]);

}

node.data = null;

}
 

public int readData(String filename) throws Exception {

FileInputStream in = null;

try {

File inputFile = new File(filename);

in = new FileInputStream(inputFile);

} catch ( Exception e) {

System.err.println( "Unable to open data file: " + filename + "\n" + e);

return 0;

}

BufferedReader bin = new BufferedReader(new InputStreamReader(in) );

String input;

while(true) {

input = bin.readLine();

if (input == null) {

System.err.println( "No data found in the data file: " + filename +

"\n");

return 0;

}

if (input.startsWith("//")) continue;

if (input.equals("")) continue;

break;

}
 

StringTokenizer tokenizer = new StringTokenizer(input);

numAttributes = tokenizer.countTokens();

if (numAttributes <= 1) {

System.err.println( "Read line: " + input);

System.err.println( "Could not obtain the names of attributes in the

line");

System.err.println( "Expecting at least one input attribute and one

output attribute");

return 0;

}

domains = new Vector[numAttributes];

for (int i=0; i < numAttributes; i++) domains[i] = new Vector();

attributeNames = new String[numAttributes];

for (int i=0; i < numAttributes; i++) {

attributeNames[i] = tokenizer.nextToken();

}


while(true) {

input = bin.readLine();

if (input == null) break;

if (input.startsWith("//")) continue;

if (input.equals("")) continue;

tokenizer = new StringTokenizer(input);

int numtokens = tokenizer.countTokens();

if (numtokens != numAttributes) {

System.err.println( "Read " + root.data.size() + " data");

System.err.println( "Last line read: " + input);

System.err.println( "Expecting " + numAttributes + " attributes");

return 0;

}

DataPoint point = new DataPoint(numAttributes);

for (int i=0; i < numAttributes; i++) {

point.attributes[i] = getSymbolValue(i, tokenizer.nextToken()

);

}

root.data.addElement(point);

}

bin.close();

return 1;

}
 

public void printTree(TreeNode node, String tab) {

int outputattr = numAttributes-1;

if (node.children == null) {

int []values = getAllValues(node.data, outputattr );

if (values.length == 1) {

System.out.println(tab + "\t" + attributeNames[outputattr] + " = \"" +

domains[outputattr].elementAt(values[0]) + "\";");

return;

}

System.out.print(tab + "\t" + attributeNames[outputattr] + " = {");

for (int i=0; i < values.length; i++) {

System.out.print("\"" + domains[outputattr].elementAt(values(i)) + "\"

");

if ( i != values.length-1 ) System.out.print( " , " );

}

System.out.println( " };");

return;

}

int numvalues = node.children.length;

for (int i=0; i < numvalues; i++) {

System.out.println(tab + "if( " +

attributeNames[node.decompositionAttribute] + " == \"" +

domains[node.decompositionAttribute].elementAt[i]

+ "\") {" );

printTree(node.children[i], tab + "\t");

if (i != numvalues-1) System.out.print(tab + "} else ");

else System.out.println(tab + "}");

}

}

public void createDecisionTree() {

decomposeNode(root);

printTree(root, "");

}

public static void main(String[] args) throws Exception {

ID3 me = new ID3();

int status = me.readData("c:\\in.txt");

if (status <= 0) return;

me.createDecisionTree();

}

}
 
Член од
14 јуни 2010
Мислења
2
Поени од реакции
0
Барам php програмери кој имаат познавања и со mysql бази.

Работата е од дома.
Може да работи секој што има познавање во работата.
За информации јавете се или пишете на е-маил
Тел бр. 078 266 899
bojanpc@hotmail.com

За 2-3 часа работа можете да заработите една дневница (500денари)

Фала однапред
 

deXterche

тадаммм
Член од
12 февруари 2006
Мислења
4.920
Поени од реакции
941
Ако може повеќе информации во врска со огласов. Што проекти се работат, за кого, како е платено (гледам тука 500 денари за 2 часа).
 
Член од
14 јуни 2010
Мислења
2
Поени од реакции
0
Повеќе детали преку е-маил.
Контактирајте ме има уште работа.
 
Член од
26 јуни 2010
Мислења
4
Поени од реакции
0
напишете 2 програми (1 со процедура, и 1 со макро) кои ќе ги соберат вредностите на AX I BX во CX. .
Кој може да ми помогне ми требаат сликите од симулаторот со задачиве???? може во masm симулатор или било кој :)
поздрав фалаа
 
Член од
22 февруари 2007
Мислења
7.076
Поени од реакции
1.940
напишете 2 програми (1 со процедура, и 1 со макро) кои ќе ги соберат вредностите на AX I BX во CX. .
Кој може да ми помогне ми требаат сликите од симулаторот со задачиве???? може во masm симулатор или било кој :)
поздрав фалаа
Масм Симулатор? СЛИКИ? Знајш шо збораш?
бтв. прочитај го насловот. Колку плаќаш?
 
Член од
5 ноември 2008
Мислења
264
Поени од реакции
72
Часови за Структурирано и Објектно ориентирано програмирање на ЕТФ?
 
Член од
20 мај 2009
Мислења
3
Поени од реакции
0
Барам програмер asp.net C#

За решавање на еден проблем
 

back_rest

ex mod coder
Член од
19 јули 2006
Мислења
1.590
Поени од реакции
106
Споено со темата за побарувања.
 

jamajka

mode: Calm
Член од
28 април 2007
Мислења
18.611
Поени од реакции
26.121
potrebni se PHP MySQL, jQuery programeri

Potrebni se PHP/MySQL programeri za rabota na facebook aplikacija. Potrebno iskustvo 2 godini minimum.

berezitski@gmail.com
 

Kajgana Shop

На врв Bottom