Package etc.aloe.data

Examples of etc.aloe.data.Segment


    }

    private SegmentSet generateTestSegments(int numPositive, int numNegative) {
        List<Segment> segments = new ArrayList<Segment>();
        for (int i = 0; i < numPositive; i++) {
            segments.add(new Segment(true, null));
        }
        for (int i = 0; i < numNegative; i++) {
            segments.add(new Segment(false, null));
        }

        Collections.shuffle(segments);

        SegmentSet segmentSet = new SegmentSet();
View Full Code Here


        System.out.println("balance with unlabeled");

        SegmentSet segmentSet = generateTestSegments(20, 110);
        DownsampleBalancing instance = new DownsampleBalancing(1, 1);

        segmentSet.add(new Segment(null, null));
        try {
            SegmentSet result = instance.balance(segmentSet);
            assertTrue(false);
        } catch (IllegalArgumentException e) {
            assertTrue(true);
View Full Code Here

                    ";-)"
                });

        segments = new SegmentSet();

        Segment seg0 = new Segment();
        seg0.add(new Message(0, new Date(), "Alice", "it's"));
        seg0.add(new Message(1, new Date(), "Bob", "cow"));
        seg0.add(new Message(2, new Date(), "Alice", "time"));
        seg0.setTrueLabel(Boolean.TRUE);
        segments.add(seg0);

        Segment seg1 = new Segment();
        seg1.add(new Message(3, new Date(), "Bob", "noooooooo"));
        seg1.setTrueLabel(Boolean.FALSE);
        segments.add(seg1);

        Segment seg2 = new Segment();
        seg2.add(new Message(4, new Date(), "Bob", "once"));
        seg2.add(new Message(5, new Date(), "Alice", "upon"));
        seg2.setTrueLabel(Boolean.FALSE);
        segments.add(seg2);

        basicExamples = segments.getBasicExamples();
    }
View Full Code Here

     * Test of resolveLabel method, of class ResolutionImpl.
     */
    @Test
    public void testResolveLabel_AllNegative() {
        System.out.println("resolveLabel_AllNegative");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.FALSE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.FALSE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.FALSE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.FALSE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.FALSE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.FALSE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     * Test of resolveLabel method, of class ResolutionImpl.
     */
    @Test
    public void testResolveLabel_AllPositive() {
        System.out.println("resolveLabel_AllPositive");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.TRUE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.TRUE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.TRUE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.TRUE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.TRUE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.TRUE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     * Test of resolveLabel method, of class ResolutionImpl.
     */
    @Test
    public void testResolveLabel_OnePositive() {
        System.out.println("resolveLabel_OnePositive");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.FALSE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.TRUE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.FALSE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.FALSE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.FALSE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.TRUE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

            MessageSet messages = new MessageSet();
            Message message = new Message(0, time, participant, messageStr);
            messages.add(message);

            //Make a segment for the message
            Segment segment = new Segment();
            segment.add(message);
            SegmentSet segmentSet = new SegmentSet();
            segmentSet.add(segment);

            LabelingController labelingController = new LabelingController();
            factory.configureLabeling(labelingController);
View Full Code Here

     * Test of resolveLabel method, of class ResolutionImpl.
     */
    @Test
    public void testResolveLabel_OneNegative() {
        System.out.println("resolveLabel_OneNegative");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.TRUE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.TRUE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.TRUE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.FALSE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.TRUE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.TRUE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     * Test of resolveLabel method, of class ResolutionImpl.
     */
    @Test
    public void testResolveLabel_Unlabeled() {
        System.out.println("resolveLabel_Unlabeled");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", null));
        segment.add(new Message(2, new Date(), "Bob", "Hello", null));
        segment.add(new Message(3, new Date(), "Alice", "How are you", null));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", null));
        segment.add(new Message(5, new Date(), "Alice", "Yay", null));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = null;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

        rawMessages.add(new Message(8, new Date(), "Alice", "Hello8"));
        rawMessages.add(new Message(9, new Date(), "Alice", "Hello9"));
        rawMessages.add(new Message(10, new Date(), "Alice", "Hello10"));

        this.segments = new SegmentSet();
        Segment seg = new Segment();
        seg.add(rawMessages.get(0));
        this.segments.add(seg);

        seg = new Segment();
        seg.add(rawMessages.get(1));
        seg.add(rawMessages.get(2));
        this.segments.add(seg);

        seg = new Segment();
        seg.add(rawMessages.get(3));
        seg.add(rawMessages.get(4));
        seg.add(rawMessages.get(5));
        this.segments.add(seg);

        seg = new Segment();
        seg.add(rawMessages.get(6));
        seg.add(rawMessages.get(7));
        seg.add(rawMessages.get(8));
        seg.add(rawMessages.get(9));
        this.segments.add(seg);

        this.predictions = new Predictions();
        predictions.add(Boolean.TRUE, 1.0);
        predictions.add(Boolean.FALSE, 0.0);
View Full Code Here

TOP

Related Classes of etc.aloe.data.Segment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.