Commits

opticall committed 19f42be

fixed bug with filtered data in rescue step

Comments (0)

Files changed (1)

opticall/opticall.cpp

 	vector<int> filter_x;
 	vector<int> filter_y;
 
-	MatrixXd mod_data = data;//untransform_data(data);;
+	MatrixXd mod_data = untransform_data(data);;
 	MatrixXd maxVals = mod_data.colwise().maxCoeff();
 
+	//cout << "looking to exclude " << number_excluded << endl;
+
 	for (int i =0; i < number_excluded; i++) {
 		MatrixXd::Index minRow, minCol;
 		mod_data.col(0).minCoeff(&minRow, &minCol);
 
 	}
 
+	//cout << "got filters x and y " << filter_x.size() << " " << filter_y.size() << endl;
+
 	//get a filter of values that are small on both axes
 	vector<int> filter;
 	for (int i =0; i < filter_x.size(); i++) {
 		}
 	}
 
+	//cout << "filtering " << filter.size() << endl;
 
 
 
 		}
 	}
 
+	//cout << "data filtered" << endl;
+
 	return filtered_data;
 
 }
 	}
 	cost = RunKMeansPlusPlus(data_count, numclasses-numcustomclasses, dim,points, attempts, centres, assignments);
 
+	//cout << "kmeans was run" << endl;
+
+
 	MatrixXi assignment_count = MatrixXi::Zero(numclasses - numcustomclasses, 1);
 
 
+
 	for (int i = 0; i < data_count; i++) {
 		assignment_count(assignments[i],0)++;
 	}
 
+	//cout << "assignment count is " << assignment_count << endl;
+
 	/**
 	MatrixXi assignment_count_argsort(numclasses - numcustomclasses, 1);
 	//order the assignments from biggest class to smallest
     startjs.push_back(js4);
 	*/
 
+	//cout << "about to filter data" << endl;
 
     MatrixXd clean_data = int_data;
 	if ((int)(0.01*int_data.rows()) > 0) {
 		clean_data = filterMatrix(int_data,(int)(0.01*int_data.rows())  );
 	}
 
+	//cout << "filtered data " << endl;
 
 
 
     //probably best to scale the priors here
     //SCALING THE PRIOR MUS AND SDS
 
-
+    //cout << "going to scale data now" << endl;
 
 	MatrixXd priormus_scaled(numclasses,dim);
 	vector<MatrixXd> priorcovars_scaled;
 	//get the starting points
 	//cout << "setting starting points" << endl;
 
+
+
     set_starting_pts(int_data,starting_pts_mus,  starting_pts_covars,  starting_pts_js,
     		custommus, customcovars,
     		priormus_scaled, priorcovars_scaled, priorjs, priorvs, prior_sd);
 	    MatrixXd js(numclasses,1);
 
 
-	    //cout << "starting pt " << starting_pt << endl;
+	    cout << "starting pt " << starting_pt << endl;
+
 	    /*
 	    cout << "starting mus" << endl;
 	    cout << starting_pts_mus[starting_pt] << endl;
 		bool hwep_fail = false;
 		do {
 			stepcounter++;
-			//cout << "rescue step " << stepcounter << endl;
+			cout << "rescue step " << stepcounter << endl;
 
 
 
 
 			js = (mat_tijs.colwise().sum().transpose())/(1.0*mat_tijs.rows());
 
-			/*
-			cout << "js in rescue caller" << endl;
-			cout << js << endl;
-			*/
+
+			//cout << "js in rescue caller" << endl;
+			//cout << js << endl;
+
 
 			//MatrixXd noupdate = MatrixXi::Zero(1, sample.rows());
 
 				mus_normalizer.block(0,i,numclasses,1) = norm_factors;
 			}
 
-			/**
+
+			/*
 			cout << "mus sums in rescue caller" << endl;
 			cout << mus_sums << endl;
 			cout << "norm factors in rescue caller" << endl;
 		 */
 
 		if (  isnan(hwep) || hwep < 5*1e-15) {
-			cout << "Out of HWE, running Illuminus" << endl;
+			cout << "Out of HWE, running Rescue" << endl;
 
 			//ok so how will I do this?
 			//=============================
 
 
 			clock_t tStart = clock();
+			cout << "rescue calling step" << endl;
 			genotype_mm_rescue_caller(line_data, vs_ill_fix, custommus_ill_fix, customcovars_ill_fix,
 					blockmus_ill_fix,  blockcovars_ill_fix,  blockjs_ill_fix,  blockvs_ill_fix,
 					blockmus, blockcovars, blockjs, blockvs, sd_sample);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.