-
Notifications
You must be signed in to change notification settings - Fork 1.9k
GetSummaryDataView() implementation for Pca and Linear Predictors #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ec890d6
9394cdd
b508e68
e072546
ec8200a
cf37f62
9943586
45cd5f2
083645f
58d0f31
c5c0173
695abc5
eea9c69
637b325
bdec903
b942537
678633c
3031a4c
b0c2e49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -476,9 +476,30 @@ public IDataView GetSummaryDataView(RoleMappedSchema schema) | |
{ | ||
var bldr = new ArrayDataViewBuilder(Host); | ||
|
||
bldr.AddColumn("MeanVector", NumberType.R4, _mean); | ||
bldr.AddColumn("ProjectedMeanVector", NumberType.R4, _meanProjected); | ||
bldr.AddColumn("EigenVectors", NumberType.R4, _eigenVectors); | ||
var cols = new VBuffer<Float>[_rank + 1]; | ||
var names = new string[_rank + 1]; | ||
for (var i = 0; i < _rank; ++i) | ||
{ | ||
names[i] = "EigenVector" + i; | ||
cols[i] = _eigenVectors[i]; | ||
} | ||
names[_rank] = "MeanVector"; | ||
cols[_rank] = _mean; | ||
|
||
ValueGetter<VBuffer<DvText>> getSlotNames = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We probably don't need the slot names here since they don't give any additional information other than the slot index. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
(ref VBuffer<DvText> dst) => | ||
{ | ||
var values = new DvText[_dimension]; | ||
for (var i = 0; i < _dimension; ++i) | ||
values[i] = new DvText("Dim" + i); | ||
|
||
var tmp = new VBuffer<DvText>(_dimension, values); | ||
tmp.CopyTo(ref dst); | ||
}; | ||
|
||
bldr.AddColumn("VectorName", names); | ||
bldr.AddColumn("VectorData", getSlotNames, NumberType.R4, cols); | ||
|
||
return bldr.GetDataView(); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For single line statements like this, prefer this:
to this
Those extra
{
s are evil.Edit: for one line statements, to be clear. I'm not a monster. #Closed