This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { assert } from 'chai'; | |
import reconcileConfidenceScores from '../src/reconcileConfidenceScores'; | |
describe('reconcileConfidenceScores', () => { | |
it('filters out entries with empty confidence score inputs', () => { | |
const result = reconcileConfidenceScores([ | |
{ | |
score_conventional: 0, | |
score_non_conventional: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface ConfidenceScores { | |
score_conventional: number; | |
score_non_conventional: number; | |
score_non_wage?: number; | |
}; | |
/** | |
* Given a list of inflow streams with confidence scores separated for wage, non-wage, and non-conventional, | |
* filter out any inflow streams below all thresholds, then find and map the highest score remaining | |
* as the final confidence score for the inflow stream. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Computes the sum of the intercept and the dot product of the coefficients and features for logistic regression model | |
* Using the formula s = b[0] + sum(b[1:] * x[1:]) | |
* and then computes the confidence score from this sum using the formula p = 1 / (1 + exp(-s)) | |
* @param normalizedFeatureValues the `x` vector, or the normalized model features | |
* @param coefficients the `b` vector, or the coefficients | |
* @param modelType conventional or non-conventional | |
*/ | |
export const computeConfidenceScore = ({ | |
normalizedFeatureValues, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//James Xue | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
public class FindPalindromes | |
{ | |
public static void main(String args[]) throws IOException { |