Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Replace DvBool with .NET standard type. - #692

Closed
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool
Closed

Replace DvBool with .NET standard type.#692
codemzs wants to merge 20 commits into
dotnet:masterfrom
codemzs:dvbool

Conversation

@codemzs

@codemzscodemzs commented Aug 18, 2018

Copy link
Copy Markdown
Member

fixes#673

@codemzscodemzs changed the title Replace DvBool with .NET standard for Boolean type.Replace DvBool with .NET standard type.Aug 19, 2018
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 77, length = 4)

you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course.


In reply to: 211109130 [](ancestors = 211109130)

// Bool -> Bool.
Ch.Assert(colType.IsBool);
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA);
return CreateConvertingGetterDelegate<bool, bool>(index, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CreateConvertingGetterDelegate<bool, bool>(index, x => x); [](start = 27, length = 66)

not needed, fall back to T-> T default #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep.


In reply to: 211109149 [](ancestors = 211109149)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
{
Ch.Assert(colType.ItemType.IsBool);
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x);
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fall back to // VBuffer -> T[] #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct.


In reply to: 211109159 [](ancestors = 211109159)

Comment threadsrc/Microsoft.ML.Api/TypedCursor.cs Outdated
Ch.Assert(colType.IsBool);
Ch.Assert(peek == null);
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x);
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateConvertingActionSetter [](start = 31, length = 28)

fall back to // T -> T #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falling back ...


In reply to: 211109169 [](ancestors = 211109169)

using System.Text;
using System.Threading;
using Microsoft.ML.Runtime.Internal.Utilities;
using System.Runtime.CompilerServices;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting #Resolved

if (!src)
dst.Append("0");
else if (src.IsTrue)
else if (src)

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (src) [](start = 17, length = 8)

this if looks redundant #Resolved

public void Convert(ref BL src, ref I8 dst) => dst = (I8)src;
public void Convert(ref BL src, ref R4 dst) => dst = (R4)src;
public void Convert(ref BL src, ref R8 dst) => dst = (R8)src;
public void Convert(ref BL src, ref R4 dst) => dst = System.Convert.ToSingle(src);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System [](start = 61, length = 6)

you have using System; in beginning of file, is this System necessary? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it doesn't seem to recognize otherwise.


In reply to: 211109280 [](ancestors = 211109280)

bldr.AddPrimitive("CdfMean", typeSrc, Mean);
bldr.AddPrimitive("CdfStdDev", typeSrc, Stddev);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(bool) [](start = 70, length = 6)

not necessary, UseLog already bool #Resolved

bldr.AddGetter<VBuffer<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
bldr.AddGetter<VBuffer<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (DvBool)UseLog);
bldr.AddPrimitive("CdfUseLog", BoolType.Instance, (bool)UseLog);

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool [](start = 71, length = 4)

not necessary, UseLog already bool #Resolved

// Assigns values correctly depending on the sense.
DvBool hit = sense ? DvBool.True : DvBool.False;
DvBool miss = sense ? DvBool.False : DvBool.True;
bool hit = sense;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hit = sense; [](start = 16, length = 17)

is it necessary? can you just use sense instead of hit? (I'm totally fine with miss) #Resolved

public sealed class DvTypeTests
{
[Fact]
public void TestComparableDvInt4()

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestComparableDvInt4 [](start = 20, length = 20)

why you removing whole test? Is DvInt4 gone already or in this PR? #Resolved

@codemzscodemzsAug 19, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another PR that removes DvInt* #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its gone in DvInt4 PR.


In reply to: 211109511 [](ancestors = 211109511)

public ulong? fuLong;
public float? fFloat;
public double? fDouble;
public bool? fBool;

@Ivanidzo4kaIvanidzo4kaAug 19, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public bool? fBool; [](start = 12, length = 19)

This kinda make me sad.
I understand what we want to have pure framework, and as workaround we force people to cast everything to float which support NaNs, it just in my life I worked with Something2SQL frameworks, and quite often you have nullable boolean columns, and if they fetch through DTO object, it will make that object uncastable /unwrappable for our collection to dataview.
Which will lead to bunch of painful casting/objects recreations.
But again, what do I know about life. #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, read Tom's comment on the issue page you might become happy! :)


In reply to: 211109825 [](ancestors = 211109825)

@Ivanidzo4ka

Ivanidzo4ka commented Aug 20, 2018

Copy link
Copy Markdown
Contributor

Can you link issue which trigger this PR? #Resolved

@danmoseley

danmoseley commented Aug 20, 2018

Copy link
Copy Markdown

Are you removing DvBool.cs in a followup PR? #Resolved

}

[Fact]
public void NullableBooleanLabelPipeline()

@eerhardteerhardtAug 20, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we decided we wanted to support bool?? #Resolved

@codemzscodemzsAug 21, 2018

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a compelling reason?

CC: @TomFinley #Resolved

@eerhardteerhardtAug 21, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Tom, didn't think there is a compelling reason to support bool? But if you can think of something then let me know. There were two places where bool? was being used in the codebase and they were both in prediction label from score, i.e if score was null then assign predicted label as NA but we defaulted to false for missing and you can see the change in test results. Tom is ok with this.


In reply to: 211434928 [](ancestors = 211434928)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is from nullable stuff that comes in from sql tables, we don;t need to support this, please see Tom;s comment on the issue comment section.


In reply to: 211678395 [](ancestors = 211678395)

@codemzs

Copy link
Copy Markdown
MemberAuthor

Yes.


In reply to: 414418364 [](ancestors = 414418364)

var oldBool = new OldBoolCodec(this);
RegisterOtherCodec(oldBool.LoadName, oldBool.GetCodec);

RegisterOtherCodec("DvBool", oldBool.GetCodec);

@eerhardteerhardtAug 28, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we removed DvBool. ? #Resolved

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for backward compatibility, incase someone saves a dataset in IDV format with the old DvTypes and loads in ML.NET without DvTypes.


In reply to: 213403080 [](ancestors = 213403080)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't doing that for the other Dv types.... Why are we doing it for DvBool?


In reply to: 213408068 [](ancestors = 213408068,213403080)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing for DvDate/Time as well. For DvInt we don't need to change because the key for codec has not changed. The key is used to retrieve the codec to parse when the loader reads the signature string.

DvBool is the only codec where we have also modified the codec as well to use one bit to write a boolean value as opposed to two bits. We need the old codec to read values from IDV that was written using DvBool.


In reply to: 213420305 [](ancestors = 213420305,213408068,213403080)

@eerhardteerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@shauheenshauheen added the enhancement New feature or request label Aug 28, 2018
@shauheenshauheen added this to the 0818 milestone Aug 28, 2018
@shauheenshauheen removed this from the 0818 milestone Aug 31, 2018
…to dvbool
# Conflicts:
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleDebug/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Data.txt
#	test/BaselineOutput/SingleRelease/SavePipe/TestParquetPrimitiveDataTypes-Schema.txt
#	test/data/Parquet/alltypes.parquet
…to dvbool
# Conflicts:
#	src/Microsoft.ML.Data/Transforms/NormalizeTransform.cs
@codemzs

Copy link
Copy Markdown
MemberAuthor

This change was committed via #863

@codemzscodemzs closed this Sep 20, 2018
@codemzs
codemzs deleted the dvbool branch September 20, 2018 18:17
@ghostghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET data type system instead of DvTypes

5 participants

@codemzs@Ivanidzo4ka@danmoseley@eerhardt@shauheen