~ubuntu-branches/ubuntu/maverick/speech-tools/maverick

« back to all changes in this revision

Viewing changes to main/ols_main.cc

  • Committer: Bazaar Package Importer
  • Author(s): Kumar Appaiah, Kartik Mistry, Kumar Appaiah
  • Date: 2010-07-17 11:32:04 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100717113204-mnse3jo236j107q8
Tags: 1:2.0.95~beta-1
[ Kartik Mistry ]
* debian/control:
  + [Lintian] Added missing ${misc:Depends}
  + Updated Standards-Version to 3.8.4 (no changes needed)
* debian/patches/const_char.diff:
  + Added missing patch header
* Removed unused patch invalid_const_char_conversion_fixes.diff

[ Kumar Appaiah ]
* New upstream release.
* Standards Version is now 3.9.0 (No changes needed)
* Update debian/rules to specify version numbers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
        return -1;
135
135
    }
136
136
    else
 
137
    {
137
138
        dataset.load_description(al.val("-desc"),ignores);
 
139
        dataset.ignore_non_numbers();
 
140
    }
138
141
    if (!al.present("-data"))
139
142
    {
140
143
        cerr << "ols: no data file specified\n";
145
148
    if (al.present("-test"))
146
149
    {
147
150
        test_dataset.load_description(al.val("-desc"),ignores);
 
151
        test_dataset.ignore_non_numbers();
148
152
        wgn_load_dataset(test_dataset,al.val("-test"));
149
153
        load_ols_data(Xtest,Ytest,test_dataset);
150
154
    }
158
162
    {
159
163
        EST_StrList names;
160
164
        float swlimit = al.fval("-swlimit");
 
165
        EST_IVector included;
 
166
        int i;
161
167
 
162
168
        names.append("Intercept");
163
 
        for (int i=1; i < dataset.width(); i++)
 
169
        for (i=1; i < dataset.width(); i++)
164
170
            names.append(dataset.feat_name(i));
165
171
 
166
 
        if (!stepwise_ols(X,Y,names,swlimit,coeffs,Xtest,Ytest))
 
172
        included.resize(X.num_columns());
 
173
        included[0] = TRUE;  // always guarantee interceptor
 
174
        for (i=1; i<included.length(); i++)
 
175
        {
 
176
            if (dataset.ignore(i) == TRUE)
 
177
                included.a_no_check(i) = OLS_IGNORE;
 
178
            else
 
179
                included.a_no_check(i) = FALSE;
 
180
        }
 
181
 
 
182
        if (!stepwise_ols(X,Y,names,swlimit,coeffs,Xtest,Ytest,included))
167
183
        {
168
184
            cerr << "OLS: failed stepwise ols" << endl;
169
185
            return -1;
171
187
    }
172
188
    else if (al.present("-robust"))
173
189
    {
174
 
        if (!robust_ols(X,Y,coeffs))
 
190
        EST_IVector included;
 
191
        int i;
 
192
 
 
193
        included.resize(X.num_columns());
 
194
        included[0] = TRUE;  // always guarantee interceptor
 
195
        for (i=1; i<included.length(); i++)
 
196
        {
 
197
            if (dataset.ignore(i) == TRUE)
 
198
                included.a_no_check(i) = OLS_IGNORE;
 
199
            else
 
200
                included.a_no_check(i) = TRUE;
 
201
        }
 
202
 
 
203
        if (!robust_ols(X,Y,included,coeffs))
175
204
        {
176
205
            cerr << "OLS: failed robust ols" << endl;
177
206
            return -1;
217
246
        Y.a_no_check(n,0) = d(p)->get_flt_val(0);
218
247
        X.a_no_check(n,0) = 1;
219
248
        for (m=1; m < d.width(); m++)
220
 
            X.a_no_check(n,m) = d(p)->get_flt_val(m);
 
249
        {
 
250
            if (d.ignore(m))
 
251
            {
 
252
                X.a_no_check(n,m) = 0;
 
253
            }
 
254
            else
 
255
                X.a_no_check(n,m) = d(p)->get_flt_val(m);
 
256
        }
221
257
    }
222
258
 
223
259
}