Skip to content

Commit

Permalink
Pushed changes from the master version, phase 2, updated copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
myudelson committed Jul 17, 2014
1 parent 614a3f7 commit 665869e
Show file tree
Hide file tree
Showing 13 changed files with 450 additions and 145 deletions.
7 changes: 5 additions & 2 deletions FitBit.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -302,7 +302,8 @@ void FitBit::add(enum FIT_BIT_SLOT sourse_fbs, enum FIT_BIT_SLOT target_fbs) {
add(soursePI, sourseA, sourseB, targetPI, targetA, targetB);
}

bool FitBit::checkConvergence() {
bool FitBit::checkConvergence(FitResult *fr) {

NUMBER critetion = 0;
for(NPAR i=0; i<this->nS; i++)
{
Expand All @@ -315,6 +316,8 @@ bool FitBit::checkConvergence() {
}
}
return sqrt(critetion) < this->tol; // double the truth or false

// return (fr->pOmid - fr->pO) < this->tol;
}

void FitBit::doLog10ScaleGentle(enum FIT_BIT_SLOT fbs) {
Expand Down
4 changes: 2 additions & 2 deletions FitBit.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -84,7 +84,7 @@ class FitBit {
void destroy(enum FIT_BIT_SLOT fbs);
void copy(enum FIT_BIT_SLOT sourse_fbs, enum FIT_BIT_SLOT target_fbs);
void add(enum FIT_BIT_SLOT sourse_fbs, enum FIT_BIT_SLOT target_fbs);
bool checkConvergence();
bool checkConvergence(FitResult *fr);
void doLog10ScaleGentle(enum FIT_BIT_SLOT fbs);
private:
NUMBER tol;
Expand Down
2 changes: 1 addition & 1 deletion HMMProblem.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion HMMProblem.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion InputUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions InputUtil.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -39,7 +39,7 @@
#include "utils.h"

//#define bin_input_file_verstion 1
#define bin_input_file_verstion 2 // increase number of skills students to 4 bytes
#define bin_input_file_verstion 2 // increase number of skills/students to a 4 byte integer

class InputUtil {
public:
Expand Down
2 changes: 1 addition & 1 deletion StripedArray.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion StripedArray.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion inputconvert.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
7 changes: 3 additions & 4 deletions predicthmm.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2012, Michael (Mikhail) Yudelson
Copyright (c) 2012-2014, Michael (Mikhail) Yudelson
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -110,14 +110,13 @@ int main (int argc, char ** argv) {
// predict(predict_file, hmm);
if(param.quiet == 0)
printf("predicting is done in %8.6f seconds\n",(NUMBER)(clock()-tm)/CLOCKS_PER_SEC);
// THERE IS NO METRICS, WE PREDICT UNKNOWN, however, if we force prediction of all we do
// if( param.predictions>0 ) {
//if( param.predictions>0 ) {
printf("trained model LL=%15.7f (%15.7f), AIC=%8.6f, BIC=%8.6f, RMSE=%8.6f (%8.6f), Acc=%8.6f (%8.6f)\n",
metrics[0], metrics[1], // ll's
2*hmm->getNparams() + 2*metrics[0], hmm->getNparams()*safelog(param.N) + 2*metrics[0],
metrics[2], metrics[3], // rmse's
metrics[4], metrics[5]); // acc's
// }
//}
free(metrics);

destroy_input_data(&param);
Expand Down
Loading

0 comments on commit 665869e

Please sign in to comment.