I am following this tutorial from Microsoft docs for linear regression using ML.Net. I am not able to determine why exactly do we need a class with a score column with the specific column name as 'Score'. I tried changing the column name from Score to something else which results in the following exception:
The classes I have declared for my Input and predictions are as follows:
public class TaxiTrip {
// All the columns inclusive of the label column
[LoadColumn(0)]
public string VendorId;
[LoadColumn(1)]
public string RateCode;
[LoadColumn(2)]
public float PassengerCount;
[LoadColumn(3)]
public float TripTime;
[LoadColumn(4)]
public float TripDistance;
[LoadColumn(5)]
public string PaymentType;
[LoadColumn(6)]
public float FareAmount;
}
public class TaxiTripFarePrediction {
[ColumnName("PredictionScore")]
public float FareAmount;
}
Also as I never specified the class TaxiTripFarePrediction anywhere either in the training function or in the Evaluate function as shown above how does the model work when I specify the column name as Score instead of something else?
The similar scenario was seen for the Label column.
The TaxiTripFarePrediction class represents predicted results. It has a single float field, FareAmount, with a Score attribute applied. In case of the regression task, the Score column contains predicted label values.
I'm new in ML and I think Score and Features cannot change the properties. You can refer this link: https://learn.microsoft.com/en-us/dotnet/machine-learning/how-does-mldotnet-work#mlnet-architecture
You can see this image. Score and Features are generated by algorithms
Related
I have been using the following property in my entity
public decimal smallamount { get; set; }
It persists to a SQL Server column of type smallmoney.
I get a warning
No type was specified for the decimal column "smallamount" on entity type jobline.
This will cause values to be silently truncated if they do not fit in the default precision and scale.
Explicitly specify the SQL Server column type that can accommodate all the values using 'ForHasColumnType()'.
I gather I can use a column attribute
For example
[Column(TypeName = "decimal(10, 2)")]
Or alternatively use the modelbuilder HasPrecision property.
But where can I find out what precision I should use?
I have successfully used the following to get the shortest path using A* in the APOC library.
apoc.algo.aStar("A", "B", 'Link', 'Length','X','Y') YIELD path, weight
apoc.algo.aStar("A", "B", 'Link', {weight:'Length',default:1, x:'X',y:'Y'}) YIELD path, weight
How would I go about adding a filter so that it only uses edges where "Value" is true. The documentation doesn't provide an example.
public class Node{
public long Id {get;set;}
public string Name {get;set;}
public long X {get;set;}
public long Y {get;set;}
}
public class Link{
public bool Value {get;set;}
public long Length {get;set;}
}
There is no example because this feature is not available.
So you have three choices :
add a Length value very high on relationships where "Value" is true
modify your model by adding the property "Value" in the relationship type (ie to have two types : Link_On and Link_value_Off), so you can use the apoc procedure.
create your own A* procedure by taking example on the one from APOC (source code here)
I'm currently struggling with a problem regarding combinatorics.
For a prototype I wanted to try neo4j-ogm.
This is the domain model I designed so far:
#NodeEntity
public class Operand {
#GraphId
private Long graphId;
}
#NodeEntity
public class Option extends Operand {
private Long id;
private String name;
#Relationship(type = "CONDITIONED_BY")
private List<Rule> rules = new ArrayList<>();
}
#NodeEntity
public class Operation extends Operand {
#Relationship(type = "COMPOSITION", direction = Relationship.INCOMING)
private Rule composition;
private Operation superOperation;
private Boolean not;
private List<Operand> operands = new ArrayList<>();
}
public class AndOperation extends Operation {
// Relationships named accordingly "AND"
}
public class OrOperation extends Operation {
// Relationships named accordingly "OR"
}
#NodeEntity
public class Rule {
#GraphId
private Long graphId;
#Relationship(type = "COMPOSITION")
private Operation composition;
#Relationship(type = "CONDITIONED_BY", direction = Relationship.INCOMING)
private Option option;
}
This is a snippet of my graph:
representing something like (167079 ^ ...) & (167155 ^ ...)
Is it possible to form a query in cypher resulting in all possible combinations?
167079, 167155
167079, 167092
...
I found this resource dealing with a distantly related problem so far.
Do you think this is a proper use case for neo4j?
Do you propose any changes in the domain model?
Do you suggest any other technology?
Edit:
The example graph only shows a small part of my original graph, I'd have to calculate the permutation with various depth and various encapsulated operations.
Yes, we can get this by collecting on each side the equation (two collections) and then unwinding each collection.
Assuming the two collections are passed in as parameters:
UNWIND {first} as first
UNWIND {second} as second
RETURN first, second
This should give you a cartesian product between elements of both collections.
EDIT
If know know how many AND branches you have (let's say 2 for example), you can form your query like this:
MATCH (first)<-[:OR*0..]-()<-[:AND]-(root)-[:AND]->()-[:OR*0..]->(second)
WHERE id(root) = 168153
RETURN first, second
(edit, the match itself will generate the cartesian product for you here)
As for operations where you don't know how many AND branches you have, I don't believe you can accomplish this using this approach with just Cypher, as I don't believe dynamic columns are supported.
You might be able to do this using collections, though the operations would be tricky.
A custom procedure to perform cross products given two collections would be very helpful in this case. If you could collect all collections of nodes along AND branches, you could run REDUCE() on that, applying the cross product procedure with each collection.
As far as more complex trees with more operations, I don't believe you'll be able to do this through Cypher. I'd highly recommend a custom procedure, where you'll have far more control and be able to use conditional logic, recursion, and method calls.
Is there a way to get both the Final Calculated Grade and the Final Adjusted Grade? I would like to be able to compare them.
I'm wondering:
GET /d2l/api/le/(version)/(orgUnitId)/grades/values/(userId)/
Retrieve all the grade objects for a particular user assigned in an org unit.
Return. This action returns a JSON array of GradeValue blocks.
Grade.GradeValue{
"DisplayedGrade": <string>,
"GradeObjectIdentifier": <string:D2LID>,
"GradeObjectName": <string>,
"GradeObjectType": <number:GRADEOBJ_T>,
"GradeObjectTypeName": <string>|null,
"PointsNumerator": <number>|null,
"PointsDenominator": <number>|null,
"WeightedDenominator": <number>|null,
"WeightedNumerator": <number>|null
}
and then look at the "GradeObjectType" for "7" or "8"?
Grade object type / Value
FinalCalculated / 7 ^
FinalAdjusted / 8 ^
(I wonder what is meant by "^ Direct creation of these types through these APIs is not supported.")
It seems the best solution (or workaround) is to retrieve the final grade, determine what column it's coming from, and then subtract or add (+1 / -1) to the objectID to get the corresponding Calculated or Adjusted column.
I believe that there currently is no way to retrieve the final adjusted grade value through the Valence Learning Framework API, only the final calculated grade value. Additionally, end-user type callers can only see the final grade when the grade gets released: up until that point, only users capable of setting a final grade value (or perhaps releasing it?) can see the final grade value for a user.
I have an existing database that I can't change. I have a column of type int that has various numbers that mean something.
This something would be a string. For example, 1="dog", 2="cat", 3="bird". There are a dozen or so integers to deal with.
I'm using ASP.NET MVC 3 with EF 4.1 and have a WebGrid binding to the Model. Is there a way to alias the data for these integers listed in the WebGrid to display the string value that mean something to the user?
Any help on this would be greatly appreciated!
Add an enum to your Model:
public enum foo
{
dog = 1, cat, bird //etc
}
Hopefully, you are using ViewModels. If you are, add a property for the enum:
public foo thing {get;set;}
And set the value of thing based on the integer value you get from the database:
Model m = new Model{number = 3};
m.thing = (foo) m.number;
Or you could create a helper and use that within the format parameter to set a value based on the integer, or you could use JavaScript/jQuery to alter the values from ints to strings once they have been rendered to the browser.