Thursday, November 9, 2017

we were discussing modeling in general terms. We will be following slides from Costa, Kleinstein and Hershberg on Model fitting and error estimation.
A model articulates how a system behaves quantitatively. Models use numerical methods to examine complex situations and come up with predictions. Most common techniques involved for coming up with a model include statistical techniques, numerical methods, matrix factorizations and optimizations.  
Sometimes we relied on experimental data to corroborate the model and tune it. Other times, we simulated the model to see the predicted outcomes and if it matched up with the observed data. There are some caveats with this form of analysis. It is merely a representation of our understanding based on our assumptions. It is not the truth. The experimental data is closer to the truth than the model. Even the experimental data may be tainted by how we question the nature and not nature itself.  This is what Heisenberg and Covell warn against. A model that is inaccurate may not be reliable in prediction. Even if the model is closer to truth, garbage in may result in garbage out
#codingexercise
assign clusters to vectors as part of k-means:
void assign_clusters(int dimension, double** vectors, int* centroids, int* cluster_labels, int size, int k)

{

    for (int m = 0; m < size; m++)

    {

        double minimum = get_cosine_distance(dimension, vectors[centroids[cluster_labels[m]]], vectors[m]);

        for (int i = 0; i < k; i++)

        {

             double* centroid = vectors[centroids[i]];

             double distance = get_cosine_distance(dimension, centroid, vectors[m]);

             if (distance < minimum)

             {

                 cluster_labels[m] = i;

             }

        }

    }

}

No comments:

Post a Comment